The Forum is up for sale: XeNTaX Forum looking for new owner

010 editor 24bit uint

Coders and would-be coders alike, this is the place to talk about programming.
Post Reply
twisted
veteran
Posts: 100
Joined: Mon Apr 23, 2007 11:25 pm
Has thanked: 2 times
Been thanked: 7 times

010 editor 24bit uint

Post by twisted »

Hi, I'm currently writing a 010 editor template script and I'm having trouble reading some file offsets in the contents table as they are stored as a 24bit uint and 010 editor does not support type casting.

I've tried bitfields but they don't seem to calculate the offset correctly and always display 0. Does anyone know a work around for this?

Thanks in advance.
twisted
veteran
Posts: 100
Joined: Mon Apr 23, 2007 11:25 pm
Has thanked: 2 times
Been thanked: 7 times

Re: 010 editor 24bit uint

Post by twisted »

Managed to get the bitfields to work so never mind!
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: 010 editor 24bit uint

Post by finale00 »

How did you solve it? Maybe others might run into the same problem.
twisted
veteran
Posts: 100
Joined: Mon Apr 23, 2007 11:25 pm
Has thanked: 2 times
Been thanked: 7 times

Re: 010 editor 24bit uint

Post by twisted »

My mistake was using bytes instead of bits, so I had typed:

Code: Select all

uint offset : 3
uint flag : 1
when it should have been:

Code: Select all

uint offset : 24
uint flag : 8
Post Reply