defeating-control-flow-flattening
Defeats control-flow-flattening obfuscation by identifying the dispatcher/state-
v1.0.03 התקנות+3 ב-7 ימים24 כוכביםApache-2.0סונכרן לפני 10 שעות
התקנה
עדיין אין לכם את ה-CLI של NotHoly? התקינו אותו קודם.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install meltedinhex/defeating-control-flow-flatteningנכתב אל ~/.notholy/skills אחרי בדיקת החתימה וה-SHA-256.
חתימהחתום, ed25519
חבילהb1536550…5e0dc319
b15365500140…ccd95e0dc3194 קבצים · 2.8 KBסריקהבינונישני ממצאים
- סקריפט הרצה שמגיע עם הסקילscripts/analyst.py
- קישורים לדומיינים חיצוניים
מקורgithub.com/meltedinhex/analyst-ai-pack/tree/main/skills/defeating-control-flow-flattening@da7600a
הפריט הזה עדיין לא נכתב בעברית, ולכן הוא מוצג בשפה אחרת: English.
בעמוד הזה
When to Use
- A function is flattened (a dispatcher loop switching on a state variable, with original blocks as switch cases) and you need to recover the original control flow.
- You are reversing OLLVM-style or similar flattening.
Do not use this on non-flattened code — confirm the dispatcher/state-variable pattern first. This skill analyzes disassembly/CFG data statically and executes nothing.
Prerequisites
- A disassembled function's basic-block/edge data (e.g., exported from Ghidra/IDA/Binary Ninja as JSON).
Workflow
Step 1: Detect the flattening structure
python scripts/analyst.py detect cfg.jsonIdentifies a dispatcher block (high in-degree, switch/compare on a state variable) and the relay/ case blocks that all branch back to it.
Step 2: Recover state transitions
Track the constant assigned to the state variable in each case to determine the successor block, rebuilding the true edges.
Step 3: Reconstruct the original CFG
Emit the deflattened successor mapping (case → next case) for re-annotation in the disassembler.
Step 4: Verify
Confirm the recovered flow has a single entry, sane successors, and no orphan blocks.
Validation
- The dispatcher is identified by in-degree and state-variable comparison.
- Each case's next-state constant maps to a real successor block.
- The reconstructed CFG covers all original (non-relay) blocks.
Pitfalls
- State variable computed (not a constant) — requires emulation/symbolic execution.
- Multiple dispatchers or nested flattening.
- Opaque predicates and bogus blocks inflating the case set.
References
- See
references/api-reference.mdfor the deflattener. - OLLVM and ATT&CK T1027 references (linked in frontmatter).
הקבצים בגרסה הזו
references/11.3 KB
- api-reference.md1.3 KB
scripts/12.3 KB
- analyst.py2.3 KB
- LICENSE340 B
- SKILL.md2.7 KB
הרשאות
| הרשאה | הוצהר | נמצא בסריקה |
|---|---|---|
| קורא קבצים | לא | לא |
| כותב קבצים | לא | לא |
| מריץ פקודות shell | כן | כן |
| משתמש ברשת | כן | כן |
| משתמש במחברים | לא | לא |
| שולט בדפדפן | לא | לא |
ממצאי הסריקה
נבדק ב-13 בנוב׳ 2026
- בינוניתקובץ · סקריפט הרצה שמגיע עם הסקילscripts/analyst.py
- מידעקישור · קישורים לדומיינים חיצוניים
סריקה נקייה מורידה את הסיכון, אבל לא מוכיחה שהחבילה בטוחה. כדאי לקרוא מה מתקינים.
| גרסה | פורסמה | Commit | SHA-256 | חתימה | שינוי בהרשאות |
|---|---|---|---|---|---|
| v1.0.0 | 13 בנוב׳ 2026 | da7600a | b1536550 | חתומה | – |
עוד מ-meltedinhex
הכול מהמפרסם הזה- writing-yara-rules-from-reversed-codemeltedinhex/writing-yara-rules-from-reversed-code4
- validating-detections-with-atomic-testsmeltedinhex/validating-detections-with-atomic-tests4
- writing-suricata-and-snort-rulesmeltedinhex/writing-suricata-and-snort-rules3
- writing-sigma-detection-rulesmeltedinhex/writing-sigma-detection-rules3
עוד בקטגוריה מחקר עקיפות והתחמקות
לקטגוריהשאלו כל מה שהסקופ מאפשר.
יוצרים חשבון, מוסיפים קרדיטים ושואלים את השאלה הראשונה בצ׳אט או בטרמינל.
- 1/3
יצירת חשבון
פרטי או חברה. אפשר לעבור לחשבון חברה אחר כך בלי לאבד יתרה או מפתחות.
פרטיחברה - 2/3
הוספת קרדיטים
בכרטיס אשראי. תשלום לפי טוקן, בלי מנוי.
$5.00טעינה מינימלית - 3/3
שאלה ראשונה
בצ׳אט, או להתקין את ה-CLI ולהריץ notholy login בטרמינל.
$ notholy login