Skip to content
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

[BUG][WINDOWS] Segfault on COFFSymbols & StringTable bytes exceeding memory committed size #5

Open
malware-unicorn opened this issue Jan 19, 2022 · 0 comments

Comments

@malware-unicorn
Copy link

hbuf[index+pefile.FileHeader.PointerToSymbolTable] = b[index]

The combined total size of the COFFSymbols and StringTable buffers can exceed the memory committed size of the ImageSize, thus causing a sefault in trying to write to a memory location not allocated.

Tested on Win7 64bit vm on QubeOS.

Recommendation:
Instead of allocating for the total ImageSize, allocate these sections separately or adopt CopySections function from: https://github.com/fancycode/MemoryModule/blob/master/MemoryModule.c#L176

@malware-unicorn malware-unicorn changed the title Segfault on COFFSymbols & StringTable bytes exceeding memory committed size [BUG][WINDOWS] Segfault on COFFSymbols & StringTable bytes exceeding memory committed size Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant