[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Disassemblere til linux ?



On Sun, 13 Jun 1999, Valery Kotchiev wrote:

> 1. Er der nogle disassemblere til linux ?

Du kan proeve objdump. Eksempel:

cat test.c
int main(int argc, char **argv) {
        return argc+2;
}

gcc -g test.c -o test

objdump -dS test (-d disassamble, -S show source)

08048540 <main>:
 8048540:       55                      pushl  %ebp
 8048541:       89 e5                   movl   %esp,%ebp
        return argc+2;
 8048543:       8b 55 08                movl   0x8(%ebp),%edx
 8048546:       83 c2 02                addl   $0x2,%edx
 8048549:       89 d0                   movl   %edx,%eax
 804854b:       eb 03                   jmp    8048550 <main+0x10>
}
 804854d:       8d 76 00                leal   0x0(%esi),%esi
 8048550:       89 ec                   movl   %ebp,%esp
 8048552:       5d                      popl   %ebp
 8048553:       c3                      ret


Mens du er inde i gdb kan du ogsaa vise instruktionerne, via x/i:

(gdb) x/10i main
0x8048540 <main>:       pushl  %ebp
0x8048541 <main+1>:     movl   %esp,%ebp
0x8048543 <main+3>:     movl   0x8(%ebp),%edx
0x8048546 <main+6>:     addl   $0x2,%edx
0x8048549 <main+9>:     movl   %edx,%eax
0x804854b <main+11>:    jmp    0x8048550 <main+16>
0x804854d <main+13>:    leal   0x0(%esi),%esi
0x8048550 <main+16>:    movl   %ebp,%esp
0x8048552 <main+18>:    popl   %ebp
0x8048553 <main+19>:    ret


> 2. Findes der en hexeditor med indbygget assembler til linux, der svarer
> til  HackersView som desværre kun findes til DOS.

Har du proevet www.freshmeat.net ?

> 3. Hvad sker der hvis man propper nogle 0xCC (int 3 opcode) i de
> strategiske steder i et program, vil de breakpointvirkningen i gdb ?

Du kan proeve det -- men gdb holder jo selv oeje med hvilket breakpoints
den har sat hvor, saa den vil nok bliver forvirret af dine breakpoints.



-- 
==============================================================================
Erwin Andreasen   Herlev, Denmark <sslug@sslug>          UNIX System Programmer
<URL:http://www.andreasen.org>              <*>         (not speaking for) DDE
==============================================================================



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *