본문 바로가기

[안드로이드] 디컴파일을 통한 crackme0.apk 크랙 - 방법1

by rudals.kim 2020. 12. 21. 댓글 개
반응형

APK의 디컴파일과 리컴파일 하는 방법을 알았으니 이제 연습용 APK를 사용하여 테스트 해 보도록 하겠습니다.

 

아래 사이트에서는 연습용 apk를 제공해 주고 있습니다.

 

way of the android cracker

these are some tutorials i've written to get people started with android cracking. way of the android cracker 0 this covers the essentia...

androidcracking.blogspot.com

위 사이트를 접속하면 메인에 "way of the android cracker 0"와 "way of the android cracker 1" 2가지가 있는데 0번이 1번보다 조금 더 난이도가 있습니다. 그래서 way of the android cracker 1번을 먼저 테스트 해 보려고 합니다.

아래사이트에서 lesson0와 lesson1의 예제 파일을 다운로드 받습니다.

 

way of the android cracker 1

lesson 1 is finished. it covers debugging methods such as log statements and smalidebugging with apktool and netbeans. it also features cr...

androidcracking.blogspot.com

위 사이트의 lesson0에서 받은 WayoftheAndroidCracker0.zip 파일을 압축을 해제 후 crackme0.apk를 안드로이드 에뮬레이터에 설치한 후 실행해 봅니다.

 

백업용으로 첨부되었습니다.

WayoftheAndroidCracker0.zip
0.51MB

 

아무거나 입력 후 Validate 버튼을 누르면 "Invalid serial!" 이란 팝업이 뜹니다.

JADX-GUI를 사용하여 crackme0.apk 코드를 분석해 봅니다.

마지막에 있는 validateSerial 메소드에서 사용자가 입력한 값과 generateHash 메소드에서 생성된 값을 비교하여 같으면 1을 다르면 0을 리턴합니다.

따라서 validateSerial 메소드에서 무조건 1만 리턴되도록 코드를 수정하면 사용자의 입력값에 상관없이 등록될것입니다.

 

아래와 같이 validateSerial 메소드에 패치 코드를 추가 후 테스트 해봅니다.

분석한 대로 패치가 되어 아무값이나 입력해도 프로버전으로 변경됩니다.

 

반응형

댓글