https://github.com/deathmemory/dm_dex_parser
解析 dex 文件,python 安装包的封装
https://github.com/deathmemory/dm_dex_parser
Last synced: about 1 year ago
JSON representation
解析 dex 文件,python 安装包的封装
- Host: GitHub
- URL: https://github.com/deathmemory/dm_dex_parser
- Owner: deathmemory
- Created: 2018-03-06T03:28:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-08T08:11:58.000Z (over 8 years ago)
- Last Synced: 2025-02-11T23:55:02.046Z (over 1 year ago)
- Language: Python
- Size: 29.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dm_dex_parser
解析 dex 文件,python 安装包的封装
本项目是 [dex_parser](https://github.com/ondreji/dex_parser) 的引用,主要是加了层封装,可以作为第三方库导入 python 环境。
# install
`python setup.py install`
# import
`import dex_parser` or `from dex_parser import dex`
# usage
```python
def main():
if sys.argv < 2:
print ("Usages: %s dex_file" % sys.argv[0])
quit()
filename = sys.argv[1]
# filename = "D:\\classes.dex"
dex = dex_parser(filename)
for key in dex.m_class_name_id:
if ('MobileAgent' in key):
clsid = dex.m_class_name_id[key]
print(dex.getclassmethod_count(clsid))
method_id, code_off = dex.getclassmethod(clsid, 0)
print(hex(code_off))
methodcode = method_code(dex, code_off)
methodcode.printf(dex)
method_id, code_off = dex.getclassmethod(clsid, virtrualmethod_idx= 0)
print(hex(code_off))
methodcode = method_code(dex, code_off)
methodcode.printf(dex)
print(dex.getmethodname(method_id))
print(dex.getmethodfullname(method_id))
print(dex.getmethodfullname1(method_id))
```