-
-
Notifications
You must be signed in to change notification settings - Fork 472
Description
[1] The fully decoded instruction byte count is reported 1128 bytes on my build environment
[2] This big decoded instruction size makes infeasible to fully decompile some real world EXE files into memory.,
For example, Unreal Engine 4 sample game has more than 10,000,000 instructions.
If we fully decode those with Zydis and store it in memory, we end up spending 11280000000 bytes, which is more than 11 GB.
[3] The decoded instruction structure can have some weight loses. It might be a low hanging fruit.
[4] Workaround
I was forced to discard decoded instructions, and then only keep Block Entry addresses
and whenever I need decoded instruction info, I re-decoded the block fully.
However this caused significant dev cost and performance losses.
[5] For reference:
Iced claims that they have 40 bytes of decoded instruction size https://github.com/icedland/iced/tree/master/src/rust/iced-x86
{
constexpr unsigned long total_size_of_fully_decoded_instruction = sizeof(ZydisDecodedInstruction) + sizeof(ZydisDecodedOperand) * ZYDIS_MAX_OPERAND_COUNT;
printf("total_size_of_fully_decoded_instruction: %d bytes\n", total_size_of_fully_decoded_instruction);
// prints 1128 bytes
}