Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant archive_postsperpage - assumed 'archive_postsperpage' (this will throw an Error in a future version of PHP) in ..../archive/index.php on line 456
The GFX file [Archive] - Forums

PDA

View Full Version : The GFX file



xbv
11-10-2015, 12:35 PM
This is for education only, zezenia is a great game and K-zod seems nice!
This is probably a few years too late but hopefully someone enjoys tibian/zez art as much as me.

update 5.6
Download all 6768 imgs here. (https://mega.nz/#!0t0xSZiA!aoMJhglO3FrI53ZD56JA8iZ1x0lRWi76uzf5_Nu TJ10)

http://s29.postimg.org/5spjx4tsz/cool.gif

some strange stuff inside:
http://s29.postimg.org/iitsa81r7/wtf.jpg

So the first 4 bytes of the file I don't know but after that you have:
two bytes displaying the amount of images (0x19cb=6603)
another two bytes (0,0) which you can skip.

Then you just loop through all the images.
Looking at the first image:
two bytes width (0x20,0), two bytes height(0x20,0), three bytes are the bytes to read(0x001000) and zero byte at the end.
So its a 32x32 image and it is telling us to read 4096 bytes (32*32*4)=4096 HOWEVER not all the data is here as you will see.
Next you will read the pixel data (0x2c, 0x53, 0x92, 0xff, etc).
The pixels are in BGRA format.

Finally (BUT VERY IMPORTANT!) you need to do a search through each image and look for a 1 in the first byte of each pixel, if there is, you need to add x amount of transparent pixels (BGRA=0,0,0,0 will do nicely).
You get x from the next byte after the 1 in the first byte.
So, you need to remove this 1 byte and x (the next byte) and insert x amount of transparent pixels (4 bytes).

An image to explain everything and where these blue 1 bytes linger:
http://s13.postimg.org/g6mudz193/info_GFX.png

The GFX is full of goods worth looking through!
I haven't check them all, maybe I have made a mistake,
If you need help feel free to msg me or post :)

xbv
11-26-2015, 08:18 AM
updated the link for those interested in the new update
http://s29.postimg.org/wt45202o3/6623.png
http://s29.postimg.org/t889iry4j/6756.png
http://s29.postimg.org/ytuomtytf/6757.png
http://s29.postimg.org/pncdzjtkz/6759.png

wizzarr
01-15-2016, 06:13 PM
You think there anything other than image data in the file?

wizzarr
02-04-2016, 04:29 AM
This is wrong.
Zezenia reads 4 bytes to know the number of images to read, not 2. It also reads 4 bytes for the size of the image, not 3.

Regarding the transparent pixels, I didn't look much with olly, but something is wrong there. The third image, which is the client background, is 2048x1024 (width x height). This means there are 2048x1024 = 2097152 pixels in the image. If you multiply that by 4, which is the number of bytes in each pixel, you get 8388608, which is the number of bytes in the image. However, the actual number of bytes in the image is 6291510 (downloaded from your dump).

Also, all your images have bit depth 24, which means 3 bytes per pixel, not 4, but eh gfx apparently uses 4, which means bit depth 32.

If I read the 8388608 bytes that I should read according to the tutorial, and replace the 0x01 0x0X with X transparent pixels, I will get an out of boundaries exception, because moving 2 bytes for the transparents and 4 for the other ones doesn't match the 8388608 (I will be at index 8388606 when I should read the last 4 bytes, which would be 8388606, 8388607, 8388608 (boom) and 8388609 (boom)).

Also, in your screenshot, in the image you are using as example, there are 3 sections of transparent pixels: 01 12, 01 04, and 01 06. This means 18*4 + 4*4 + 6*4 = 72 + 16 + 24 = 112 bytes (28 pixels).
The rest of the image pixels sum up to 9*4 bytes = 36 bytes (9 pixels). 28 + 9 = 37 pixels. HOWEVER, the image is 8x8 = 64 pixels. The math doesn't add up.