Results 1 to 10 of 12

Thread: Example of Self modifying ASM code :P

Hybrid View

  1. #1

    Default

    I think his code adds 100 bells to your current amount until you reach 99,000. After that, the code subtracts 100 bells until you get to 100 bells then it adds back up to 99,000 bells and keeps repeating itself.
    3DS Friend Code: 4699-6293-3106

  2. #2
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    In regular ARM mod, you could just the pc to overwrite any instruction. In THUMB it says it's not allowed (cause the pc is r15)
    (the pc stands for program counter, it basically tells where the next instruction to be executed is)
    In ARM everything is 32 bit though, including the instructions, so it'd take up more room, but it's definitely more powerful.
    Like, let's say in ARM you wanted to overwrite the very next instruction. Let's say r5 has the instruction you wanna write. To overwrite the very next instruction you'd put....
    str r5, [pc, #-0x4]

    to overwrite the instruction after that instead
    str r5, [pc]
    etc.
    Always willing to help with anything, code-related or not. :]

  3. #3
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default

    I don't know about "self-modifying". Makes it sound like polymorphism. It's more like an ASM switch case.
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

  4. #4
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Quote Originally Posted by Vash View Post
    I don't know about "self-modifying". Makes it sound like polymorphism. It's more like an ASM switch case.
    Well, it might not be exactly, but...
    according to wikipedia
    "In computer science, self-modifying code is code that alters its own instructions while it is executing."
    and that alters a single instruction while executing XD (it directly overwrites an "add" instruction with a "subtract" instruction, or vice versa)
    Although I'm probably wrong, you're the more advanced hacker.
    Always willing to help with anything, code-related or not. :]

  5. #5

    Default

    Self modifying suggest to me that it actively changes it's own base level instructions, i.e. I could put it in - run it and then go and look at it later and it would have changed - this is obviously impossible as the instructions are stored on your ARDS

    Remember to always click the thanks button of those who help you! It makes them feel wanted:

  6. #6

    Default

    It's a neat idea though, it almost has a "mind" to where it knows when to change action.

    Better watch out. One of these days your codes will start modifying themselves to the point where your DS comes self-aware. The world is in danger when your DS suddenly flares to life and declares it supreme to mankind. Resistance is futile.

  7. #7
    Member
    Join Date
    Aug 2008
    Location
    Vancouver, Washington
    Posts
    226

    Default

    Quote Originally Posted by yoshisrock View Post
    It's a neat idea though, it almost has a "mind" to where it knows when to change action.

    Better watch out. One of these days your codes will start modifying themselves to the point where your DS comes self-aware. The world is in danger when your DS suddenly flares to life and declares it supreme to mankind. Resistance is futile.
    I don't agree with this theory. Technology will never run the world. Even if it did, we would be too busy to care anyways.
    Also, i lol'd.
    I Lost the Game.

    -Lord Was

  8. #8
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Quote Originally Posted by yoshisrock View Post
    It's a neat idea though, it almost has a "mind" to where it knows when to change action.

    Better watch out. One of these days your codes will start modifying themselves to the point where your DS comes self-aware. The world is in danger when your DS suddenly flares to life and declares it supreme to mankind. Resistance is futile.
    XD well, it only modifies itself where and when I tell it to, so, technically it's still only doing what I say. If I told it "modify your code whenever you want and however you want" then it would have a mind of its own, but that's not really possible yet.

    And it does permanently change the instruction, at least until you either change it back or turn off your DS. It doesn't modify it on the actual AR though.
    Always willing to help with anything, code-related or not. :]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •