simple xor string data

This commit is contained in:
2024-08-29 15:23:50 +07:00
parent 083556f914
commit 1c495989d4
2 changed files with 25 additions and 13 deletions

View File

@ -772,7 +772,11 @@ func (mc *MachoContext) RemoveStrings() {
// this is a way to divert their effort, writing fake strings
// will be written again at runtime
dummy := make([]byte, edit_segment.Fileoff() - string_segment.Fileoff())
copy(dummy, []byte("We R BShield\n"))
mc.file.ReadAt(dummy, int64(cstring.Offset()))
// copy(dummy, []byte("We R BShield\n"))
for i := 0; i < len(dummy); i++ {
dummy[i] = dummy[i] ^ 0x4f
}
mc.file.WriteAt(dummy, int64(string_segment.Fileoff()))
// TODO: erase old strings