Silver
November 9th, 2005, 19:22
Hi guys,
I've come across something interesting. Whilst playing around, I started encrypting and packing some PE sections through my code (rather than a 3rd party protector). All the encrypting etc was working fine. I then decided to encrypt the .rsrc section. I applied the same (working) code that I had de/encrypted other sections with, then updated the section characteristics to be read & writeable instead of just readable.
I tested my exe with the encrypted .rsrc on my Win2k box, it works fine. I then copied it over to an XP box and tried it. As soon as I launch the .exe, I get a "Only part of a ReadProcessMemory or WriteProcessMemory request was completed" dialog. My code doesn't use either of these functions and that wasn't a msgbox I made, so I looked at it a bit closer. The code to decrypt the .rsrc section is the first piece of code in the exe, and there is no dependancy on any encrypted code (otherwise it wouldn't work in Win2k
)
It seems as though there is a difference between Win2k and WinXP in how the .rsrc section is used when an exe loads. I tried it on 2 different XP machines, it fails. Try it on win2k, it works.
I've searched around for information about this but I just can't find anything relevant. Searching on the error brings up a small number of (irrelevant) code related hits, and thousands of game/app support requests. None of them are applicable to this issue. I've reviewed the MSDN PE section bible pages and there's no indication there either. I've played with the section characteristics, no luck. Other packers can (as far as Windows is concerned until the decompressor stub is loaded) corrupt the PE section with no side effects, but I'm missing something.
Anyone able to shed any light on this and point me in the right direction? Happens on XP SP1 and XP no SP, but works on all vers of Win2k so far. Been staring at it a few hours now with no luck...
Thanks!
I've come across something interesting. Whilst playing around, I started encrypting and packing some PE sections through my code (rather than a 3rd party protector). All the encrypting etc was working fine. I then decided to encrypt the .rsrc section. I applied the same (working) code that I had de/encrypted other sections with, then updated the section characteristics to be read & writeable instead of just readable.
I tested my exe with the encrypted .rsrc on my Win2k box, it works fine. I then copied it over to an XP box and tried it. As soon as I launch the .exe, I get a "Only part of a ReadProcessMemory or WriteProcessMemory request was completed" dialog. My code doesn't use either of these functions and that wasn't a msgbox I made, so I looked at it a bit closer. The code to decrypt the .rsrc section is the first piece of code in the exe, and there is no dependancy on any encrypted code (otherwise it wouldn't work in Win2k

It seems as though there is a difference between Win2k and WinXP in how the .rsrc section is used when an exe loads. I tried it on 2 different XP machines, it fails. Try it on win2k, it works.
I've searched around for information about this but I just can't find anything relevant. Searching on the error brings up a small number of (irrelevant) code related hits, and thousands of game/app support requests. None of them are applicable to this issue. I've reviewed the MSDN PE section bible pages and there's no indication there either. I've played with the section characteristics, no luck. Other packers can (as far as Windows is concerned until the decompressor stub is loaded) corrupt the PE section with no side effects, but I'm missing something.
Anyone able to shed any light on this and point me in the right direction? Happens on XP SP1 and XP no SP, but works on all vers of Win2k so far. Been staring at it a few hours now with no luck...
Thanks!