However, you need to define the right reloc table size, since the PE loader subtracts every block from the size and checks for 0.
That means, you can't just guess and make it big enough to contain all elements. It has to be the exact size of the table.
Well, I was looking for a tool that could calculate the size but couldn't find any.
I started coding my own and that's the result
It takes a PE file, displays the correct size for the reloc table and optionally writes the right size to the file.
Supports both normal and PE32+ executables.
Source and binary attached
- GetRelocSize.zip (77.17K)