Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Becker committed Dec 27, 2024
1 parent 72cdd83 commit c159acb
Show file tree
Hide file tree
Showing 3 changed files with 293 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crates/decompile/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub async fn decompile(args: DecompilerArgs) -> Result<DecompileResult, Error> {

// find all the function selectors in the bytecode
let start_selectors_time = Instant::now();
let selectors = find_function_selectors(&evm);
let selectors = find_function_selectors(&contract_bytecode);
debug!("finding function selectors took {:?}", start_selectors_time.elapsed());

// resolve selectors (if enabled)
Expand Down
4 changes: 2 additions & 2 deletions crates/vm/src/ext/exec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ impl Vm {
pub fn symbolic_exec_selector(
&mut self,
selector: &str,
entry_point: u128,
entry_point: usize,
timeout: Instant,
) -> Result<(VMTrace, u32)> {
self.calldata = decode_hex(selector)?;

// step through the bytecode until we reach the entry point
while self.bytecode.len() >= self.pc as usize && (self.pc <= entry_point) {
while self.bytecode.len() >= self.pc as usize && (self.pc as usize <= entry_point) {
self.step()?;

// this shouldn't be necessary, but it's safer to have it
Expand Down
Loading

0 comments on commit c159acb

Please sign in to comment.