Created
January 11, 2020 02:20
-
-
Save SciresM/825cc59251c7299bb0020fc1fc40b8ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from idautils import * | |
from idaapi import * | |
from idc import * | |
from ida_hexrays import * | |
START_100 = 0x7100770C10 | |
END_100 = 0x710077FC60 | |
START_110 = 0x7100770E30 | |
END_110 = 0x710077FE80 | |
MAPPING = { | |
# Generate this in your old IDB | |
} | |
V100, V110 = range(2) | |
VERSION = V100 | |
if VERSION == V100: | |
FUNCRANGE = (START_100, END_100) | |
elif VERSION == V110: | |
FUNCRANGE = (START_110, END_110) | |
else: | |
raise ValueError() | |
def is_pml_func(ea): | |
return FUNCRANGE[0] <= ea and ea <= FUNCRANGE[1] | |
# Iterate over all segments | |
COUNT = 0 | |
for segea in Segments(): | |
for funcea in Functions(segea, get_segm_end(segea)): | |
func_name = idc.get_func_name(funcea) | |
func_type = idc.get_type(funcea) | |
if is_pml_func(funcea): | |
if VERSION == V100: | |
print '%d: (\'%s\', \'%s\'),' % (COUNT, func_name, func_type) | |
elif VERSION == V110: | |
name, type = MAPPING[COUNT] | |
idc.set_name(funcea, name, SN_CHECK) | |
idc.SetType(funcea, type.replace('(', ' a(')+';') | |
COUNT += 1 | |
print 'Total: %d' % COUNT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment