One of the manual release step that we have is to sign the installers of our products.
This simple step is made complicated by launch4j. The steps that were in place
was from this discussion here
and I’m addressing the most errorneous step of it with a python script in this post:
Edit test.exe with favorite HEX editor to change last two bytes of exe i.e. the jar i.e.
the zip end of central directory to the size using littleendian byte order and save
You will find my script spitting a lot of information as I was not confident enough
playing with bytes in python. They were helpful to compare the result when we did
it manually.
This is the function in my script that is modifying the last two bytes of the exe by utilising mmap.
To calculate the difference_in_bytes was pretty straightforward: