def reportPointers(currFile): unkPts = fix.getUnkPointers(currFile, rom=False, verbose=False) filesUtilized = {} # dict of filename, [ptrs] for ea, data in unkPts: fileUsed = mt.ea2gf(data) if fileUsed == '': fileUsed = 'ram' if fileUsed in filesUtilized: filesUtilized[fileUsed].append(data) else: filesUtilized[fileUsed] = [data] print('[Report] Unknown Pointers in file %s:' % mt.ea2gf(currFile[0])) for file in filesUtilized: print('\t%s: %d pointers\n\t\t%s' % (file, len(filesUtilized[file]), mt.hexArr(filesUtilized[file])))
def actionF(): """ Shift+F - Display current file """ gfs = env['gameFiles'] gf = mt.ea2gf(here()) fileAddr = here() - gfs[gf][0] size = gfs[gf][1] - gfs[gf][0] # get last name found ea = here() while not idc.Name(ea): ea -= 1 relAddr = here() - ea print('%s+0x%X::<%s>+0x%X (%d%%)' % (gf, fileAddr, idc.Name(ea), relAddr, float(fileAddr) / size * 100))
def actionW(): # fix.fixThumbPushPopFuncRanges(Function.Function(here() - 4).func_ea, here()) # fix.makeThumb(*env['gameFiles'][mt.ea2gf(here())]) idc.jumpto(env['gameFiles'][mt.ea2gf(here())][0])
def actionQ(): # print(ops.arrTillName(here())) idc.jumpto(env['gameFiles'][mt.ea2gf(here())][1]) print('jumped to %s' % mt.ea2gf(here()))