uint32 and 3ds Max 2010

Sooda

Diversity enchants
Reaction score
318
I have this HEX stream: F0 EE 01 00. When doing hex2int (base10) I get:
Code:
F0 = 240
EE = 238
01 = 1
00 = 0
uint32 stands for unsigned integer 32 bits. Consider byte order is reversed, so 00 is the start and F0 is the end.
3ds Max 2010 is using mxs (maxscript) native functions to read that uint32 as a integer.
For more info check this: How 3ds Max Maxscript (MXS) reads binary
What could be integer representation of this HEX stream? 240 + 238 + 1 = 479?
Someone is writing exporter script for 3ds Max 2010 :D
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
You mean 240 + 238 + 1 = 479 in 32bit hex?
Or F0EE0100 as int?
 

Sooda

Diversity enchants
Reaction score
318
I checked answer with function made by another person and it shows 678.
EDIT: It is python struct module which interprets that HEX stream with format L (long) as a 678.
Code:
class hdr:
    fmt = '4sLL'

    def __init__(self, file):
        _s = file.read(struct.calcsize(self.fmt))
        self.magic, self.ofsTag, self.nTag = struct.unpack(self.fmt, _s)
        #self.MODLref = ref(file)
        print('DEBUG BIGTIME:' + str(self.ofsTag))
That HEX stream would be first L in 4sLL, I kinda got my answer. My own made function was akward (like usual :D)
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
You mean if F0EE0100 is really 479 or not?

0 * 16^7 = 0
0 * 16^6 = 0
0 * 16^5 = 0
1 * 16^4 = 65536
E * 16^3 = 57344
E * 16^2 = 3584
F * 16^1 = 240
0 * 16^0 = 0

= 65536 + 57344 + 3584 +240
= 126704

You forgot the power to 16 in your calculation.

It's like saying that you have the decimal number 1234 and you'd calculate it's worth like this:
1 = 1
2 = 2
3 = 3
4 = 4
1+2+3+4 = 10


0001EEF0 (in the "right" order, isn't it?) can't possibly be something as low as 678. A 4-digit hex number will be at least a 5-digit decimal number.
 

Sooda

Diversity enchants
Reaction score
318
You solved my problem. You know very well hex and mathematics. I am total beginner on that field. Thanks for help.
My bigger plan is to port 3ds Max Starcraft 2 exporter script into python. Currently verifying that my writen code reads correct bytes and interprets them correctly. Though luckily that work is done by python struct module on background for me. Still it is great challange.

EDIT: Advice to others, when reading binary make sure file pointer is in correct place. I was comparing 497 (read from wrong place) with my desired reading place (126704) value. In python binaryfilename.tell() returns file pointer current location, great for debugging and alike, cheers!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top