Hero
August 22nd, 2010, 14:55
Hi all
I was reversing a DLL and have no problem with reversing it right now in general.
But when I was reversing, I suddenly asked myself: "When you patch a DLL and make changes in its code, what should you do about relocations?" and I didn't have a good answer for it myself.
Anybody knows what we should do about relocations? Because relocations are like values(addresses) that will change in link time based on relocation table. Now assume that our patch for DLL crosses over one of these addresses that should be changed by relocation table on link time. if this happens, some value will be added to some bytes of code and it will result in inappropriate changes in our patch code(if I have not messed up anything in understanding how relocations work).
If what I say is true,how I should solve this problem? remove any relocation reference that may be available in my patch code from relocation table and add some if needed?
And another question: is it possible that we have relocation for addresses that are in same section of a DLL?or we need them when we need to access between sections?
Regards
I was reversing a DLL and have no problem with reversing it right now in general.
But when I was reversing, I suddenly asked myself: "When you patch a DLL and make changes in its code, what should you do about relocations?" and I didn't have a good answer for it myself.
Anybody knows what we should do about relocations? Because relocations are like values(addresses) that will change in link time based on relocation table. Now assume that our patch for DLL crosses over one of these addresses that should be changed by relocation table on link time. if this happens, some value will be added to some bytes of code and it will result in inappropriate changes in our patch code(if I have not messed up anything in understanding how relocations work).
If what I say is true,how I should solve this problem? remove any relocation reference that may be available in my patch code from relocation table and add some if needed?
And another question: is it possible that we have relocation for addresses that are in same section of a DLL?or we need them when we need to access between sections?
Regards