Offtopic: Into Commodore 64 (6502) coding, pixeling or music?
Xentax is looking for new members for the C64 activities!
Just drop us a message at forum@xentax.com and join the Scene Team!

Forum rules: Click here

Change .png in .exe

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
Wolfik
ultra-n00b
Posts: 8
Joined: Wed Jun 22, 2011 12:25 pm
Has thanked: 1 time

Change .png in .exe

Post by Wolfik » Sat Oct 06, 2018 2:01 pm

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.
Last edited by Wolfik on Mon Oct 08, 2018 8:26 pm, edited 1 time in total.

User avatar
peter2005
beginner
Posts: 30
Joined: Fri Mar 25, 2016 8:26 am
Location: SVK
Been thanked: 5 times

Re: Change .png in .exe

Post by peter2005 » Sat Oct 06, 2018 4:32 pm

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.

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Change .png in .exe

Post by merlinsvk » Sat Oct 06, 2018 4:46 pm

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.

Wolfik
ultra-n00b
Posts: 8
Joined: Wed Jun 22, 2011 12:25 pm
Has thanked: 1 time

Re: Change .png in .exe

Post by Wolfik » Sat Oct 06, 2018 6:20 pm

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?

User avatar
peter2005
beginner
Posts: 30
Joined: Fri Mar 25, 2016 8:26 am
Location: SVK
Been thanked: 5 times

Re: Change .png in .exe

Post by peter2005 » Sat Oct 06, 2018 8:18 pm

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

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Change .png in .exe

Post by merlinsvk » Sun Oct 07, 2018 9:13 am

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
You do not have the required permissions to view the files attached to this post.

Wolfik
ultra-n00b
Posts: 8
Joined: Wed Jun 22, 2011 12:25 pm
Has thanked: 1 time

Re: Change .png in .exe

Post by Wolfik » Sun Oct 07, 2018 10:25 am

Yes , game works.
Very thanks.

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Change .png in .exe

Post by merlinsvk » Sun Oct 07, 2018 1:35 pm

So this is Czecho-Slovak thread it seems.

Tak teda čaute. :keke:

Wolfik
ultra-n00b
Posts: 8
Joined: Wed Jun 22, 2011 12:25 pm
Has thanked: 1 time

Re: Change .png in .exe

Post by Wolfik » Mon Oct 08, 2018 12:54 pm

merlinsvk wrote:So this is Czecho-Slovak thread it seems.

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

User avatar
peter2005
beginner
Posts: 30
Joined: Fri Mar 25, 2016 8:26 am
Location: SVK
Been thanked: 5 times

Re: Change .png in .exe

Post by peter2005 » Mon Oct 08, 2018 8:32 pm

piste anglicky lebo nas vykopnu :?

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

Post Reply