English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 30 October 2023, 00:30   #1
Korodny
Zone Friend
 
Join Date: Sep 2001
Location: Germany
Posts: 812
An ILBM file 'protected' against opening it in a viewer

I uploaded sdlmap1.ilbm to the Zone, it's a picture (a map, I think) from the German game "Stadt der Löwen".

It's a standard ILBM picture, but I think the developer patched the header so a regular picture viewer would choke on it. Here's what the file's header looks like:

Code:
464f 524d 0000 6e58 494c 424d 424d 4844  FORM..nXILBMBMHD
IIRC, the four bytes between "FORM" and "ILBMBMHD" should be the size of the chunk data, Wikipedia tells me it's "file size minus eight bytes" - the file has 29052 bytes, so the four bytes should be 00, 00, 71, 74 - correct?

I tried changing the header accordingly using a hex editor, but my ILBM viewer ("display", from the imagemagick package) still does not display them.

Can anybody more familiar with the format identify what's wrong with the uploaded file?
Korodny is offline  
Old 30 October 2023, 05:44   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
https://wiki.amigaos.net/wiki/IFF_FO...Chunk_Registry has all public IFF forms and chunks including ILBM. The hex values you put look correct but there may also be extra data at the end to make your computations less predictable.
Samurai_Crow is offline  
Old 30 October 2023, 09:36   #3
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
It looks like the header might be correct but there is something wrong with the data itself (i.e. the contents of the BODY chunk). It does not look like image data and isn't decrunched to anything coherent.
meynaf is offline  
Old 30 October 2023, 12:30   #4
Korodny
Zone Friend
 
Join Date: Sep 2001
Location: Germany
Posts: 812
Thanks guys, for having a look at the file.

I was hoping they had just modified the header, like they did for another game. Looks like I'm out of luck.
Korodny is offline  
Old 30 October 2023, 12:59   #5
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,343
It could be the game (for example) XORs the data with some value before using it. Looking at the game code could tell you what it's doing.
mark_k is online now  
Old 30 October 2023, 13:24   #6
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
There are 3 problems:
1. FORM length, you figured that out yourself,
2. BODY length, you also have to adjust that one (starts at $0110, so $717c-$0110=$706b + 1 pad),
3. image dimensions 277x239x5 (=> 288x239x5), which is roughly 42KB and exceeds file size, so file is either too short or compressed, and apparently Compression flag is set to 0 while it should be set to 1 (offset $001f) because the image is actually compressed.
Fixed file is in the zone.

Last edited by a/b; 30 October 2023 at 13:31.
a/b is offline  
Old 31 October 2023, 14:35   #7
Korodny
Zone Friend
 
Join Date: Sep 2001
Location: Germany
Posts: 812
@a/b:

Ah - awesome, thanks! Looks like the compression flag was the main culprit, modern viewers/converters just ignore the wrong length definitions for FORM/BODY, or just throw a warning.
Korodny is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a Project file with Script on Workbench [HELP] superkahraman support.AmigaOS 4 17 February 2022 19:27
Bogus file is write protected message with Copy CLONE to shared directory mark_k support.WinUAE 3 28 October 2017 21:01
File picker dialog not opening in 32-bit version (Win10) jbenam support.WinUAE 8 06 May 2017 00:39
Opening multi adf/dms files inside a zip file! amilo3438 request.UAE Wishlist 5 10 August 2013 06:23

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:03.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12237 seconds with 15 queries