Skip to content

Commit

Permalink
Update offsets for v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fnr1r committed Jul 26, 2024
1 parent 5a7864b commit 82b39cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/criware/bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ pub type CriFnBinderHandle = u64;
#[skyline::from_offset(0x8a92d0)]
pub fn get_binder_handle() -> CriFnBinderHandle;

#[skyline::from_offset(0x1302710)]
// Old offset: 0x1302710
#[skyline::from_offset(0x1302150)]
pub fn crifsbinder_bind_directory(binder: CriFnBinderHandle, src_binder: *const u8, path: *const u8, work: *const u8, work_size: i32, bind_id: &mut u32) -> i32;

pub fn bind_directory<P: AsRef<Utf8Path>>(binder_handle: CriFnBinderHandle, path: P) -> Result<u32, DirBindingError> {
Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ macro_rules! reg_x {
};
}

#[skyline::hook(offset = 0x1025e3c, inline)]
// Old offset: 0x1025e3c
#[skyline::hook(offset = 0x102603c, inline)]
pub fn sixty_fps_hook(ctx: &mut InlineCtx) {
unsafe {
*ctx.registers[1].x.as_mut() = 0u64;
Expand All @@ -33,7 +34,8 @@ pub fn mount_directories(_: &InlineCtx) {
criware::bind::bind_directory(binder_hn, "app0:/CPK/BIND").unwrap();
}

#[skyline::hook(offset = 0x130a930)]
// Old offset: 0x130a930
#[skyline::hook(offset = 0x130ab30)]
pub fn load_file_hook(unk1: *const u8, binder: *const u8, filepath: *const u8, offset: u64, filesize: u64) -> i32 {
let filename = unsafe { CStr::from_ptr(filepath as _) };

Expand All @@ -42,7 +44,8 @@ pub fn load_file_hook(unk1: *const u8, binder: *const u8, filepath: *const u8, o
call_original!(unk1, binder, filepath, offset, filesize)
}

#[skyline::hook(offset = 0x12f0910, inline)]
// Old offset: 0x12f0910
#[skyline::hook(offset = 0x12f0b10, inline)]
pub fn print_criware_error(ctx: &InlineCtx) {
let message = unsafe { CStr::from_ptr(reg_x!(ctx, 1) as *const u8 as _) };

Expand Down

0 comments on commit 82b39cf

Please sign in to comment.