1. 프로그램 확인
- VB(Visual Basic) 으로 작성된 프로그램이다.
- 시리얼 키(serial key)를 검증하는 프로그램이다.
2. VB(Visual Basic) 파일의 특징
2.1 Visual Basic (VB) 전용 엔진
- VB 파일은 MSVBVM60.dll (Microsoft Visual Basic Virtual Machine 6.0) 이 라는 VB 전용 엔진을 사용한다.
→ 메시지 박스를 출력하고 싶을때 VB 소스코드에서 MsgBox() 함수를 사용한다.
→ VB 컴파일러는 실제로 MSVBVM60.dll!rtcMsgBox() 함수가 호출되도록 만들고,
→ 이 함수 내부에서 Win32 API인 user32.dll!messageBoxW() 함수를 호출해주는 방식으로 동작한다.
2.2 N (Native) code vs. P (Pseudo) code
- VB 파일은 컴파일 옵션에 따라 N(Native) code와 P(Pseudo) code로 컴파일 된다.
- N (Native) code : 디버거에서 해석이 가능한 IA-32 Instruciton을 사용
- P (Pseudo) code : VB 엔진으로 가상 머신을 구현하여 자체적으로 해석 가능한 명령어 코드를 사용
- => Interpreter 언어 개념으로 P code를 해석하려면 VB 엔진을 분석하여 에뮬레이터를 구현해야한다.
2.3 Event Handler
- VB 는 주로 GUI 프로그래밍을 할 때 사용한다.
- Windows 운영체제의 Event Driven 방식으로 동작한다.
- => main() 혹은 WinMain() 에 사용자 코드가 존재하는 것이 아니라, 각 event handler 에 사용자 코드가 존재한다.
2.4 undocumented 구조체
- VB에서 사용되는 각종 정보들 (Dialog, Control, Form, Module, Function등)은 내부적으로 구조체 형식으로 파일에 저장됨
- Microsoft에서는 구조체 정보는 비공개 → VB 파일의 디버깅이 어려움
3. 디버깅
'Reverse Engineernig > study' 카테고리의 다른 글
[리버싱 핵심원리] ch13. PE File Format (0) | 2023.01.08 |
---|---|
[리버싱 핵심원리] ch.10 함수 호출 규약 (0) | 2023.01.03 |
[리버싱 핵심원리] ch07. 스택 프레임 (0) | 2022.12.28 |
[리버싱 핵심원리] ch06. abex' crackeme #1 분석 (0) | 2022.12.28 |
[리버싱 핵심원리] ch05. 스택 (0) | 2022.12.27 |