일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- TLS
- custom packer
- v8 tracing
- uftrace
- apm
- 안티디버깅
- thread local storage
- linux debugging
- Obfuscator
- Linux custom packer
- Android
- on-stack replacement
- so inject
- 난독화
- anti debugging
- on stack replacement
- android inject
- LLVM
- initial-exec
- Linux packer
- pinpoint
- LLVM Obfuscator
- pthread
- LLVM 난독화
- linux thread
- tracing
- v8 optimizing
- OSR
- Injection
- tracerpid
- Today
- Total
목록전체 글 (142)
Why should I know this?
"Hello World" in C "Hello World" in C++"Hello World" in Go "Hello World" in Rust $ cat C_hello.c#include int main(){ printf("Hello world\n");} $ cat Cplus_hello.cpp#include using namespace std;int main(){ cout
regs.rip = addr;[injected address] 0x400fb0 instead of expected SIGTRAP, target stopped with signal 11: Segmentation fault (gdb) x/10i 0x400fae [0x7f602fd0173c] [130037] │=> 0x400fae: add %al,(%rax) [0x7f602fd0173c] [150037] │ 0x400fb0: push %rsi [0x7f602fd0173c] [110037] │ 0x400fb1: push %rdx [0x7f602fd0173c] [140037] │ 0x400fb2: push %r9 [0x7f602fd0173c] [160038] │ 0x400fb4: mov %rdi,%r9 [0x7f..
만약 gcc를 사용하는 중에 의도치 않게 메모리 관련 에러가 발생한 경우, gcc에서 제공하는 스펙이나 표준 스펙에서 벗어난 코딩을 했을 경우가 높다.하지만 gcc가 내재한 버그일 가능성은 여전히 존재한다. gcc의 최적화는 각 단계가 독립적으로 진행되기 때문에 이전 단계에서 발생한 버그가 차후 스텝에 영향을 미쳐이를 디버깅하는게 절망적으로 어렵게 느껴지기도 한다. 이를 gcc 측에서도 인지하고 있기 때문인지 각 단계마다 결과물을 dump하여 확인할 수 있도록 제공하고 있다. gcc는 front-end에서는 tree라는 구조체를 메인으로 사용하며, front-end가 종료되는 시점에 tree를 rtl로 변환하여 back-end에 전달한다. -fdump-tree-all; gcc front-end의 각 스텝..
-fno-inline static으로 선언된 함수들은 소스코드 상에서는 함수로 존재하지만, 바이너리에는 inline 됨. 컴파일 시에 GCC 옵션으로 이를 방지하면 tracing하기 편해짐. (참고 링크 : stackoverflow )-fkeep-inline-functionsinline function 유지 옵션. -gdwarf-2 dwarf 2이상의 format을 사용. -fdump-tree-alltree 생성 과정을 모두 덤프하여 파일로 저장 -fdump-tree-all-detailstree 생성 과정에서 발생하는 모든 event를 함께 저장 -fdump-rtl-all최적화 과정을 모두 덤프하여 파일로 저장
GCC 컴파일 관련 정리. 소스코드 다운 : (mirror - locate at japan) wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-7.3.0/gcc-7.3.0.tar.gz 의존성 라이브러리 설치 : ./contrib/download_prerequisites 빌드 환경 설치 : sudo apt install build-essential configure :gcc source가 있는 곳에서 ./configure 하지 말 것을 권하므로, 한 단계 올라간다.cd.. mkdir buildcd build../gcc-7.3.0/configure make -j6 custom option:configure할 때 CFLAGS 와 CXXFLAGS 지정...