bboitano
May 24th, 2007, 04:07
I have looked at both of MaDMAn_H3rCuL3s' ARTeam tutorials for the nTitles verifier but am having a problem with one particular application. I'm not sure if it is a new version of nTitles as it was released sometime after MaDMAn's last tutorial
So far I have seen the dump in memory (with the incomplete IAT) when using the imagehlp.MapAndLoad API.
This is what I get :
I follow the instructions to let it unload and then to search for the REP MOVS DWORD ... but the next occurance of that sort of command is far away (0x200) from where we are currently debugging and executed long after the actual app is launched.
It appears that nTitles is using CreateProcessA to create a suspended thread
To which it then writes to after opening the process
Buffer (first few bytes) looks like this :
I notice we have the 20h offset that appears in the 2nd of the ARTeam Tutorials but from the address 401000h, it does looke like it is writing the code section in memory of the other process.
Shortly after it closes the handles to that thread and resumes it - launching my target app.
However, I don't know where I am going wrong in any of the stages below :
1. I've tried just dumping the .dat and changing to .exe as some simpler nTitles ones apparently do that
2. Tried dumping the process before it is resumed (I thought this should be the virgin app ... but no
)
3. Tried dumping the process after it is resumed and fixing it up with ImpRec but that is not working either
And I did try searching for nTitles, but got no hits
Any help/pointers etcetera most gratefully received.
bb
So far I have seen the dump in memory (with the incomplete IAT) when using the imagehlp.MapAndLoad API.
This is what I get :
Code:
004142EF |. FF15 0C365700 CALL DWORD PTR DS:[<&imagehlp.MapAndLoad>] ; imagehlp.MapAndLoad
And the stack :
0012E7F4 0012E938 |Arg1 = 0012E938 ASCII "xxxxxxxx.dat"
0012E7F8 00000000 |Arg2 = 00000000
0012E7FC 0012E808 |Arg3 = 0012E808
0012E800 00000000 |Arg4 = 00000000
0012E804 00000001 \Arg5 = 00000001
I follow the instructions to let it unload and then to search for the REP MOVS DWORD ... but the next occurance of that sort of command is far away (0x200) from where we are currently debugging and executed long after the actual app is launched.
It appears that nTitles is using CreateProcessA to create a suspended thread
Code:
00412B93 . FF15 1C335700 CALL DWORD PTR DS:[<&KERNEL32.CreateProcessA>] ; \CreateProcessA
Stack again :
0012E820 00000000 |ModuleFileName = NULL
0012E824 0012E91C |CommandLine = "xxxxxxxx.dat "
0012E828 00000000 |pProcessSecurity = NULL
0012E82C 00000000 |pThreadSecurity = NULL
0012E830 00000000 |InheritHandles = FALSE
0012E834 00000004 |CreationFlags = CREATE_SUSPENDED
0012E838 00000000 |pEnvironment = NULL
0012E83C 00000000 |CurrentDir = NULL
0012E840 0012E8D4 |pStartupInfo = 0012E8D4
0012E844 0012E874 \pProcessInfo = 0012E874
To which it then writes to after opening the process
Code:
00412C80 . FF15 20335700 CALL DWORD PTR DS:[<&KERNEL32.ReadProcessMemory>] ; \ReadProcessMemory
Stack:
0012E834 000000DC |hProcess = 000000DC
0012E838 00401000 |pBaseAddress = 401000
0012E83C 01060020 |Buffer = 01060020
0012E840 000EB000 |BytesToRead = EB000 (962560.)
0012E844 0012E860 \pBytesRead = 0012E860
Buffer (first few bytes) looks like this :
Code:
01060000 50 00 B2 00 50 00 B2 00 00 00 00 00 00 00 00 00 P..P..........
01060010 00 C0 0E 00 00 C0 0E 00 00 10 00 00 00 0B 00 00 ..........
01060020 6A FF 68 88 2D 4E 00 64 A1 00 00 00 00 50 64 89 jh-N.d....Pd
01060030 25 00 00 00 00 83 EC 1C 8A 44 24 2C 53 55 8B E9 %....D$,SU
01060040 56 57 8D 7D 0C 33 F6 56 8B CF 89 6C 24 18 88 07 VW}.3Vωl$
01060050 E8 CB 2D 00 00 8A 4C 24 3C 8D 5D 1C 89 74 24 34 -..L$<]t$4
01060060 88 0B 89 73 04 89 73 08 89 73 0C 8D B5 FC 0A 00 sss...
01060070 00 8D 54 24 11 52 8B CE C6 44 24 38 01 89 74 24 .T$RD$8t$
01060080 1C E8 CA 28 00 00 8D 44 24 12 8D 4E 10 50 C6 44 (..D$NPD
01060090 24 38 02 E8 B8 28 00 00 8D 54 24 13 8D 4E 20 52 $8(..T$N R
010600A0 C6 44 24 38 03 E8 A6 28 00 00 8D 4E 30 C6 44 24 D$8(..N0D$
I notice we have the 20h offset that appears in the 2nd of the ARTeam Tutorials but from the address 401000h, it does looke like it is writing the code section in memory of the other process.
Shortly after it closes the handles to that thread and resumes it - launching my target app.
However, I don't know where I am going wrong in any of the stages below :
1. I've tried just dumping the .dat and changing to .exe as some simpler nTitles ones apparently do that

2. Tried dumping the process before it is resumed (I thought this should be the virgin app ... but no

3. Tried dumping the process after it is resumed and fixing it up with ImpRec but that is not working either
And I did try searching for nTitles, but got no hits

Any help/pointers etcetera most gratefully received.
bb