-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minimap in .map file: PKWare compression format? #1
Comments
I also think the preview is compressed. If you look at the beginning of any map file, the 0xFF's and 4 additional bytes are immediately followed by one of these 12-byte long 'section headers' (I added that to the wiki as well) and some compressed data, which is probably the preview. I haven't confirmed that yet though. |
Decompressing (blasting) the preview (starts at offset 20 I think) does not lead to a (by windows) readable image file straight away, there is an intermediate step. Also, I cannot find the decompressed data in the output file of PNGer.exe , it is probably compressed again. Digging further ... |
I just found out that a CRC32 checksum is also computed on the blasted preview. However, the blasted preview does contain the right pixel information, with 1 byte representing a pixel (probably a color index). It is offset by 57*16 + 4 from the start of the blasted preview. Not sure why it starts there. I guess the data before that contains color data? |
Which map are you testing this on btw? For some files, I'm not getting correct results after decompression. |
I updated the wiki just now. I am using a 160x160 map generated by SH(C) map editor. |
@metalvoidzz |
Sure, I'll test it when I'm at home. Great job! |
Yep, works for me now! |
@gynt Not sure if this is the place for this, or if I should open a new issue, but I'm getting an error from the
|
Hi there! I compiled blast.exe from here https://github.com/madler/zlib/blob/master/contrib/blast/blast.c It is a bit tricky to debug, because I am not getting your error. I added another blast.exe that is compiled slightly differently, let's hope that works. |
Good to know; Thank you for the info! I'll be looking for your commit. If that doesn't work I might try to compile blast.c when I get home later. |
@lawrencefoley What do you think? |
@gynt Anyways, I plan on following the debugger setup instructions you have in the develop branch when I get some time. I haven't messed with assembly code very much, so this will be interesting. 🙂 I agree with the database of map files. Right now I only have Stronghold Crusader installed; Will those map files be the same as Stronghold? Do you think we should just have different maps, with certain tiles that have certain materials and keep track of the different variations? I assume we would use those to find where the |
@gynt Are you running your code on Windows 10 and Python 3.7? Wondering if there might be some environment differences. I've attached my complied version. import subprocess, io
inputData = b'\x00\x04\x82\x24\x25\x8f\x80\x7f'
result = subprocess.run("blast.exe", input = inputData, stdout = subprocess.PIPE)
result.check_returncode()
print(result.stdout)
assert(result.stdout == b"AIAIAIAIAIAIA") |
@lawrencefoley |
@gynt |
@Gootjes Are you able to run the |
@lawrencefoley |
@metalvoidzz I saw your update on the wiki regarding map file formats and PKWare compression. This compression may apply to the image at the start of the .map file as well, as I found some code in PNGer.exe that resembles the structs in blast.c
Nice find!
The text was updated successfully, but these errors were encountered: