Skip to content

Commit

Permalink
Use dynamic offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
GradualSyrup committed Jan 28, 2024
1 parent 33fc7d4 commit 64e8983
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
15 changes: 14 additions & 1 deletion src/common/offsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,17 @@ static NEEDLE_LAYOUT_ARC_MALLOC: &[u8] = &[
0xc1, 0xb6, 0x40, 0xf9,
0xc2, 0x57, 0x00, 0xb0,
];
impl_offset!(LAYOUT_ARC_MALLOC);
impl_offset!(LAYOUT_ARC_MALLOC);

// OFFSET_TRAINING_RESET_CHECK = 0x1378e30
static NEEDLE_TRAINING_RESET_CHECK: &[u8] = &[
0x1f, 0x09, 0x00, 0x71,
0x41, 0x1c, 0x00, 0x54,
0xe8, 0xf9, 0x01, 0xf0,
0x08, 0x7d, 0x42, 0xf9,
0x08, 0x01, 0x40, 0xf9,
0x09, 0xa1, 0x40, 0xb9,
0x3f, 0x05, 0x00, 0x71,
0x2b, 0x0a, 0x00, 0x54,
];
impl_offset!(TRAINING_RESET_CHECK);
5 changes: 1 addition & 4 deletions src/training/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,8 @@ pub unsafe fn handle_add_damage(
}

// Control L+R+A Resets
// Toggling in menu for now, probably best for this to become a customizable button combo
static LRA_OFFSET: usize = 0x1378e30;

// This function already has a training mode check in it so we don't need to toggle in training mode for this
#[skyline::hook(offset = LRA_OFFSET, inline)]
#[skyline::hook(offset = *OFFSET_TRAINING_RESET_CHECK, inline)]
unsafe fn lra_handle(ctx: &mut InlineCtx) {
let x8 = ctx.registers[8].x.as_mut();
if !(MENU.lra_reset.as_bool()) {
Expand Down

0 comments on commit 64e8983

Please sign in to comment.