Beispiel #1
0
    def load_names(dump, file, guessfunc=False):
        if file.endswith(".S"):
            a2n,n2a = match.parse_stub(file)
            fe = {}
            if guessfunc:
                for a in a2n:
                    if a > dump.loadaddr and a < dump.maxaddr:
                        tryMakeSub(dump,a)
        elif file.lower().endswith(".idc"):
            a2n,n2a,fe = idc.parse(file)
            dump.idc = file
        else:
            raise Exception, "Unrecognized extension: " + file
        
        for n,a in n2a.iteritems(): 
            dump.MakeName(a,n)
        for f,e in fe.iteritems():
            dump.MakeFunction(f,e)

        if not hasattr(dump, "_loadednames"):
            dump._loadednames = {}
        dump._loadednames.update(n2a)
Beispiel #2
0
def gen_fwcheck(d, stubfile):
    a2n,n2a = match.parse_stub(stubfile)
    for a,n in sorted(a2n.iteritems()):
        if a in d.ROM:
            print "CHECK(%10s, %10s) // %s" % (hex(a).strip("L"), hex(d.ROM.get(a)).strip("L"), n)