Heathcliff
June 9th, 2004, 06:02
Hi all,
I'm back after 2 years of no reversing. I found a usefull tool, but I can't seem to get it correctly unpacked. I know it's Armadillo, but it looks like it got some new features. I tried to follow the tuts from Ricardo (excellent job!) Here are my notes:
To find target search Google with these keywords (this is not the target name!):
nyfnet client
Notes:
DebugDetectionByte: 7FFDF002
DebugEventFrame: 12EB88
OEP: 401000
.text: 401000 - 527000
The unpacking:
Start OllyDbg
Debug options, exceptions -> Ignore all.
Load target exe
In hex pane: Go to Expression 7FFDF002
Type 00
BP WriteProcessMemory
3 x F9
In code pane: Go to Expression 5D022A (this is the encryptor call)
Space (Assemble): NOP
Go to Origin
F2
SHIFT-F4: Log expression: [ESP+8] (optional)
CRTL-F9
F7
Start PUPE
Note the ProcessID of the first target process in list (child)
Right click on this process and select 'Parchear'
Set number of bytes to: 2 (arrow down)
Set OEP: 401000
Click 'Buscar' (search)
Note 2 bytes: EB10
Type bytes for infinite loop: EBFE (will let the child sleep on entrance)
Click 'Parchear'
Close Pupe
Go back to Olly
BC WriteProcessMemory
BP WaitForDebugEvent
F9 (to hit the BP)
In code pane: Go to Expression: 5CD7F0 (skip event to return-address)
New Origin Here
Go to Expression: 5CD7DE (to show assembly from the right address on)
Space (Assembler): NOP complete call with pushed arguments from 5CD7DE to 5CD7EF)
Select 5CD7F0 and Space (Assemble): JMP 401000 (NOP is added, note: code continues at 5CD7F7)
Replace OEP values in DebugEventFrame with: 00 00 40 00
Go to Expression: 401000
Space (assemble):
ADD DWORD PTR DS:[12EBA0],1000 (Locations in DebugEventFrame where OEP is)
ADD DWORD PTR DS:[12EBAC],1000
ADD DWORD PTR DS:[12EBB0],1000
CMP DWORD PTR DS:[12EBB0],527000 (End of .text)
JNZ 5CD7F7 (Don't continue original code after the last unpack-section)
PUSH 21C4 (childs ProcessID is shown in PUPE)
CALL DebugActiveProcessStop (Detach child)
NOP
BP on last NOP
When the BP is hit exit Olly (kill the parent-process)
Restart Olly
Attach to child (ignore warnings)
When EIP is in ntdll, hit CTRL-F9 until in target
In hex-pane: Go to Expression: 401000
Type: EB 10
Start LordPE
(If there are too many processes, burn some of them to get the child visible)
Select IntelliDump
Dump full: Dumped.exe
Click 'PE Editor' (or open any other PE Editor, it doesn't matter)
Open Dumped.exe
Change EntryPoint to: 00001000
Calculate Checksum
Save
Close LordPE
Running Olly can be closed
Start new Olly
Open Dump -> Olly error: Unable to start file 'C:\Dumped.exe'
So it seems i cannot open the dumped exe in Olly!
It is however possible to open the dumped exe in IDA Pro. I'm trying to work around this problem and get the IAT reconstructed in another way, but it would sure help if someone could tell me why Olly won't open my dump!
Some other things I found out when I opened my dump in IDA:
- The tool is written in Delphi
- The registration is done with ArmAccess.dll (part of Armadillo). This dll is hard to reverse, so it would be much easier to get the dump fixed and patch the dump so ArmAccess.dll will not be called anymore and make it 'always registered'.
- Search for 'REGISTERED' and scroll up and down to see the registration code.
I'm not sure yet if this target has nanomites. I haven't looked into that yet.
Any help is appreciated!
Thanks in advance to Ricardo for his great tuts!
Greetz,
Heathcliff
I'm back after 2 years of no reversing. I found a usefull tool, but I can't seem to get it correctly unpacked. I know it's Armadillo, but it looks like it got some new features. I tried to follow the tuts from Ricardo (excellent job!) Here are my notes:
To find target search Google with these keywords (this is not the target name!):
nyfnet client
Notes:
DebugDetectionByte: 7FFDF002
DebugEventFrame: 12EB88
OEP: 401000
.text: 401000 - 527000
The unpacking:
Start OllyDbg
Debug options, exceptions -> Ignore all.
Load target exe
In hex pane: Go to Expression 7FFDF002
Type 00
BP WriteProcessMemory
3 x F9
In code pane: Go to Expression 5D022A (this is the encryptor call)
Space (Assemble): NOP
Go to Origin
F2
SHIFT-F4: Log expression: [ESP+8] (optional)
CRTL-F9
F7
Start PUPE
Note the ProcessID of the first target process in list (child)
Right click on this process and select 'Parchear'
Set number of bytes to: 2 (arrow down)
Set OEP: 401000
Click 'Buscar' (search)
Note 2 bytes: EB10
Type bytes for infinite loop: EBFE (will let the child sleep on entrance)
Click 'Parchear'
Close Pupe
Go back to Olly
BC WriteProcessMemory
BP WaitForDebugEvent
F9 (to hit the BP)
In code pane: Go to Expression: 5CD7F0 (skip event to return-address)
New Origin Here
Go to Expression: 5CD7DE (to show assembly from the right address on)
Space (Assembler): NOP complete call with pushed arguments from 5CD7DE to 5CD7EF)
Select 5CD7F0 and Space (Assemble): JMP 401000 (NOP is added, note: code continues at 5CD7F7)
Replace OEP values in DebugEventFrame with: 00 00 40 00
Go to Expression: 401000
Space (assemble):
ADD DWORD PTR DS:[12EBA0],1000 (Locations in DebugEventFrame where OEP is)
ADD DWORD PTR DS:[12EBAC],1000
ADD DWORD PTR DS:[12EBB0],1000
CMP DWORD PTR DS:[12EBB0],527000 (End of .text)
JNZ 5CD7F7 (Don't continue original code after the last unpack-section)
PUSH 21C4 (childs ProcessID is shown in PUPE)
CALL DebugActiveProcessStop (Detach child)
NOP
BP on last NOP
When the BP is hit exit Olly (kill the parent-process)
Restart Olly
Attach to child (ignore warnings)
When EIP is in ntdll, hit CTRL-F9 until in target
In hex-pane: Go to Expression: 401000
Type: EB 10
Start LordPE
(If there are too many processes, burn some of them to get the child visible)
Select IntelliDump
Dump full: Dumped.exe
Click 'PE Editor' (or open any other PE Editor, it doesn't matter)
Open Dumped.exe
Change EntryPoint to: 00001000
Calculate Checksum
Save
Close LordPE
Running Olly can be closed
Start new Olly
Open Dump -> Olly error: Unable to start file 'C:\Dumped.exe'
So it seems i cannot open the dumped exe in Olly!

Some other things I found out when I opened my dump in IDA:
- The tool is written in Delphi
- The registration is done with ArmAccess.dll (part of Armadillo). This dll is hard to reverse, so it would be much easier to get the dump fixed and patch the dump so ArmAccess.dll will not be called anymore and make it 'always registered'.
- Search for 'REGISTERED' and scroll up and down to see the registration code.
I'm not sure yet if this target has nanomites. I haven't looked into that yet.
Any help is appreciated!
Thanks in advance to Ricardo for his great tuts!
Greetz,
Heathcliff