What exactly is Hook Type

Discussion in 'Wii - Backup Loaders' started by Crass, Nov 5, 2010.

Nov 5, 2010

What exactly is Hook Type by Crass at 5:40 PM (9,995 Views / 0 Likes) 5 replies

  1. Crass
    OP

    Member Crass Rock me Dr. Zaius

    Joined:
    Nov 3, 2006
    Messages:
    984
    Location:
    Oregon
    Country:
    United States
    I know its related to the Ocarina cheats, and that it has to do with when the cheats are initiated into the game code? But can anyone give a techincal answer to what exactly it means, and what the various options in CFG loader mean? Ive scrounged through google and the forum search to find a technical answer, but every thread is basically "I dont know what it means exactly, just that you have to change it sometimes to make cheats work with certain games". Instead of just blindly testing all the options, it would be nice knowing what each one does. Sorry if this has been answered before, its just hard to find the answer.
    The options listed in CFG loader are as follows:
    • No Hooks
    • VBI
    • Wii Pad
    • GC Pad
    • GXDraw
    • GXFlush
    • OSSleepThread
    • AXNextFrame
    Thanks in advance.
     
  2. terminal_illness

    Member terminal_illness Dark Hadou Master

    Joined:
    Aug 29, 2008
    Messages:
    746
    Location:
    Canada! Mah Fukas!
    Country:
    Canada
    ive always wondered this too...
     
  3. PPSainity

    Member PPSainity Blinded by Science

    Joined:
    Jun 6, 2009
    Messages:
    646
    Country:
    Canada
    Hook types are just known places in executing Wii code where you can place a "hook" that allows you to jump to your code and in this particular case, apply memory hack cheats. In example the first hook listed allows the Gecko OS to do it's thing during the Vertical Blanking Interval of the Wii's Video Output. Normally, this is a perfect place to be, but some games will crash or slow down if this hook is used hence the other options.

    That's the gist of it. Any real coder out there would probably explain hooks in a more "correct way" but I hope this gives you an idea.

    EDIT: Here's the WIKI article on HOOKING, keep you minds out of the gutter [​IMG]

    -[]D
     
    1 person likes this.
  4. Crass
    OP

    Member Crass Rock me Dr. Zaius

    Joined:
    Nov 3, 2006
    Messages:
    984
    Location:
    Oregon
    Country:
    United States
    Thanks for the quick reply, and the wikipedia link, I am still curious what the other hook types mean exactly.
     
    1 person likes this.
  5. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    usually they get their name from the function that they target. find a game with a .elf in the contents, open the elf in IDA, and search bytes of the hook. It should only find you 1 result in that elf, which should be the function that shares a similar name with the hooktype.


    interestingly enough, I wanted to take a screenshot of this to show you an example, and i accidentally found a little "error". here I was looking for the AXNextFrame hook. In the new wheel-of-fortune game, the function "__AXNextFrame" appears to be the target of the hook. But there are 2 instructions in the hook that are reversed in this game. So, if you revers the middle 2 instructions in this hook, you should be able to hook wheel of fortune, and some newer games with this hook.
    Warning: Spoilers inside!
     
    1 person likes this.
  6. terminal_illness

    Member terminal_illness Dark Hadou Master

    Joined:
    Aug 29, 2008
    Messages:
    746
    Location:
    Canada! Mah Fukas!
    Country:
    Canada
    awesome, thx for clearing that up pune. i really had no idea... also, i have never had to change the hook type. what are a few games that require a specific hook?
     
    1 person likes this.

Share This Page