You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In sleighexample.cc, it is able to read in a binary program and emulate it. However, instead of a program itself, I am looking to modify the example to take in a series of user defined instructions instead. My motivation is that I want to abstract away the need for a user to know the exact binary representation of an instruction sequence in order to use this modified version of sleighexample. Does anyone have any guidance on how I can go about doing this?
What I am aiming for:
Given a base starting state (E.g. All registers set to 0).
Read in a list of instructions. (E.g. ["LEA ECX, [ESP + 0x4]", "AND ESP, 0xfffffff0"])
Emulate the instructions.
Output modified state after emulation to the user.
I figured that Sleigh::resolve is the key function that translates an address to its corresponding AST representation before Sleighbuilder is used to convert it into pcode that can be emulated. But I am stuck at finding a way to modify Sleigh::resolve to work using plaintext instructions rather than an address in a binary.
This discussion was converted from issue #8464 on August 28, 2025 17:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In sleighexample.cc, it is able to read in a binary program and emulate it. However, instead of a program itself, I am looking to modify the example to take in a series of user defined instructions instead. My motivation is that I want to abstract away the need for a user to know the exact binary representation of an instruction sequence in order to use this modified version of sleighexample. Does anyone have any guidance on how I can go about doing this?
What I am aiming for:
["LEA ECX, [ESP + 0x4]", "AND ESP, 0xfffffff0"]
)I figured that
Sleigh::resolve
is the key function that translates an address to its corresponding AST representation beforeSleighbuilder
is used to convert it into pcode that can be emulated. But I am stuck at finding a way to modifySleigh::resolve
to work using plaintext instructions rather than an address in a binary.Appreciate any advice!
Beta Was this translation helpful? Give feedback.
All reactions