1

I made an iOS app that simply changes the background color when I tap the button. the goal is to change the color with Hopper. I successfully changed the color from blue to red but I cannot change from blue to green because the string "green" is bigger than "blue" so it's overlapping the next instruction:

enter image description here

enter image description here

enter image description here

enter image description here

So my question is what can I do ?

2
  • i don't know much about hopper, but I would try something like #00FF00 instead of colorgreen if that works
    – R4444
    Commented Apr 5, 2021 at 15:52
  • @R4444 thanks, tried but not working but the questions is more "can i expand the size of a string ?"
    – BtPython
    Commented Apr 6, 2021 at 20:02

1 Answer 1

1

In practice you can't make your existing space any bigger.

Find another place in memory. You'd also need to update all the code referencing "blueColor" to use your new space address. One such candidate space could be strings describing segment and sections for __TEXT and __text respectively in the Mach-O header. Both of them will be exactly 16 bytes (padded with zeroes).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.