-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong virtual section size #6
Comments
hi @ark3us ! thank you for your interest in my tools. Yes, from what you described, it seems to be a problem with atypical sections alignment. Is this executable packed by some packer/protector? Does it have an overlay? It would be very helpful for me to understand what exactly is the sections alignment, and how may it affect the conversion. |
Hi @hasherezade , thank you very much for you reply! As you guessed, the exe is packed with Enigma Protector. This is the Section Headers view from PE-bear (another amazing tool!): Edit: But also in this case I had no luck (failure calling the original EP), so I guess there must be some sophisticated loading mechanism which prevents to use this technique Thanks! |
@ark3us - thank you, seeing the sections layout, and knowing that it is packed, actually explains a lot. Indeed, the messages that you saw are about the section 13, which, in the Virtual format, overflows the next section, and even goes beyond the Image Size. Although this problem with sections could be solved, the other thing is, as you noticed, even modifying the binary manually didn't let it run as normal. Such cases (when the binary is packed by a protector) are usually tricky - their authors intentionally deploy various non-standard techniques to make analysis and modification of the binary harder. I am not sure what else is going on in this executable that makes it unable to run after the modifications, and if it can be resolved or not. As I mentioned, if you provide some testcases I can experiment with it, and let you know if I have any progress. |
Hi @hasherezade , thank you for your interest! I have been playing with libconv trying to fix offsets when converting raw sections to virtual, but I didn't have much success so far, I need to study the PE format better :D Please let me know if i can help you in any way! |
thank you @ark3us ! your samples will be very helpful in my tests. |
Hi @hasherezade , just a quick update. It seems the problem with this type of packing is that it's not possible to put the new entry point in any executable sections, but only in specific ones. For example, it works putting the stub in sections 26, but not in others (the "main" returns with error probably due to some checks). |
Hello and thank you very much for your amazing work!
I'm trying to use your code to convert an exe to a dll but i'm experiencing a problem.
I'm not expert in the matter so I hope you can give me any hints.
The program fails converting the raw pe to virtual with these messages:
Adding some debug info, if I understood correctly, it seems the size of some virtual sections reported in the section header is wrong:
The size of section 13 should not be that big, right? This leads to the first error message.
And also the SizeOfImage header seems to be too small, which leads to the second error message and failure.
Unfortunately i cannot share the exe, but it runs normally, it's not corrupted.
Any idea why this happens? Anything I can do to handle this type of files?
Thank you again!
The text was updated successfully, but these errors were encountered: