mnemonikr / symbolic-pcode

Apache License 2.0
0 stars 0 forks source link

Added support for branch instruction #51

Closed mnemonikr closed 1 year ago

mnemonikr commented 1 year ago

This change required refactoring the address offset used in Sleigh from usize to u64. This was likely a poor decision to begin with, since on 32-bit architectures the choice of usize could result in information loss outright. If however usize were larger, e.g. u128, then the offset conversion would fail to preserve negative offset information. Forcing the interpretation of this value as i64 felt awkward, whereas if its a u64 then an i64 interpretation is natural.

It also required changing the return type for the emulate function to handle branching to both absolute machine addresses as well as p-code relative offsets. This enum also supports the concept of conditional branching, which will be used by the CBRANCH instruction.

Closes #9