Update switch finding code to find the correct one

This commit is contained in:
Flawed
2024-11-12 00:42:56 -08:00
parent ce8e2f5c4c
commit 4039ca24a0
3 changed files with 18 additions and 7 deletions
+3 -2
View File
@@ -4,7 +4,7 @@ import pathlib
from minor_patch_diff import (
get_opcode_offset,
get_longest_switch,
get_correct_switch,
get_zone_proto_down_sig,
)
@@ -163,7 +163,8 @@ def extract_opcode_data(exe_file):
fn_graph = r2.cmdj(f"pdrj")
## STEP 4: Process data
packet_handler_switch = get_longest_switch(switch_cases)
switch_ea, packet_handler_switch = get_correct_switch(packet_handler_ea, switch_cases)
eprint(f" Found switch at {switch_ea}")
opcodes_db, blocks = generate_opcodes_db(
r2, packet_handler_switch, opcode_offset, fn_graph