Hold up, I'm not done yet
The function is a
case function. What that means is depending on the input value, the function will execute a certain portion. See the explanation below:
Code: Select all
01D1DE00 | 83 EC 08 | SUB ESP,8 | « prologue
01D1DE03 | 53 | PUSH EBX |
01D1DE04 | 55 | PUSH EBP |
01D1DE05 | 56 | PUSH ESI |
01D1DE06 | 8B 74 24 20 | MOV ESI,DWORD PTR SS:[ESP+20] | « retrieve a pointer
01D1DE0A | 57 | PUSH EDI |
01D1DE0B | 8B 7C 24 1C | MOV EDI,DWORD PTR SS:[ESP+1C] | « get pointer to action value
01D1DE0F | 8B 47 0C | MOV EAX,DWORD PTR DS:[EDI+C] | « get value
01D1DE12 | 8B C8 | MOV ECX,EAX | « store in ECX
01D1DE14 | 81 E1 FF FF FF 00 | AND ECX,synthetik_dumped.FFFFFF | « test value
01D1DE1A | 83 F9 02 | CMP ECX,2 | « this is where the 'case' starts
01D1DE1D | 0F 84 FE 01 00 00 | JE synthetik_dumped.1D1E021 |
01D1DE23 | 81 FE 00 00 00 80 | CMP ESI,80000000 |
01D1DE29 | 0F 85 E9 01 00 00 | JNE synthetik_dumped.1D1E018 |
01D1DE2F | 48 | DEC EAX | « case processing, decrementing EAX
01D1DE30 | A9 FC FF FF 00 | TEST EAX,synthetik_dumped.FFFFFC |
01D1DE35 | 0F 85 0F 01 00 00 | JNE synthetik_dumped.1D1DF4A |
01D1DE3B | 83 E9 01 | SUB ECX,1 | « case 1
01D1DE3E | 0F 84 FA 00 00 00 | JE synthetik_dumped.1D1DF3E |
01D1DE44 | 83 E9 01 | SUB ECX,1 | « case 2
01D1DE47 | 74 28 | JE synthetik_dumped.1D1DE71 |
01D1DE49 | 83 E9 01 | SUB ECX,1 | « case 3
01D1DE4C | 0F 85 F8 00 00 00 | JNE synthetik_dumped.1D1DF4A |
So what we need to find is when the exact 'case' you want happens (for which EAX or ECX value?) Continuing:
Code: Select all
01D1DF4A | 8B 74 24 20 | MOV ESI,DWORD PTR SS:[ESP+20] | « get ESI
01D1DF4E | C7 47 08 00 00 00 00 | MOV DWORD PTR DS:[EDI+8],0 |
01D1DF55 | C7 47 0C 05 00 00 00 | MOV DWORD PTR DS:[EDI+C],5 |
01D1DF5C | C7 07 00 00 00 00 | MOV DWORD PTR DS:[EDI],0 |
01D1DF62 | 8B 46 0C | MOV EAX,DWORD PTR DS:[ESI+C] | « get switch value in EAX
01D1DF65 | 89 47 0C | MOV DWORD PTR DS:[EDI+C],EAX |
01D1DF68 | 8B 46 08 | MOV EAX,DWORD PTR DS:[ESI+8] |
01D1DF6B | 89 47 08 | MOV DWORD PTR DS:[EDI+8],EAX |
01D1DF6E | 8B 46 0C | MOV EAX,DWORD PTR DS:[ESI+C] | « get it again
01D1DF71 | 25 FF FF FF 00 | AND EAX,synthetik_dumped.FFFFFF |
01D1DF76 | 83 F8 0E | CMP EAX,E | « check if > 0xE
01D1DF79 | 0F 87 1E 03 00 00 | JA synthetik_dumped.1D1E29D |
01D1DF7F | 0F B6 80 C4 E2 A2 01 | MOVZX EAX,BYTE PTR DS:[EAX+1A2E2C4] |
01D1DF86 | FF 24 85 A8 E2 A2 01 | JMP DWORD PTR DS:[EAX*4+1A2E2A8] |
01D1DF8D | 8B 06 | MOV EAX,DWORD PTR DS:[ESI] |
01D1DF8F | 89 07 | MOV DWORD PTR DS:[EDI],EAX |
01D1DF91 | 85 C0 | TEST EAX,EAX |
01D1DF93 | 0F 84 04 03 00 00 | JE synthetik_dumped.1D1E29D |
01D1DF99 | FF 00 | INC DWORD PTR DS:[EAX] |
01D1DF9B | 8B 07 | MOV EAX,DWORD PTR DS:[EDI] |
01D1DF9D | 83 78 08 00 | CMP DWORD PTR DS:[EAX+8],0 |
01D1DFA1 | 0F 85 F6 02 00 00 | JNE synthetik_dumped.1D1E29D |
01D1DFA7 | 89 78 08 | MOV DWORD PTR DS:[EAX+8],EDI |
01D1DFAA | 5F | POP EDI |
01D1DFAB | 5E | POP ESI |
01D1DFAC | 5D | POP EBP |
01D1DFAD | 5B | POP EBX |
01D1DFAE | 83 C4 08 | ADD ESP,8 |
01D1DFB1 | C3 | RET |
01D1DFB2 | F2 0F 10 06 | MOVSD XMM0,QWORD PTR DS:[ESI] | « your code; one of the cases
01D1DFB6 | F2 0F 11 07 | MOVSD QWORD PTR DS:[EDI],XMM0 |
01D1DFBA | 5F | POP EDI |
01D1DFBB | 5E | POP ESI |
01D1DFBC | 5D | POP EBP |
01D1DFBD | 5B | POP EBX |
01D1DFBE | 83 C4 08 | ADD ESP,8 |
01D1DFC1 | C3 | RET |
01D1DFC2 | 8B 06 | MOV EAX,DWORD PTR DS:[ESI] |
01D1DFC4 | 89 07 | MOV DWORD PTR DS:[EDI],EAX |
01D1DFC6 | 8B 46 04 | MOV EAX,DWORD PTR DS:[ESI+4] |
01D1DFC9 | 89 47 04 | MOV DWORD PTR DS:[EDI+4],EAX |
01D1DFCC | 5F | POP EDI |
01D1DFCD | 5E | POP ESI |
01D1DFCE | 5D | POP EBP |
01D1DFCF | 5B | POP EBX |
01D1DFD0 | 83 C4 08 | ADD ESP,8 |
01D1DFD3 | C3 | RET |
So what we need to do now is to find the
EAX value and use it as a filter
And to do that, you just check this spot:
Code: Select all
01D1DF7F | 0F B6 80 C4 E2 A2 01 | MOVZX EAX,BYTE PTR DS:[EAX+1A2E2C4] |
01D1DF86 | FF 24 85 A8 E2 A2 01 | JMP DWORD PTR DS:[EAX*4+1A2E2A8] |
So.. we need to get 1 byte from [EAX+1A2E2C4]; then the JMP [EAX*4+1A2E2A8] should take us to 01D1DFB2, 01D1DFC2, etc. Each case is delimited by the piece of code and the RET:
Code: Select all
01D1DFB2 | F2 0F 10 06 | MOVSD XMM0,QWORD PTR DS:[ESI] | « your code; one of the cases
01D1DFB6 | F2 0F 11 07 | MOVSD QWORD PTR DS:[EDI],XMM0 |
01D1DFBA | 5F | POP EDI |
01D1DFBB | 5E | POP ESI |
01D1DFBC | 5D | POP EBP |
01D1DFBD | 5B | POP EBX |
01D1DFBE | 83 C4 08 | ADD ESP,8 |
01D1DFC1 | C3 | RET |
^ That's case 1.
Code: Select all
01D1DFC2 | 8B 06 | MOV EAX,DWORD PTR DS:[ESI] |
01D1DFC4 | 89 07 | MOV DWORD PTR DS:[EDI],EAX |
01D1DFC6 | 8B 46 04 | MOV EAX,DWORD PTR DS:[ESI+4] |
01D1DFC9 | 89 47 04 | MOV DWORD PTR DS:[EDI+4],EAX |
01D1DFCC | 5F | POP EDI |
01D1DFCD | 5E | POP ESI |
01D1DFCE | 5D | POP EBP |
01D1DFCF | 5B | POP EBX |
01D1DFD0 | 83 C4 08 | ADD ESP,8 |
01D1DFD3 | C3 | RET |
^ That's case 2. And so on.
So..
Code: Select all
Synthetik_dumped.exe+192DF7F - 0FB6 80 C4E2A201 - movzx eax,byte ptr [eax+Synthetik_dumped.exe+163E2C4]
Synthetik_dumped.exe+192DF86 - FF 24 85 A8E2A201 - jmp dword ptr [eax*4+Synthetik_dumped.exe+163E2A8]
The BYTE at "Synthetik_dumped.exe+163E2C4" is 0x4. That's the starting value. You can increase or decrease it, based on EAX's value (eax+0x4) - if positive or negative. Doing several tries + combining it with the [eax*4+Synthetik_dumped.exe+163E2A8] below returns the original EAX as.. 0x1B7F42. Not sure if this is correct, as the dump might've stored some static addresses which show incorrect memory on my end.
You can find this value by putting a break here:
Code: Select all
Synthetik_dumped.exe+192DFB2 - F2 0F10 06 - movsd xmm0,[esi]
When it breaks, check EAX register
And tell me the value, please.
Also, trace with F8 key till here:
Code: Select all
Synthetik_dumped.exe+192DFC1 - C3 - ret
And stop. Then right-click the stack (the bottom-right sub-window of Memory View, while breakpoint hit) and have it show the full stack. Tell me what you see at esp+0
Maybe we can use the return address as a filter (hoping the function is not just a wrapper; as in, an intermediary function used in the 33 calculations).
BR,
Sun