Page 1 of 1

Change .png in .exe

Posted: Sat Oct 06, 2018 2:01 pm
by Wolfik
Pls help.
Change .png in .exe (is it .png/.fnt)
ResHacker etc view only icons but no font.png
Multiextractor this file extract but I do not know how to import the modified file back.



Thanks for help.

Re: Change .png in .exe

Posted: Sat Oct 06, 2018 4:32 pm
by peter2005
The only easy solution is to replace a png with the same (filesize) png. So, if your png has the same size as the one you want to replace, you can do it with hex editor.

Re: Change .png in .exe

Posted: Sat Oct 06, 2018 4:46 pm
by merlinsvk
The same applies to .fnt file. Same size and hex editor.

Why you need to replace that files?

EDIT:
Ahh okey, now I know why. Not all fonts are read from Data\Fonts folder.
So if you make new BMFont png+fnt files (smaller or equal in size) you can replace them in .exe.

Re: Change .png in .exe

Posted: Sat Oct 06, 2018 6:20 pm
by Wolfik
Thanks all.
It will be a problem, I can not do much work in hex. (HxD)
I do not know how to select only png data and how to insert a smaller file.
Is there no other way to re-import png? bms?

Re: Change .png in .exe

Posted: Sat Oct 06, 2018 8:18 pm
by peter2005
1. open both files (.exe and .png) in hxd
2. select all .png bytes and use ctrl+c
3. find starting position(first byte) of .png in .exe file
4. 'paste write' content there
5. save .exe file

Re: Change .png in .exe

Posted: Sun Oct 07, 2018 9:13 am
by merlinsvk
You can use this script to export and import that PNG and FNT file. Attachment also contains two batch files.
  • 0) Make backup of game's .exe file.
    1) Put all three files and quickbms.exe into main game folder and run _export.bat.
    2) Exported files will be in the "EXPORT" folder.
    3) Edit them (or replace). New files have to be smaller or equal in size!
    4) Run _import.bat and run the game.

Code: Select all

set OFFSET  0x2E4978
set PNGSIZE 0xA500	# 42240 bytes
set PNGNAME "arial20_as_bm_font_0.png"
set FNTSIZE 0xC68A	# 50826 bytes
set FNTNAME "arial20_as_bm_font_0.fnt"

log PNGNAME OFFSET PNGSIZE
math OFFSET + PNGSIZE
log FNTNAME OFFSET FNTSIZE

Re: Change .png in .exe

Posted: Sun Oct 07, 2018 10:25 am
by Wolfik
Yes , game works.
Very thanks.

Re: Change .png in .exe

Posted: Sun Oct 07, 2018 1:35 pm
by merlinsvk
So this is Czecho-Slovak thread it seems.

Tak teda čaute. :keke:

Re: Change .png in .exe

Posted: Mon Oct 08, 2018 12:54 pm
by Wolfik
merlinsvk wrote:So this is Czecho-Slovak thread it seems.

Tak teda čaute. :keke:
Zdar a ještě jednou dík :)

Re: Change .png in .exe

Posted: Mon Oct 08, 2018 8:32 pm
by peter2005
piste anglicky lebo nas vykopnu :?

hope that not using english won't get us banned :D