일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- LLVM Obfuscator
- pinpoint
- custom packer
- linux thread
- so inject
- v8 optimizing
- on-stack replacement
- TLS
- Android
- Linux packer
- anti debugging
- v8 tracing
- thread local storage
- 안티디버깅
- tracing
- LLVM
- pthread
- initial-exec
- Linux custom packer
- tracerpid
- 난독화
- Obfuscator
- OSR
- apm
- linux debugging
- Injection
- LLVM 난독화
- android inject
- uftrace
- on stack replacement
- Today
- Total
Why should I know this?
[TODO] undef 본문
1. Undef
– Explicit value in the IR
– Acts like a free-floaLng hardware register
• Takes all possible bit pakerns at the specified width
• Can take a different value every Lme it is used
– Comes from uniniLalized variables
– Further reading
• We want this opLmizaLon:
%add = add nsw i32 %a, %b
%cmp = icmp sgt i32 %add, %a
=>
%cmp = icmp sgt i32 %b, 0
• But undef doesn’t let us do it:
%add = add nsw i32 %INT_MAX, %1
%cmp = icmp sgt i32 undef, %INT_MAX
• There’s no bit pakern we can subsLtute for
the undef that makes %cmp = true
LLVM has three kinds of UB
2. Poison
– Ephemeral effect of math instrucLons that violate
• nsw – no signed wrap for add, sub, mul, shl
• nuw – no unsigned wrap for add, sub, mul, shl
• exact – no remainder for sdiv, udiv, lshr, ashr
– Designed to support speculaLve execuLon of
operaLons that might overflow
– Poison propagates via instrucLon results
– If poison reaches a side-effecLng instrucLon, the
result is true UB
LLVM has three kinds of UB
3. True undefined behavior
– Triggered by
• Divide by zero
• Illegal memory accesses
– Anything can happen as a result
• Typically results in corrupted execuLon or a processor
excepLon
'LLVM-STUDY > TODO' 카테고리의 다른 글
[TODO] llvm 공부 계획 업데이트 (0) | 2023.10.18 |
---|---|
A Validated Semantics for LLVM IR (0) | 2023.06.23 |
symbolic execution 이란 무엇인가? (0) | 2023.05.03 |
instSimplify pass 튜토리얼 중... (0) | 2023.04.12 |
SMT survey (0) | 2023.04.12 |