vtil-project / VTIL-Core

Virtual-machine Translation Intermediate Language
BSD 3-Clause "New" or "Revised" License
1.35k stars 163 forks source link

Hash problem in expression #61

Closed Tai7sy closed 2 years ago

Tai7sy commented 2 years ago

Test code liking this

auto exp_a = __bt( variable_a, (uint32_t)0x6 ).simplify(true);
auto exp_b = __bt( variable_a, (uint8_t)0x6 ).simplify(true);

the hash of exp_a and exp_b is different, but as a bittest, (uint32_t)0x6 and (uint8_t)0x6 should be same.

this will cause vm_jcc expression extract wrong destinations if a jcc expression contains both exp_a and exp_b. (when calcing destination of vm_jcc, using hash for compare expression, but hash is different) https://github.com/vtil-project/VTIL-Core/blob/bf80720098ea8d76dc679768f55d7351130e9fbc/VTIL-Compiler/common/auxiliaries.cpp#L381

mrexodia commented 2 years ago

Did you send a pull request for this?

Tai7sy commented 2 years ago

still testing, it sames some thing broken after changing in this way.