I was just doing another compare. There are definite differences between the trial and full.
TRIAL: You can still reflect methods, some methods are still largely intact, does not crash reflector. I notice that any other methods simply leave empty method bodies, but nothing that shows as completely invalid.
FULL: Crashes reflector upon attempting to load any namespace. Object references are usually null which causes errors, method names and invalid method bodies crash any attempt at reflection.
BOTH: both versions seem to have the same general routine that's used. All method RVA's point to invalid Method headers. Method bodies for both versions directly concatenate the .text section, but I'm still not too sure how they're pointed.
I can get you a copy of a program protected with the FULL version, but you may count it as a crack request, so I leave it up to you if you wish to study it. Several of the files are simply libraries, with one main executable file. If you want to study these, contact me with either of the following:
AIM: rapidfeur
MSN: rapidcrasher@gmail.com
EDIT: Alright, so I did figure out a bunch more information tonight, here is what I have so far:
- Looking through the Method table, you can see many entries. There are actually mostly redundant tables, from what I can tell, these are simply .Ctor() functions. How do you know it is redundant? From what I've gathered, only the redundant Methods have a Method_Head that follows the TinyFormat format (Flag of 0x2). Therefore you could actually remove any method that has this Flag (Although I have not tried it, it should be fairly easy to do).
- Those with FatFormat flags (Flag of 0x3), regardless of whatever other flags are present, will have a resulting method_body. Example could be the following:
13 30 04 00 00 00 00 00 08 00 00 11
These method_headers are fairly intact, in fact they miss but one piece from the original functioning header, and that is the method_body_length. Concatenating each entry is some pointer that looks something like:
2A 80 9C 00
Now I know these are pointers. From what I am looking at here, it may be a CorILMethod_Sect struct that points to the Method_body.
I have been using this to calculate the offset for each resulting method body using the following formula:
Address_of_Entry_Point + Entry_Point_Size + 0x4 + Data_Size
and then to calculate CodeSize within Method_Header (For this, I am going to use N as the number of the Method_Header in the list), you take:
N_Data_Size - (N - 1)_Data_size - 0x4
Where Data_Size is still taken from CorILMethod_Sect of both Methods.
Now, I am probably wrong on some of this. Most of it I have only been able to check/verify just a few times. However I am working well into the time I usually take to sleep, so I will have to finish more research tomorrow. As for now, that is what I have been able to figure out on my own. Thanks for the lead UFO, I find this information surely useful.
Once I finish up research on how the method_bodies are sorted, I will look at what else may need to be fixed as well. As for making any sort of automated application, that is very unlikely as I am still a newbie at how exactly the PE works (I get enough of it to make my way around it fairly easily, as for actually editing and modifying it, that's a different story).
UFO-Pu55y, my bad about the file. I meant to post the link, but I wrote out the PM before I got it completely uploaded, then sent off forgetting to give you the link. Since the system won't let me PM you for another 8 hours, here is the file:
http://rapidshare.co...84567/360ke.zip
Alright, so I just started working on a program to do basic MSIL relocation. I am only having one major issue, and that is in calculating the size of method code.
This post has been edited by RapiD: 06 June 2009 - 01:02 AM