Skip to content

How to tell friend from foe

tomvita edited this page Apr 17, 2023 · 3 revisions
  • Quite often code reuse cause the code that targets Friend to also targets Foe.
  • When you can't find an alternative that only target one or the other a method to tell friend or foe is needed

Look at the value of X30

Some times the X30 is distinct between friend or foe. First enable X30 match to see if the access is now distinct between friend or foe. If it is then job done and can proceed to make ASM hack with X30 match

Look at return address on the stack

WIP

Look at the pattern around the data value

There isn't a generic way, the guess may turn out to be no good at some stage of the game