From 992c304f107b341e3f6247a6fcddddd9e6a15f39 Mon Sep 17 00:00:00 2001 From: Maxim Andreev Date: Mon, 11 Nov 2024 13:26:13 +0000 Subject: [PATCH] selectors: add private selectors_with_pc --- src/selectors/mod.rs | 50 +++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/src/selectors/mod.rs b/src/selectors/mod.rs index f77986d..967c089 100644 --- a/src/selectors/mod.rs +++ b/src/selectors/mod.rs @@ -6,8 +6,8 @@ use crate::evm::{ U256, VAL_0_B, VAL_1_B, }; use crate::Selector; -use alloy_primitives::uint; -use std::collections::BTreeSet; +use alloy_primitives::{uint, hex}; +use std::collections::BTreeMap; mod calldata; use calldata::CallDataImpl; @@ -17,13 +17,14 @@ enum Label { CallData, Signature, MulSig, + SelCmp(Selector, bool), } const VAL_FFFFFFFF_B: [u8; 32] = uint!(0xffffffff_U256).to_be_bytes(); fn analyze( vm: &mut Vm, - selectors: &mut BTreeSet, + selectors: &mut BTreeMap, ret: StepResult