mnemonikr / symbolic-pcode

Apache License 2.0
0 stars 0 forks source link

Implement LoadImage on memory instead of emulator #78

Closed mnemonikr closed 8 months ago

mnemonikr commented 1 year ago

The emulator currently implements the LoadImage trait.

https://github.com/mnemonikr/pcode/blob/9694e9ba6563ce5cc328aa2d97d406a28db0516a/src/emulator.rs#L1039

This enables one to pass the emulator to Sleigh::pcode to load and decode instructions into pcode. Example:

https://github.com/mnemonikr/pcode/blob/9694e9ba6563ce5cc328aa2d97d406a28db0516a/tests/common/mod.rs#L142-L144

However it's not clear why we should be passing the emulator when we could be passing the memory -- or memory tree.

The implementation on the emulator does not reference anything related to the emulator; all of the calls are on the memory instance.