Asembler - zadanie

biq

Użytkownik
Dołączył
Kwiecień 18, 2010
Posty
1
Witam serdecznie,

Na wstępie zaznaczę, że jak do tej pory poznałem podstawy
podstaw asemblera. To zadanie jednak mnie przerasta bardzo.

Moim zadaniem jest zdebugowanie programu wykonywalnego oraz
znalezienie odpowiedzi na pytanie:

-> Co należy podać programowi aby wyświetlił się tekst "Brawo!". (Program jest napisany pod linuxa)

Wynik komendy:

-> objdump -D objdump -D

Kod:
Kod:
zagadka:     file format elf32-i386

Disassembly of section .note.gnu.build-id:

080480b4 <.note.gnu.build-id>:
 80480b4:   04 00                   add    $0x0,%al
 80480b6:   00 00                   add    %al,(%eax)
 80480b8:   14 00                   adc    $0x0,%al
 80480ba:   00 00                   add    %al,(%eax)
 80480bc:   03 00                   add    (%eax),%eax
 80480be:   00 00                   add    %al,(%eax)
 80480c0:   47                      inc    %edi
 80480c1:   4e                      dec    %esi
 80480c2:   55                      push   %ebp
 80480c3:   00 71 1a                add    %dh,0x1a(%ecx)
 80480c6:   f8                      clc   
 80480c7:   6e                      outsb  %ds:(%esi),(%dx)
 80480c8:   87 aa ea f9 93 3e       xchg   %ebp,0x3e93f9ea(%edx)
 80480ce:   de ee                   fsubrp %st,%st(6)
 80480d0:   e7 01                   out    %eax,$0x1
 80480d2:   1e                      push   %ds
 80480d3:   78 e8                   js     80480bd <print-0x1b>
 80480d5:   d7                      xlat   %ds:(%ebx)
 80480d6:   d4 2d                   aam    $0x2d

Disassembly of section .text:

080480d8 <print>:
 80480d8:   55                      push   %ebp
 80480d9:   89 e5                   mov    %esp,%ebp
 80480db:   83 ec 10                sub    $0x10,%esp
 80480de:   a1 82 81 04 08          mov    0x8048182,%eax
 80480e3:   8b 15 86 81 04 08       mov    0x8048186,%edx
 80480e9:   89 45 f4                mov    %eax,-0xc(%ebp)
 80480ec:   89 55 f8                mov    %edx,-0x8(%ebp)
 80480ef:   c7 45 fc 07 00 00 00    movl   $0x7,-0x4(%ebp)
 80480f6:   8b 55 fc                mov    -0x4(%ebp),%edx
 80480f9:   8d 45 f4                lea    -0xc(%ebp),%eax
 80480fc:   89 d2                   mov    %edx,%edx
 80480fe:   89 c1                   mov    %eax,%ecx
 8048100:   bb 01 00 00 00          mov    $0x1,%ebx
 8048105:   b8 04 00 00 00          mov    $0x4,%eax
 804810a:   cd 80                   int    $0x80
 804810c:   c9                      leave 
 804810d:   c3                      ret   

0804810e <_start>:
 804810e:   55                      push   %ebp
 804810f:   89 e5                   mov    %esp,%ebp
 8048111:   56                      push   %esi
 8048112:   53                      push   %ebx
 8048113:   83 ec 20                sub    $0x20,%esp
 8048116:   c7 45 de 2d 2d 2d 2d    movl   $0x2d2d2d2d,-0x22(%ebp)
 804811d:   c7 45 e2 2d 2d 2d 2d    movl   $0x2d2d2d2d,-0x1e(%ebp)
 8048124:   c7 45 e6 2d 2d 2d 2d    movl   $0x2d2d2d2d,-0x1a(%ebp)
 804812b:   c7 45 ea 2d 2d 2d 2d    movl   $0x2d2d2d2d,-0x16(%ebp)
 8048132:   c7 45 ee 2d 2d 2d 20    movl   $0x202d2d2d,-0x12(%ebp)
 8048139:   66 c7 45 f2 20 00       movw   $0x20,-0xe(%ebp)
 804813f:   8d 75 de                lea    -0x22(%ebp),%esi
 8048142:   b8 03 00 00 00          mov    $0x3,%eax
 8048147:   bb 00 00 00 00          mov    $0x0,%ebx
 804814c:   ba 05 00 00 00          mov    $0x5,%edx
 8048151:   89 f1                   mov    %esi,%ecx
 8048153:   cd 80                   int    $0x80
 8048155:   89 c6                   mov    %eax,%esi
 8048157:   89 75 f4                mov    %esi,-0xc(%ebp)
 804815a:   0f b6 45 de             movzbl -0x22(%ebp),%eax
 804815e:   0f be c0                movsbl %al,%eax
 8048161:   01 c0                   add    %eax,%eax
 8048163:   3d a8 00 00 00          cmp    $0xa8,%eax
 8048168:   75 05                   jne    804816f <_start+0x61>
 804816a:   e8 69 ff ff ff          call   80480d8 <print>
 804816f:   bb 00 00 00 00          mov    $0x0,%ebx
 8048174:   b8 01 00 00 00          mov    $0x1,%eax
 8048179:   cd 80                   int    $0x80
 804817b:   83 c4 20                add    $0x20,%esp
 804817e:   5b                      pop    %ebx
 804817f:   5e                      pop    %esi
 8048180:   5d                      pop    %ebp
 8048181:   c3                      ret   

Disassembly of section .rodata:

08048182 <.rodata>:
 8048182:   42                      inc    %edx
 8048183:   72 61                   jb     80481e6 <_start+0xd8>
 8048185:   77 6f                   ja     80481f6 <_start+0xe8>
 8048187:   21 0a                   and    %ecx,(%edx)
   ...

Disassembly of section .comment:

00000000 <.comment>:
   0:   47                      inc    %edi
   1:   43                      inc    %ebx
   2:   43                      inc    %ebx
   3:   3a 20                   cmp    (%eax),%ah
   5:   28 44 65 62             sub    %al,0x62(%ebp,%eiz,2)
   9:   69 61 6e 20 34 2e 33    imul   $0x332e3420,0x6e(%ecx),%esp
  10:   2e                      cs
  11:   34 2d                   xor    $0x2d,%al
  13:   36 29 20                sub    %esp,%ss:(%eax)
  16:   34 2e                   xor    $0x2e,%al
  18:   33 2e                   xor    (%esi),%ebp
  1a:   34 00                   xor    $0x0,%al
 

cyber_pl

Użytkownik
Dołączył
Wrzesień 30, 2009
Posty
187
Spróbuj wpisać literę "T" bo to dokładnie 2 * 0xa8
 
Do góry Bottom