Making an Xbox trainer manager, need XBTF file help

Discussion in 'Off Topic Discussion' started by nodots, Jan 15, 2017.

  1. nodots

    nodots Active Member

    Joined:
    Apr 27, 2014
    Messages:
    39
    Likes Received:
    15
    Not sure where this should go, so I put it here.

    I noticed a severe lack of trainer managers, so I am writing one in Python/Tkinter. It is mostly finished, but I need help with .xbtf support.

    Features: (Working)
    List of all (.etm) files in the directory (sorted).
    Select a file on the left and click "Load file info" to display internal info.
    Renaming of selected file.

    To-do:
    Add support for .xbtf files.
    Check for duplicates using CRC32, on certain parts of the file only.
    File delete support.
    Display game art.

    XBTF support is the one thing I can't do alone. I can't read ASM inline in C. The source code to read this stuff is in the XBMC4Xbox project, and the file the read code is in has the most important bits in ASM inline in the C code. I can't make heads or tails of what data is fed to the code as I don't know C well enough.

    If anyone could help me out, I would love it!

    Here is the pointer read code I have (I know I need to rewrite it):
    Code:
    class ETMpointers(object):
        def __init__(self, ETMfile):
            self.ptr_list = []
            self.ETMfile = ETMfile
            self._get_TitleID()
            self._get_table()
            
        def _get_TitleID(self):
            self.ETMfile.seek(18)
            self.TitleID = str(self.ETMfile.read(2))
            self.temp_ptr = int(''.join(reversed(self.TitleID)).encode('hex'), 16)
            self.ptr_list.append(self.temp_ptr)
            
        def _get_table(self):
            #get's location of table, no need to add to ptr list
            self.ETMfile.seek(14)
            self.table_ptr = str(self.ETMfile.read(2))
            self.table_ptr = int(''.join(reversed(self.table_ptr)).encode('hex'), 16)
            self._load_table()
            
        def _load_table(self):
            self.ETMfile.seek(self.table_ptr)
            self.temp_ptr = str(self.ETMfile.read(2))
            self.temp_ptr = int(''.join(reversed(self.temp_ptr)).encode('hex'), 16)
            self.ptr_list.append(self.temp_ptr)
            while self.temp_ptr:
                self.ETMfile.seek(2, 1)
                self.temp_ptr = str(self.ETMfile.read(2))
                self.temp_ptr = int(''.join(reversed(self.temp_ptr)).encode('hex'), 16)
                if self.temp_ptr: self.ptr_list.append(self.temp_ptr)
    
    Here is a picture of the manager in action:
    ptm_working.png
     
    lwizardl likes this.
  2. lwizardl

    lwizardl Living The Dream

    Joined:
    Mar 30, 2005
    Messages:
    575
    Likes Received:
    74
    looks like a very nice start you got there!
     
  3. nodots

    nodots Active Member

    Joined:
    Apr 27, 2014
    Messages:
    39
    Likes Received:
    15
    Thanks! I wanted to show that I'm capable/willing to do the work, I just need help where I'm stuck so I can finish and release.
    ...Then add features that are requested and release again! :D
     
    rso and lwizardl like this.
  4. nodots

    nodots Active Member

    Joined:
    Apr 27, 2014
    Messages:
    39
    Likes Received:
    15
    I just figured out what I couldn't figure out! XBTF support will come within the month (when depends on my amount of lazy). I know why it's there, and I will leave it in tact. Gotta respect what they did.
     
    lwizardl likes this.
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page