defeating-control-flow-flattening
Defeats control-flow-flattening obfuscation by identifying the dispatcher/state-
v1.0.03 установки+3 за 7 дней24 ЗвездыApache-2.0синхронизировано 10 часов назад
Установка
Ещё нет NotHoly CLI? Сначала установите её.
$ 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ПроверкаСредний2 замечания
- Исполняемый скрипт в составе навыка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
- ИнфоСсылка · Ссылки на внешние домены
Чистая проверка снижает риск, но не доказывает, что пакет безопасен. Читайте то, что ставите.
| Версия | Опубликована | Коммит | 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