and well i dont know if the bfd version matter
gdb was not my first choice i switched to gdb only when i saw i have to memory modify eax after your ptrace detection
ald loads it fine as well
Code:
ald ./oxfoo1m3
Assembly Language Debugger 0.1.7
Copyright (C) 2000-2004 Patrick Alken
./oxfoo1m3: ELF Intel 80386 (32 bit), LSB - little endian, Executable, Version 1 (Current)
Loading debugging symbols...(no symbols found)
ald> disassemble -n 3 0x8048080
08048080 E801000000 call near +0x1 (0x8048086)
08048085 E95A81C20B jmp near +0xbc2815a (0x13c701e4)
0804808A 0000 add byte [eax], al
ald> s
eax = 0x00000000 ebx = 0x00000000 ecx = 0x00000000 edx = 0x00000000
esp = 0xBFFFE53C ebp = 0x00000000 esi = 0x00000000 edi = 0x00000000
ds = 0x002B es = 0x002B fs = 0x0000 gs = 0x0000
ss = 0x002B cs = 0x0023 eip = 0x08048086 eflags = 0x00000346
Flags: PF ZF TF IF
08048086 5A pop edx
ald>
ald> s
eax = 0x00000000 ebx = 0x00000000 ecx = 0x00000000 edx = 0x08048085
esp = 0xBFFFE540 ebp = 0x00000000 esi = 0x00000000 edi = 0x00000000
ds = 0x002B es = 0x002B fs = 0x0000 gs = 0x0000
ss = 0x002B cs = 0x0023 eip = 0x08048087 eflags = 0x00000346
Flags: PF ZF TF IF
08048087 81C20B000000 add edx, 0xb
ald>
and i meant this when i talked about your decryption
Code:
080480C2 BE96810408 mov esi, 0x8048196
ald> e esi
Dumping 64 bytes of memory starting at 0x08048196 in hex
08048196: CC B0 59 58 58 58 B1 02 D9 9A 53 58 58 58 0A 9B ..YXXX....SXXX..
080481A6: B1 D9 9A 56 58 58 58 0A 30 05 D3 5C 50 9B B0 D9 ...VXXX.0..\P...
080481B6: 99 78 58 58 58 69 98 D1 9A 18 D1 9B 99 B8 5A 5A .xXXXi........ZZ
080481C6: 4D B2 D9 5C 50 B0 D2 5E 58 58 B1 4E 58 58 58 37 M..\P..^XX.NXXX7
0804810D B9800A0000 mov ecx, 0xa80
08048135 AC lodsb
ald>
eax = 0x000000CC ebx = 0x00000000 ecx = 0x00000A80 edx = 0x08048130
esp = 0xBFFFE53C ebp = 0x00000000 esi = 0x08048197 edi = 0x08048196
ds = 0x002B es = 0x002B fs = 0x0000 gs = 0x0000
ss = 0x002B cs = 0x0023 eip = 0x08048136 eflags = 0x00000316
Flags: PF AF TF IF
08048136 E801000000 call near +0x1 (0x804813c)
08048154 3458 xor al, 0x58
08048174 AA stosb
08048193 E2A0 loop +0xa0 (0x8048235)
ald> disassemble -n 3 0x8048193
08048193 E2A0 loop +0xa0 (0x8048235)
08048195 C3 retn
08048196 94 xchg eax, esp
ald>
ald> break 0x8048195
Breakpoint 1 set for 0x08048195
ald> c
Breakpoint 1 encountered at 0x08048195
eax = 0x00000080 ebx = 0x00000000 ecx = 0x00000000 edx = 0x08048193
esp = 0xBFFFE53C ebp = 0x00000000 esi = 0x08048C16 edi = 0x08048C16
ds = 0x002B es = 0x002B fs = 0x0000 gs = 0x0000
ss = 0x002B cs = 0x0023 eip = 0x08048195 eflags = 0x00000216
Flags: PF AF IF
08048195 C3 retn
after this its a simple matter of keeping the finger pressed in enter key and notice
Code:
08048783 D1E0 shl eax, 1
ald>
eax = 0x0000001A ebx = 0x00000000 ecx = 0x00000001 edx = 0x00000000
esp = 0xBFFFE53C ebp = 0x00000000 esi = 0x00000000 edi = 0x08048C16
ds = 0x002B es = 0x002B fs = 0x0000 gs = 0x0000
ss = 0x002B cs = 0x0023 eip = 0x08048785 eflags = 0x00000302
Flags: TF IF
08048785 9C pushfd
ald>
eax = 0x0000001A ebx = 0x00000000 ecx = 0x00000001 edx = 0x00000000
esp = 0xBFFFE538 ebp = 0x00000000 esi = 0x00000000 edi = 0x08048C16
ds = 0x002B es = 0x002B fs = 0x0000 gs = 0x0000
ss = 0x002B cs = 0x0023 eip = 0x08048786 eflags = 0x00000302
Flags: TF IF
08048786 60 pushad
some thing happened there lets slow down and hit enter once each time
Code:
080489C4 0F8489FCFFFF je near +0xfffffc89 (0x8048653)
ald> disassemble -n 3 0x8048653
08048653 E801000000 call near +0x1 (0x8048659)
08048658 E95A81C20B jmp near +0xbc2815a (0x13c707b7)
0804865D 0000 add byte [eax], al
ald> disassemble -n 3 0x8048659
08048659 5A pop edx
0804865A 81C20B000000 add edx, 0xb
08048660 52 push edx
so disassembling further we know it return to foo1 we dont want to go here
lets memory patch flags modify registers do whatever till we succeed
