|
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