Skip to content

Commit

Permalink
fix for stripped binary
Browse files Browse the repository at this point in the history
  • Loading branch information
lapla-cogito committed Oct 7, 2024
1 parent c55c009 commit 8972b42
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/obfus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,13 @@ impl Obfuscator {
String::from_utf8_lossy(&obfus.input[section_addr..section_addr + section_size])
.to_string();

let (section_addr, section_size, _, _) = obfus.get_section(".strtab").unwrap();
obfus.string_table =
String::from_utf8_lossy(&obfus.input[section_addr..section_addr + section_size])
.to_string();
let (section_addr, section_size, _, _) =
obfus.get_section(".strtab").unwrap_or((0, 0, 0, 0));
if section_addr != 0 && section_size != 0 {
obfus.string_table =
String::from_utf8_lossy(&obfus.input[section_addr..section_addr + section_size])
.to_string();
}

Ok(obfus)
}
Expand Down

0 comments on commit 8972b42

Please sign in to comment.