Ejemplo n.º 1
0
    def saveandrepoint(self, offset_old, newstring):
        offset_new = self.save(offset_old, newstring, force=False)

        writedata = BBlock()
        writedata.addPointer(offset_new)

        pointers = self.rom.findall(offsetToGBA(offset_old))
        for pointer in pointers:
            self.rom.write(pointer, writedata)

        return offset_new
Ejemplo n.º 2
0
 def search(self, string):
     #String to bytes, strip the END OF STRING byte.
     searchbytes = PokeString(string).bytestring()[:-1]
     results = self.rom.findall(searchbytes)
     
     results_list = []
     for offset in results:
         thestr = self.rom.getRM().get(PokeString, offset)
         occ_count = len(self.rom.findall(array('B', offsetToGBA(offset))))
         results_list.append((offset, occ_count, thestr))
     
     self.mainview.setResults(results_list)
Ejemplo n.º 3
0
    def search(self, string):
        #String to bytes, strip the END OF STRING byte.
        searchbytes = PokeString(string).bytestring()[:-1]
        results = self.rom.findall(searchbytes)

        results_list = []
        for offset in results:
            thestr = self.rom.getRM().get(PokeString, offset)
            occ_count = len(self.rom.findall(array('B', offsetToGBA(offset))))
            results_list.append((offset, occ_count, thestr))

        self.mainview.setResults(results_list)
Ejemplo n.º 4
0
    def saveandrepoint(self, offset_old, newstring):
        offset_new = self.save(offset_old, newstring, force=False)
        
        writedata = BBlock()
        writedata.addPointer(offset_new)
        
        pointers = self.rom.findall(offsetToGBA(offset_old))
        for pointer in pointers:
            self.rom.write(pointer, writedata)

        return offset_new
        
        
Ejemplo n.º 5
0
 def findStartpoint(self, offset):
     while offset >= 0:
         if self.rom.readByte(offset)[1] == 0xff:
             break
             
         offset -= 1
         if self.rom.find(array('B', offsetToGBA(offset)), 0) > -1:
             self.selectString(offset)
             showInfo(self.view, "Start of text found at offset 0x%X!"%offset)
             return
     
     #Very unlike to be seen.
     showInfo(self.view, "There was no valid startpoint found for the given text.")
Ejemplo n.º 6
0
    def findStartpoint(self, offset):
        while offset >= 0:
            if self.rom.readByte(offset)[1] == 0xff:
                break

            offset -= 1
            if self.rom.find(array('B', offsetToGBA(offset)), 0) > -1:
                self.selectString(offset)
                showInfo(self.view,
                         "Start of text found at offset 0x%X!" % offset)
                return

        #Very unlike to be seen.
        showInfo(self.view,
                 "There was no valid startpoint found for the given text.")
Ejemplo n.º 7
0
 def getNumberOfPointers(self, offset):
     return len(self.rom.findall(array('B', offsetToGBA(offset))))
Ejemplo n.º 8
0
 def getNumberOfPointers(self, offset):
     return len(self.rom.findall(array('B', offsetToGBA(offset))))