crassy
May 7th, 2012, 10:18
Not really malware, but unpacking... I'm curious how the Mac OSX dock (/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock) is encrypted.
The entry point (from the Mach-O header) is 0x1000af4d0
Disassembling the binary gives me bullshit:
When starting the process with GDB and putting a breakpoint at the same address I get a much more sensible disassembly:
So probably *something* is writing to the process memory before it gets started... But how is that something started? And why doen't gdb break when I put a write breakpoint at that address?
Anyone can point me in the right direction here?
The entry point (from the Mach-O header) is 0x1000af4d0
Disassembling the binary gives me bullshit:
Code:
__text:00000001000AF4B0 db 49h, 3Bh
__text:00000001000AF4B2 ; ---------------------------------------------------------------------------
__text:00000001000AF4B2
__text:00000001000AF4B2 loc_1000AF4B2: ; CODE XREF: __text:startj
__text:00000001000AF4B2 out dx, eax
__text:00000001000AF4B3 xchg eax, r15d
__text:00000001000AF4B5 xor cl, bl
__text:00000001000AF4B7 db 64h
__text:00000001000AF4B7 in eax, 43h ; Timer 8253-5 (AT: 8254.2).
__text:00000001000AF4BA xor edx, [rdi]
__text:00000001000AF4BC and esp, [rax-28h]
__text:00000001000AF4BF push rcx
__text:00000001000AF4C0 mov ecx, 0FAFE72B8h
__text:00000001000AF4C5 nop
__text:00000001000AF4C6 pushfq
__text:00000001000AF4C7 nop
__text:00000001000AF4C8 std
__text:00000001000AF4C9 punpckhbw mm2, qword ptr cs:0CE50D06Bh
__text:00000001000AF4D0
__text:00000001000AF4D0 public start
__text:00000001000AF4D0 start:
__text:00000001000AF4D0 jbe short loc_1000AF4B2
__text:00000001000AF4D2 and bh, [rbp-7Fh]
__text:00000001000AF4D5 rcr byte ptr [rcx+38h], cl
__text:00000001000AF4D5 ; ---------------------------------------------------------------------------
__text:00000001000AF4D8 qword_1000AF4D8 dq 8C3EC142500B0FD6h, 316E8AD7EF8C917Ah, 1F425F5349509045h
When starting the process with GDB and putting a breakpoint at the same address I get a much more sensible disassembly:
Code:
0x1000af4d0: push 0x0
0x1000af4d2: mov rbp,rsp
0x1000af4d5: and rsp,0xfffffffffffffff0
0x1000af4d9: mov rdi,QWORD PTR [rbp+0x8]
0x1000af4dd: lea rsi,[rbp+0x10]
0x1000af4e1: mov edx,edi
0x1000af4e3: add edx,0x1
0x1000af4e6: shl edx,0x3
So probably *something* is writing to the process memory before it gets started... But how is that something started? And why doen't gdb break when I put a write breakpoint at that address?
Anyone can point me in the right direction here?