bitdefender / bddisasm

bddisasm is a fast, lightweight, x86/x64 instruction decoder. The project also features a fast, basic, x86/x64 instruction emulator, designed specifically to detect shellcode-like behavior.
Apache License 2.0
888 stars 115 forks source link

ND_INS_CPUID // Can provide external setting value? #73

Closed icyfox168168 closed 2 years ago

icyfox168168 commented 2 years ago

In this structure SHEMU_CONTEXT sets the CPUID value

vlutas commented 2 years ago

I could expose a new callback, similar to ShemuMemAccess, which - when set - would be called by the shemu engine on CPUID emulation. The callback implementation would then return the appropriate result in the EAX, ECX, EDX and EBX registers.

icyfox168168 commented 2 years ago

Very nice, can be written as a generic callback? It can also be suitable for other assembly instructions that do not support