Quote:
[Originally Posted by hagen;76499]No no, there isn't problem with signature. It works fine patched. But I want a loader. If you could please give me small tutorial how to find these translated msil instruction in mmory with olly i think it will help me.
Thank you |
There are two methods for this hard work.
====================================================
Reaching to native code of a managed method using olly
====================================================
Target is "Simple.exe" and we are working on "Button1_Click" method.
1 - Get the Method RVA from CFF
2 - Convert method's RVA to VA using CFF address converter
3 - RVA = 0x00002850 so VA = 00402850
4 - but for olly we need the VA of the 1st IL, not of the method header
5 - So we need the final value is VA + 0xC = 0x0040285C
6 - Run olly and start the "Simple.exe"
7 - get the memory window "M"
8 - scroll down to "mscorjit"
9 - click on ".text" section n press enter
10- now ctrl + a (analyze)
11- now ctrl + n (names)
12- u see Export getJit ?
13- Double click it
14- 1st DWORD after the RETN is the pointer to compileMethod, ie first line After "RETN"
7907EA98 . F4E70679 DD mscorjit.7906E7F4
15- Press Ctrl+G and enter "7906E7F4"
7906E7F4 /. 55 PUSH EBP ; Enter CompileMethod
7906E7F5 |. 8BEC MOV EBP,ESP
7906E7F7 |. 83EC 10 SUB ESP,10
7906E7FA |. FF75 14 PUSH DWORD PTR SS:[EBP+14]
7906E7FD |. 8B45 10 MOV EAX,DWORD PTR SS:[EBP+10]
7906E800 |. 8B08 MOV ECX,DWORD PTR DS:[EAX]
16- coz we don't need that BP there now
17- instead we need a conditional BP on the 6th instruction
7906E800 |. 8B08 MOV ECX,DWORD PTR DS:[EAX]
18- setting it with shift F2
19- the condition is: [EAX+8]==VA of the 1st IL ==> [EAX+8]==0040285C
20- This will make olly break when "CompileMethod" compiles the method we are targeting
21- [EAX+8]==0040285C is the VA of the first IL in the method we want
22- should break now
23- now some steps with F8 until we reach the line before "LEAVE"
7906E83B |. 8911 MOV DWORD PTR DS:[ECX],EDX
24- Select this line and Press F4 when
25- jitted method is in EDX now !
=================================================
Or you can simply use the
ILLY plugin developed by UFO-PU55Y from SnD
hxxp://www.tuts4you.com/forum/?showtopic=15806&pid=78373&st=0&#entry78373