Code Monkey home page Code Monkey logo

auby's Introduction

Auby

Open Source & JB-free mods for Geometry Dash

How hooks work

gdFunc:
  mov x11, x30 ; backup original link register
  bl trampoline

trampoline:
  ldr x9, =0x2
  lsl x9, x9, #32
  ldr x10, =0x80000000
  orr x9, x9, x10
  ldr x9, [x9]
  br x9 ; jump to 0x280000000
void *findTheHook() {
  void *target;
  asm("mov %[t], x16" : [t] "=r"(target));
  // now target contains [base + offset]
}

__attribute__((naked)) void findTheHookProxy() {
  asm volatile("mov x12, x0\n" // backup args
               "mov x13, x1\n"
               "mov x14, x2\n"
               "mov x15, x3\n"
               "mov x17, x4\n"
               "sub x30, x30, 8\n"
               "mov x16, x30\n"
               "bl %[findTheHook]\n" // find the hook
               "mov x30, x11\n" // restore x30 (fix ret)
               "mov x9, x0\n" // restore args
               "mov x0, x12\n"
               "mov x1, x13\n"
               "mov x2, x14\n"
               "mov x3, x15\n"
               "mov x4, x17\n"
               "br x9\n" ::[findTheHook] "i"(findTheHook));
}

void init() {
  *((void**)0x280000000) = (void*)&findTheHookProxy;
}

Important

Clang optimization breaks auby, so #pragma clang optimize off is required

Discord

https://discord.gg/kAUjNCEYcC

auby's People

Contributors

partur-dev avatar

Stargazers

zstardustttt avatar Fire avatar  avatar

Watchers

 avatar

auby's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.