當前位置: 首頁>>代碼示例>>Python>>正文


Python idc.MinEA方法代碼示例

本文整理匯總了Python中idc.MinEA方法的典型用法代碼示例。如果您正苦於以下問題:Python idc.MinEA方法的具體用法?Python idc.MinEA怎麽用?Python idc.MinEA使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在idc的用法示例。


在下文中一共展示了idc.MinEA方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_bad_addresses

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import MinEA [as 別名]
def get_bad_addresses(verbose=True):
    """ gets all the unmapped addressed from IDA's database """
    ret = []
    curEa = idc.MinEA()
    while True:
        if verbose:
            print "[+] getting more bad addresses 0x%08X" % (curEa)
        # the regex "(DC[DQ]| B.*) +0x" will retrieve the following:
        # 1. DCD 0x...
        # 2. DCQ 0x...
        # 3. B   0x.....
        # 4. BL  0x....
        curEa = get_next_bad_addr(curEa, "(DC[DQ]| B.*) +0x")
        if curEa == idc.BADADDR:
            break
        if verbose:
            print "[+] found bad address at 0x%08X" % (curEa)
        dcd = idc.GetDisasm(curEa)
        res = re.findall("0x\w{8,}", dcd)
        for r in res:
            ret.append(int(r, 16))
    if verbose:
        print "[+] found %d bad addresses" % len(ret)
    return ret 
開發者ID:deepinstinct,項目名稱:dsc_fix,代碼行數:26,代碼來源:dsc_fix.py

示例2: reset

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import MinEA [as 別名]
def reset():
        idc.MakeUnknown(idc.MinEA(), 0x1000, 0)
        for i in range(0x1000):
            idc.PatchByte(idc.MinEA() + i, 0) 
開發者ID:sogeti-esec-lab,項目名稱:LKD,代碼行數:6,代碼來源:simple_x64.py

示例3: tst

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import MinEA [as 別名]
def tst():
        reset()
        midap.here(idc.MinEA()).write(s.get_code())
        idc.MakeFunction(idc.MinEA())

    # tst() 
開發者ID:sogeti-esec-lab,項目名稱:LKD,代碼行數:8,代碼來源:simple_x64.py

示例4: tst

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import MinEA [as 別名]
def tst():
        reset()
        midap.here(idc.MinEA()).write(s.get_code())
        idc.MakeFunction(idc.MinEA()) 
開發者ID:sogeti-esec-lab,項目名稱:LKD,代碼行數:6,代碼來源:simple_x86.py

示例5: main

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import MinEA [as 別名]
def main():
    if _IN_IDA:
        # # get dyld_shared_cache path from IDA's openFile dialog
        print "[+] Please choose the original dyld_shared_cache_arm64"
        dsc_path = idc.AskFile(0, "*.*", "dyld shared cache file")
    else:
        dsc_path = sys.argv[1]

    if not dsc_path or not os.path.exists(dsc_path):
        raise RuntimeError("Couldn't find the dyld shared cache file..")

    print "[+] about to parse %s.." % (dsc_path)
    dsc_file = open(dsc_path, "rb")
    adrfind = AddrFinder(dsc_file, cache_symbols=False)
    map_shared_bridges(dsc_file, adrfind)
    if _IN_IDA:
        addresses = sorted(set(get_bad_addresses()))
    else:
        addresses = sorted(set(eval(open("addrs.txt", "rb").read())))

    segments, exports = get_segments_and_exports_for_addresses(addresses, adrfind)
    # segments = join_neighbors(segments, threshold=0x1000)
    if _IN_IDA:
        map_segments(segments, dsc_file)
        map_exports(exports)
        idaapi.analyze_area(idc.MinEA(), idc.MaxEA()) 
開發者ID:deepinstinct,項目名稱:dsc_fix,代碼行數:28,代碼來源:dsc_fix.py


注:本文中的idc.MinEA方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。