MOB File Format Breakdown Thread

Discussion in 'General Modification' started by Agetian, Mar 20, 2005.

Remove all ads!
  1. Firestrand

    Firestrand Member

    Joined:
    Mar 11, 2004
    Messages:
    79
    Likes Received:
    0
    Hmmm…
    I have two suggestions.

    1. Talk to Morpheus about outlining the mob file code from temple.dll. I am not experienced enough with assembly code or I would do it myself. If you wish to jump in and try yourself I can recommend a few books and cheaper decompilers than IDA (I believe that was what Morpheus was using)

    2. Take a look at the map size in relation to the associated mob file, more than likely there is a relation between the two. I didn’t see that mentioned previously in this thread, so I apologize if this is info already known.

    -Firestrand
     
  2. lord_graywolfe

    lord_graywolfe Wolfman

    Joined:
    Apr 30, 2004
    Messages:
    739
    Likes Received:
    0
    ok i figured out myself and the first ones i posted wont do you any good so ignore them. but on the plus side i have about 20 here for you. let me know what else you need.

    these are mostly in the map12-temple-dungeon-level-1 folder

    the last few are in the demo-hommlet folder. they are seperated in the file. figured this would be easier for you than me just typing them all on here
     

    Attached Files:

    • mob.txt
      File size:
      1 KB
      Views:
      12
  3. Morpheus

    Morpheus Mindflayer Veteran

    Joined:
    Nov 11, 2003
    Messages:
    539
    Likes Received:
    1
    That would be moebius2778, not Morpheus. *sigh*
     
  4. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Hey,

    @lord_graywolfe: thanks for the list of mobs, pal! Way to go!

    @Firestrand: about the disassembly: good idea, what can you recommend? IDA is way expensive for me, maybe there's something freeware available on the net or at least stuff that isn't that expensive? As for the outlining the mob code, that would be nice if someone can post more details on how exactly I can do this. I've had some experience with assembler before but I've never done practical disassembly, so it'd be my first time. Anyway, I think it might be helpful if we could outline the mob code.
    Thanks in advance.
    - Agetian
     
  5. lord_graywolfe

    lord_graywolfe Wolfman

    Joined:
    Apr 30, 2004
    Messages:
    739
    Likes Received:
    0
    your welcome Agetian. it was np once i got it figured out lol. ill get the hang of modding yet. just let me know what else you might need help with.
     
  6. Firestrand

    Firestrand Member

    Joined:
    Mar 11, 2004
    Messages:
    79
    Likes Received:
    0
    Sorry about that Morpheus and Moebius2778. I was running off of memory, and I should have looked up the temple.dll hacker.

    Agetian: I can actually provide you with "Assembly Language Step-by-Step" in dead tree version, if you would like to PM me your snail mail address I will send it to you.

    I peeked at the file briefly using "PE Explorer" it is less expensive and has a 30 day trial. The open source or free ones I found were for linux elf binaries. Anyway when I peeked at the file, each time a mob file is touched it jumps to the same routine, so it shouldn't take you too long to figure out what it is doing.

    I really don't have time right now to do this myself, but I can provide some help in the form of a book or two if there is another brave soul out there who wants to help. I warn you though, assembly language is no simple thing, and you should be an experienced programmer to not give yourself an aneurism.

    -Firestrand
     
  7. Jota

    Jota Member

    Joined:
    Apr 21, 2004
    Messages:
    40
    Likes Received:
    0
    Agetian i made a post at the Maps section but seems no one was interested im my research, what i did in that post is what i can do regarding MOD TOEE.

    Firestrand im interested to, i think i have my email at my profile, im reading the Monk modification by Moebius, but i have some difficulty to understand all that stuff, in future i would like to make the same to the Paladin.

    Ok seems that email future is is not active, i send you a PM
     
    Last edited: Mar 30, 2005
  8. Firestrand

    Firestrand Member

    Joined:
    Mar 11, 2004
    Messages:
    79
    Likes Received:
    0
    Oops... Did a little more digging, take a look at boomerang
    It should be able to decompile temple.dll into c code.

    -Firestrand
     
  9. lord_graywolfe

    lord_graywolfe Wolfman

    Joined:
    Apr 30, 2004
    Messages:
    739
    Likes Received:
    0
    well firestand that i might be able to help with that, its been better than 20 years since i did any real programing and things have changed alot in that time but i do remember how much of a pain assembly was, only slightly less than machine, but ill give it a go again if anyone needs help with it.
     
  10. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Hey,
    sorry for being a little silent lately - just life troubles are kinda making modding harder for me now :)
    Anyway, it'd be a good idea to give a pe explorer a try - so I'm gonna do it soon enough. I'll check out if I can find some people in my city who know the assembler/disassembler/debugger stuff ;-)
    Stay tuned!
    - Agetian
     
  11. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    OK, I need someone to test the following thing out:
    there's a file called G_0247AC97_... .mob (sorry I didn't give the whole filename, but the above part should be enough) in the "Tutorial Map 1" folder in the modules/ToEE/ToEE.dat. It's the first chest in a tutorial dungeon.

    The following offsets:
    0x0053 ... 0x006A (possibly 0x006B)
    seem to store some information about the object (e.g. rotation).

    I would like someone to try tinkering with these offsets and see what good can be made of it. I have to warn you, though, that you need to be very patient, because any inaccurate action in these offsets causes the game to crash to desktop. I already tried the offsets 0x0061 and 0x0062 and they seem to modify the game object rotation.

    If someone can provide me some information about what exactly these offsets do and how to change them without taking a wild guess and entering random stuff in there I'd be very grateful (the offsets are only valid for the MOB file given above, the exact location and the length of this field may vary in different mob files - if someone could research this, too, I would be grateful).

    Thanks in advance.
    - Agetian
     
  12. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    These look like pickled files from the Python, probably (this would explain the variable lengths -- an NPC's .mob file is going to be much larger than a portal or container)

    I've got the following so far for the file:

    Code:
    offset
    0053-0056     location   (40 87 c3 b7 = 1082639287)
    0057-005a     offset_x   (3f b5 50 f5 = 1068827893)
    005b-005e     ????
    005f-0062     rotation   (40 16 cb e4 = 1075235812)
    0063-0066     radius     (42 10 b2 97 = 1108390551)
    0067-006a     3d_render_height (41 ed 53 07 = 1106072327)
    
    I didn't actually test changing these, I simply walked up to the chest, used the console to get an obj handle on the chest, and then (one by one -- ugh) retrieved the int values of the fields of the obj, and where the "big" numbers matched in hex, I was able to figure out what they are.

    Note that you'd THINK the ? value would be the offset_y, but the console returns -1 for the offset_y, and those 4 hex digits don't look like any -1 I can figure (1's complement, 2's complement, etc.). It's probably just a fixed-point float designation I'm not familiar with though (given the rather large values up there for radius, rotation, etc).

    -- dulcaoin
     
  13. Firestrand

    Firestrand Member

    Joined:
    Mar 11, 2004
    Messages:
    79
    Likes Received:
    0
    dulcaoin-
    If they are pickled, shouldn't we be able to load the file into a standard python console via pickle.load() and then do whatever we want with the file?

    Actually I think they used cPickle in the engine?

    I am still new to Python so if I am wronng let me know.

    -Firestrand
     
  14. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Ha! Good times.

    Here I thought YOU were the Python expert, throwing around the "cPickle" statement (which pushed me to go look it up, and make me feel like I was playing catch-up) :)

    There's nothing like the social mask of a programmer. :p

    The reason I said they look pickled [side note to the other programmers out there -- Python has this bizarre habit of calling streaming or marshalling or flattening -- basically a direct dumping/reading-back of data structures to a data file -- "pickling"] is that the fields in the file are in the exact same order they appear in the obj structure in memory (albeit with LOTS of missing fields "in between" what's there). In order to pickle or unpickle, we'd need structure definitions for the py data structures, which we don't entirely have "for sure". Also, you'd just finished mentioning pickling, so I had it on the brain, and so posted that they look like direct data structure dumps. XML, this ain't :-/

    I keep hoping some "Python God" can happen along, "de-tokenize" the python code that's internal to the engine, and give us those structures byte-perfect. Until then, I dig, find clues, and work things out.

    Besides which, as I mentioned, there are a LOT of missing fields in between what is there in the file. There must be pickling and unpickling (de-pickling? de-salinating :p) routines in the code that separate and recombine the items. If someone were to disassemble THOSE, then we'd have a better chance at figuring this out without so much legwork.

    But it's working well now.

    I was RIGHT on my way to finding the prototype_id in that set of bytes (it's a REALLY small file, and why I didn't go looking for that item FIRST I can't really explain) when my boot drive went completely south on me this afternoon; BTW.

    So someone should look up the chests in the proto.tab, write down the ID's, and then find the byte pattern, thereby eliminating more bytes in this game of process-of-elimination (while I reinstall XP onto my brand-new hard drive :-( )

    -- dulkee
     
  15. Firestrand

    Firestrand Member

    Joined:
    Mar 11, 2004
    Messages:
    79
    Likes Received:
    0
    Nah... Just an experienced programmer picking up a new language...

    Dul-
    What commands did you use on the command line to get a handle on the object? My thoughts are that we could dump the object to a file using cPickle, pickle, and marshal. Then see which one comes closest to the actual mob file.

    Then we could make modifications to all of those parameters and then see what changes.

    Watcha think?

    -Firestrand
     
    Last edited: Apr 2, 2005
Our Host!