i'm digging around the demo version of eastward, and found out that game use bmfont, but the texture have been encrypt to sth don't have extension, not png like be mention. so i post here for someone plz help decrypt it. tks u so much
edit:I think all of the png for this game use the same encrypt way, with pgf header, at $4-$7 is size of the file, at $C-$F is the offset of long size - 1D... But i dunno how to write a scrypt for bms
Last edited by canboy on Fri Sep 17, 2021 12:38 pm, edited 1 time in total.
So those files look like compiled LuaJIT. I was able to run them through an appropriate decompiler to get legible code. Nothing that really elucidated anything about the "PGF" format. Where did you pull the files from the assets file from? I wasn't able to find those going through the g archives but I don't believe I looked very closely
balbasar wrote:So those files look like compiled LuaJIT. I was able to run them through an appropriate decompiler to get legible code. Nothing that really elucidated anything about the "PGF" format. Where did you pull the files from the assets file from? I wasn't able to find those going through the g archives but I don't believe I looked very closely
Ah I see, I found it. I wasn't using quickbms to extract the .g files and was only pulling 2 levels of files out. Now I can peruse them. I see mentions of loading the decks and atlas textures but I'll have to pore through it to try to see if there are any good hints for interpreting the data.
Small update: Looking more into the files the offsets appear inconsistent therefore leading me to believe either there is some serialization/deflating that is occurring. Additionally some files have less bytes than the resolution marked in the accompanying json file (so definitely some compression or deflation).
The lua files themselves don't really go into the file parsing, rather they make use of lua-cpp bindings provided by the MOAI Framework. This framework is open source and compiled into the game binary. The author of this game forked their own version and added a MOAIImageFormatHmg class to interpret hmg (and I assume the atlas files as well since they share the starting magic bytes even though they are not .hmg terminated). I poked around a bit with ghidra but I'm no where near competent with it. I may be able to make a bit more headway with debugger so I can plod my way to where these files are loaded and how.
There may be an easier way of doing this but I have yet to find it.
canboy wrote:not at all the dialog font are bitmap,store in font.g, but can switch to ttf normally i'm just curios about how to view that font image
Well, so the devs left some junk fonts behind, because there are many ttf and otf fonts files...
ttf.g
font.g
Well we can use that ttf to translate instead of bitmap font but that font in game have some weird problem so i still prefer use the bitmap font instead Somehow right now i could only use the ttf one.
HydeFromT70s wrote:Guys, do you know exactly which file in font.g or ttf.g is responsible for in-game font and how can I edit it to add some additional characters?