Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Detour write packet routine:
- void hooked_wp_func_proxy() __attribute__ ((naked));
- void hooked_wp_func_proxy()
- {
- __asm__
- (
- "stdu 1, -0x70(1);"
- "mfspr 0, %lr;"
- "std 0, 0x80(1);"
- "lis 11, 0x3E;"
- "addi 11, 11, 0x05F8;"
- "mtspr %ctr, 11;"
- "bctrl;"
- );
- wp_detour();
- __asm__
- (
- "ld 0, 0x80(1);"
- "mtspr %lr, 0;"
- "addi 1, 1, 0x70;"
- "blr;"
- );
- }
- Proxy:
- void wp_detour()
- {
- Client * client = client_get();
- if (client == NULL) return;
- CGame * cgame = cgame_get();
- if (cgame == NULL) return;
- CCommand * cur = &client->input.commands[client->input.currentIdx & 0x7F];
- CCommand * old = &client->input.commands[(client->input.currentIdx - 1) & 0x7F];
- if (hasAutoAimTarget)
- {
- old->viewAngles[0] = cur->viewAngles[0] + ANGLE2SHORT(autoAimTargetAngles[0]);
- old->viewAngles[1] = cur->viewAngles[1] + ANGLE2SHORT(autoAimTargetAngles[1]);
- old->time++;
- }
- if (autoShootOn && autoAimReadyToShoot)
- {
- old->buttons &= ~CMD_MASK_FIRE;
- cur->buttons |= CMD_MASK_FIRE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement