首页
社区
课程
招聘
分享一个ida dump so的python脚本
2023-6-30 00:04 7368

分享一个ida dump so的python脚本

2023-6-30 00:04
7368

ida dump so for python

  • 麻了,等半天dump不下来 还卡住,加个过程打印。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import ida_bytes
 
def main():
    ea = 0x764BC46000  # 需对应修改
    end = 0x764bda5000
    size = 0x1000
    # 别问为什么没写路径,pd或者wine跑的ida 根本找不到路径
    sofile = open("soname.so", "wb")
    print('collect start')
    while True:
        if ea>end:
            break
        list = ida_bytes.get_bytes(ea,size)
        print(f'collect:{hex(ea)}')
        buf = bytearray(list)
        sofile.write(buf)
        sofile.flush()
        ea += size
    sofile.close()
    print('write over')
 
 
if __name__ == '__main__':
    main()

本来想在网上随便找个脚本dump以下 结果发现大部份脚本IDC PY 都是一个字节一个字节读取的太慢了.修改了某一个脚本直接一次性读取全部字节


[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

最后于 2024-1-31 17:30 被iyue_t编辑 ,原因: 新增dump过程
收藏
点赞2
打赏
分享
最新回复 (2)
雪    币: 138
活跃值: (460)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
Nermor 1 2023-11-18 00:52
2
1

因为自己写的idc dump脚本比较卡, 搜到了这篇文章;

于是修改了一番,结论是 一样卡,- - !

这个写文件ida 二次转存就是没有直接写个插件进去dump快,凑合用吧。


ida version > 8.0  

import ida_bytes

def main():
    start_ea = ida_kernwin.ask_addr(ida_ida.inf_get_min_ea(), "Please enter the starting address for the data to be analyzed.")
    end_ea = ida_kernwin.ask_addr(ida_ida.inf_get_max_ea(), "Please enter the ending address for the data to be analyzed.")
    size = end_ea-start_ea
    file = ida_kernwin.ask_file(1, "*.*", "save file path")
    list = ida_bytes.get_bytes(start_ea,size)
    buf = bytearray(list)
    with open(file, 'wb') as fw:
        fw.write(buf)
    print('dump over')

if __name__ == '__main__':
    main()


最后于 2023-11-18 00:56 被Nermor编辑 ,原因:
雪    币: 1210
活跃值: (2649)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
iyue_t 2023-11-27 17:37
3
0
Nermor 因为自己写的idc dump脚本比较卡, 搜到了这篇文章;于是修改了一番,结论是 一样卡,- - !这个写文件ida 二次转存就是没有直接写个插件进去dump快,凑合用吧。ida version &a ...
等有时间可以写成插件,不过你这个也已经够用了。
游客
登录 | 注册 方可回帖
返回