🔒정보보안/모바일 보안

모바일 해킹 - DEX를 jar로 추출하여 class 파일들 확인하기

Janger 2021. 12. 11. 20:24
728x90

DEX를 구하기 위해서는 7-zip을 설치해서 APK를 추출해야 합니다. 

 

https://www.7-zip.org/download.html

 

Download

Download .7z Any / x86 / x64 LZMA SDK: (C, C++, C#, Java)

www.7-zip.org

 

그 다음 dex 파일을 jar로 변환시켜주는 dex2 jar를 설치받습니다. 

https://github.com/pxb1988/dex2jar

 

GitHub - pxb1988/dex2jar: Tools to work with android .dex and java .class files

Tools to work with android .dex and java .class files - GitHub - pxb1988/dex2jar: Tools to work with android .dex and java .class files

github.com

 

dex2jar를 환경 변수로 등록을 시켜 아까 7-zip으로 DEX를 추출한 폴더로 가셔서 아래의 명령어를 입력합니다. 

 

d2j-dex2jar.bat classes.dex

 

그러면 "classes-dex2jar.jar"라는 파일이 새로 생겼을 겁니다. 

 

 

이 jar 파일을 또 JD-GUI라는 도구를 통해 class 파일들의 자세한 내용을 살펴보시면 됩니다. 

http://java-decompiler.github.io/

 

Java Decompiler

The “Java Decompiler project” aims to develop tools in order to decompile and analyze Java 5 “byte code” and the later versions. JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reco

java-decompiler.github.io

 

 

 

728x90