
BeaEngine es una biblioteca C diseñada para decodificar instrucciones de 16 bits, 32 bits y 64 bits Intel Architectures. Incluye instrucciones estándar establecidas e instrucciones establecidas desde FPU, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, VMX, CLMUL, AES, MPX, AVX, AVX2, AVX512 (VEX y EVEX PREFIXES), CET, BMI1, BMI2, SGX, UINTR, KL, TDX, AMX, AMX), TDX, TDX) extensiones. Si desea analizar los códigos maliciosos y los códigos más generalmente ofuscados, Beaengine envía una estructura compleja que describe con precisión las instrucciones analizadas.
Puede usarlo en C/C ++ (utilizable y compilable con Visual Studio, GCC, MingW, DigitalMars, Borlandc, Watcomc, Sunforte, Pelles C, LCC), en Assembler (utilizable con MASM32 y MASM64, NASM, FASM, GOASM) en C#, en Python3, en Delphi, en PureBasic y en En Windev. Puede usarlo en modo de usuario y en modo kernel.
Primero, puede recuperar mnemónico y operandos de acuerdo con la sintaxis especificada: sintaxis Intel para NASM, MASM32 y MASM64, Goasm32 y Goasm64, Fasm (sin sintaxis AT&T en realidad). A continuación, puede realizar un análisis preciso sobre el flujo de datos y el flujo de control para generar cortes u patrones de ofuscación.
Su código fuente está bajo la licencia LGPL3 con un "Makefile Builder" y encabezados para los siguientes idiomas: C/C ++, C#, Python3, Delphi, PureBasic, MASM32, MASM64, NASM (X86 y X64), Fasm (x86 y x64), Goasm (X86 y X64).
BeaEngine se implementa utilizando tablas Opcode de la documentación Intel, tablas del sitio web de Christian Ludloff www.sandpile.org y Project X86Doc de Felix Cloutier https://www.felixcloutier.com
Este software se distribuye bajo la licencia LGPL. Consulte la copia y la copia. Los archivos sin más para más detalles.
#!/usr/bin/python3
from BeaEnginePython import *
instr = Disasm(bytes.fromhex('6202054000443322'))
instr.read()
print(instr.repr())
La salida es:
vpshufb zmm24, zmm31, zmmword ptr [r11+r14+0880h]
rax : #!/usr/bin/python3
from BeaEnginePython import *
buffer = bytes.fromhex('4831c04889fbffc04989c49031ed66586a005f80c40c')
instr = Disasm(buffer)
while instr.read() > 0:
if instr.modifies("rax"):
print(f"{instr.repr():20}rax register is modified")
else:
print(instr.repr())
La salida es:
xor rax, rax rax register is modified
mov rbx, rdi
inc eax rax register is modified
mov r12, rax
nop
xor ebp, ebp
pop ax rax register is modified
push 00000000h
pop rdi
add ah, 0Ch rax register is modified
#!/usr/bin/python3
from BeaEnginePython import *
instr = Disasm(bytes.fromhex('e90000000090e901000000cc90'))
while instr.read() > 0:
print(instr.repr())
if instr.is_jump():
instr.follow()
Extraemos la estructura de instrucción completa:
#!/usr/bin/python3
from BeaEnginePython import *
instr = Disasm(bytes.fromhex('62017d8115443322'))
instr.read()
print(instr.json())
La salida es:
{
"repr": "vunpckhpd xmm24, xmm16, xmmword ptr [r11+r14+0220h]",
"category": "AVX512_INSTRUCTION",
"mnemonic": "vunpckhpd ",
"bytes": "62 01 7d 81 15 44 33 22",
"error": 0,
"arch": 64,
"operands": {
"1": {
"repr": "xmm24",
"type": "register",
"size": 128,
"mode": "write",
"register": {
"type": "xmm",
"value": "REG24"
}
},
"2": {
"repr": "xmm16",
"type": "register",
"size": 128,
"mode": "read",
"register": {
"type": "xmm",
"value": "REG16"
}
},
"3": {
"repr": "r11+r14+0220h",
"type": "memory",
"size": 128,
"mode": "read",
"memory": {
"base": "REG11",
"index": "REG14",
"scale": 1,
"displacement": "0x22"
}
}
},
"registers": {
"modified": {
"type": 4,
"gpr": "",
"mmx": "",
"xmm": "REG24",
"ymm": "",
"zmm": "",
"special": "",
"cr": "",
"dr": "",
"mem_management": "",
"mpx": "",
"opmask": "",
"segment": "",
"fpu": "",
"tmm": ""
},
"read": {
"type": 5,
"gpr": "REG11+REG14",
"mmx": "",
"xmm": "REG16",
"ymm": "",
"zmm": "",
"special": "",
"cr": "",
"dr": "",
"mem_management": "",
"mpx": "",
"opmask": "",
"segment": "",
"fpu": "",
"tmm": ""
}
},
"rflags": {
"of": null,
"sf": null,
"zf": null,
"af": null,
"pf": null,
"cf": null,
"tf": null,
"if": null,
"df": null,
"nt": null,
"rf": null
}
}
https://github.com/beaengine/beaengine/releases
apt install cmake
git clone https://github.com/BeaEngine/beaengine.git
cmake beaengine
make
cmake -DoptBUILD_DLL=ON beaengine
make
La documentación actual aquí explica cómo están las estructuras de trabajo de BeaEngine.
La documentación anterior se puede leer aquí: http://beatrix2004.free.fr/beaengine/index1.php
Cada lanzamiento de BeaEngine está provisto de documentación PDF:
sudo apt install pandoc texlive-latex-extra
cd doc
pandoc --highlight-style tango -V mainfont="Arial" -V geometry:margin=1cm --output=beaengine.pdf beaengine.md
pandoc --highlight-style tango -V mainfont="Arial" -V geometry:margin=1cm --output=examples.pdf examples.md
Algunos ejemplos básicos para mostrar cómo BeaEngine está trabajando aquí
Si desea mejorar BeaEngine o simplemente agregar algunas características privadas, aquí hay algunos enlaces: