본문 바로가기

전체 글

(40)
DLL 분석 이 글은 강병탁 저 『리버스 엔지니어링 바이블: 코드 재창조의 미학』(위키북스, 2014)을 참고하여 학습한 내용을 정리한 것DLL(Dynamic-Link Library)과 EXE 차이공통점PE Header가 있음함수와 조건문, 반복문으로 이루어진 코드 덩어리차이점exe는 단독 실행 가능, dll은 exe나 다른 dll에서 호출해야 함exe는 메모리에 올라갈 때 고정된 주소에 로드, dll은 올라갈 때마다 위치가 바뀜(한 프로세스에 한 exe인 반면, dll은 여러개 가능)DLL 번지 계산DLL의 ImageBase(메모리에 로드될 때 기준 주소)는 0x1000_0000(컴파일러 기본 설정)exe는 보통 0x400_000ImageBase가 같은 dll 여러 개가 메모리로 로드된다면?내부적으로 다른 영역을 ..
LLVM 패스 만들기 https://github.com/leejaymin/llvm8-tutorials-jemin/tree/master?tab=readme-ov-file GitHub - leejaymin/llvm8-tutorials-jemin: llvm8-tutorials-jeminllvm8-tutorials-jemin. Contribute to leejaymin/llvm8-tutorials-jemin development by creating an account on GitHub.github.com위 깃허브의 day1 part2에 대한 내용이다 패스 작성 및 빌드 : https://joinwoo-blog.tistory.com/44 llvm pass build(함수 이름 출력)📚 LLVM Pass 빌드 및 사용 요약 (Ubu..
Writing an LLVM Pass https://llvm.org/docs/WritingAnLLVMNewPMPass.html Writing an LLVM Pass — LLVM 22.0.0git documentationThe LLVM pass framework is an important part of the LLVM system, because LLVM passes are where most of the interesting parts of the compiler exist. Passes perform the transformations and optimizations that make up the compiler, they build the analysis resullvm.org Introduction — What is a pass?LL..
VMProtect 2 - Detailed Analysis of the Virtual Machine Architecture(1) https://back.engineering/blog/2021/05/18/IntroductionVMProtect2: 가상 머신 기반 x86 난독화 도구x86 명령어를 RISC 기반의 스택 머신 명령어 집합으로 변환각 보호된 바이너리는 고유한 암호화된 가상 머신 명령어 집합과 고유한 난독화 방식 Obfuscation: Deadstore, Opaque BranchingVMProtect 2는 대부분 두 가지 유형의 난독화 기법 사용Dead StoreOpaque Branching조건 분기 명령비트 테스트 명령어, 의미 없는 비교(compare), 그리고 플래그 설정/해제(set/clear flags) 명령어 Opaque Branching 난독화 예시ror al, 1bswap edxbswap dxm..
The LLVM Compiler Framework and Infrastructure Tutorial Presentation https://llvm.org/pubs/2004-09-22-LCPCLLVMTutorial.html The LLVM Compiler Framework and Infrastructure TutorialThe Low-Level Virtual Machine (LLVM) is a collection of libraries and tools that make it easy to build compilers, optimizers, Just-In-Time code generators, and many other compiler-related programs. LLVM uses a single, language-independent virtual instructillvm.org LLVM 컴파일러 프레임워크와 인프라스트럭..
llvm-tutorial chapter 8 - Kaleidoscope: Compiling to Object Code https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.html 8. Kaleidoscope: Compiling to Object Code — LLVM 21.0.0git documentationLLVM has native support for cross-compilation. You can compile to the architecture of your current machine, or just as easily compile for other architectures. In this tutorial, we’ll target the current machine. To specify the architecture that you want tl..
🛡️ VMProtect 완전 분석: 바이트코드, IR, 그리고 최적화까지 출처: https://www.msreverseengineering.com/blog/2014/6/23/vmprotect-part-0-basics VMProtect, Part 0: Basics — Möbius Strip Reverse EngineeringOriginally published on August 6th, 2008 on OpenRCE This is part #0 of a four-part series on VMProtect. The other parts can be found here: Part 0: Basics Part 1: Bytecode and IR Part 2: Primer on Optimization Part 3: Optimizing and Compiling VMProtect iswww..
ObfusTree + Tigress 난독화 및 역난독화 결과 분석 적용 기법복잡도 증가율실행 시간 증가율LLM 역난독화 여부ObfusTree 단독+275%+54%✅ 성공Flatten 단독+875%+574%✅ 성공AddOpaque 단독+450%+57%✅ 성공Split 단독+300%+40%✅ 성공ObfusTree + Flatten+1650%+887%❌ 실패ObfusTree + Opaque+750%+51%❌ 실패ObfusTree + Split+600%+84%❌ 실패이전 글에서 소개한 original.c를 이용해 실험하고 그 결과를 담은 표이다.LLM 역난독화 여부에 대한 자세한 기준은: GPT-4o의 임시 채팅으로 역난독화를 부탁한다. 세 번 정도 돌렸을 때 역난독화를 실패했을 경우가 있을 때는 X로 표기한다. 즉 역난독화를 세 번 모두 성공했을 때는 O, 그게 아니면 X로..