0

I'm in the process of writing a read/write library for Windows PE files using Java (and eventually hope to release it as OpenSource). For now though this is for cross platform compatibility and will allow me to modify strings/version info/icons/resources etc from an Ant build system or command line/terminal etc.

The problem I have reached is that I can now embed icons in the .rsrc section from a source BMP file and have it display them but unfortunately (Even though the data is correct) the icon comes out within Windows Explorer (and CFF Explorer/ Visual Studio etc) as incorrect. It has a sort of pattern across the raster data as if the image something has be Xor'd or digitally signed.

Any ideas what i'm doing wrong when adding this data?

On a side note I'm also a bit confused as to why I need to modify the height part of the BMP header so that its marked as 2x its real size.

Thanks In Advance. - Tim.

Tim Johnson
  • 287
  • 2
  • 13
  • Can you add an [SSCCE](http://sscce.org) of the code you are having problem with? – araknoid Sep 03 '13 at 14:34
  • There is no code to add, for now i'm just binary dumping one icon/bmp for another using a hex editor and it has the same result. While trying to figure out whats going wrong – Tim Johnson Sep 03 '13 at 15:46
  • Okay turns out to be my fault. Was forgetting to modify/overwrite the 'and' mask for the icon(s). – Tim Johnson Sep 03 '13 at 21:23

0 Answers0