1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-20 00:46:34 +00:00

13.0.3 support (#705)

* Fix some offsets, update deps

* Update dependencies

* Update offset comments
This commit is contained in:
asimon-1 2024-10-13 12:51:18 -07:00 committed by GitHub
parent 83cd079352
commit 7c271256a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 39 additions and 147 deletions

View file

@ -56,7 +56,7 @@ jobs:
cache-all-crates: true
- name: Install Skyline
run: |
cargo install cargo-skyline
cargo install --git https://github.com/Raytwo/cargo-skyline --branch std-change --force
cargo-skyline skyline update-std
- name: Build release NRO
id: build_release
@ -82,7 +82,7 @@ jobs:
cache-all-crates: true
- name: Install Skyline
run: |
cargo install cargo-skyline
cargo install --git https://github.com/Raytwo/cargo-skyline --branch std-change --force
cargo-skyline skyline update-std
- name: Build outside_training_mode NRO
run: RUSTFLAGS=-g cargo-skyline skyline build --release --features outside_training_mode
@ -107,7 +107,7 @@ jobs:
run: |
mkdir -p ${{env.SMASH_PLUGIN_DIR}}
cp plugin/libtraining_modpack.nro ${{env.SMASH_PLUGIN_DIR}}/libtraining_modpack.nro
wget https://github.com/ultimate-research/params-hook-plugin/releases/download/v13.0.1/libparam_hook.nro
wget https://github.com/ultimate-research/params-hook-plugin/releases/download/v13.0.3/libparam_hook.nro
wget https://github.com/ultimate-research/nro-hook-plugin/releases/download/v0.4.0/libnro_hook.nro
cp libparam_hook.nro ${{env.SMASH_PLUGIN_DIR}}/libparam_hook.nro
cp libnro_hook.nro ${{env.SMASH_PLUGIN_DIR}}/libnro_hook.nro

View file

@ -9,7 +9,7 @@ crate-type = ["cdylib"]
[dependencies]
skyline = { git = "https://github.com/ultimate-research/skyline-rs.git" }
skyline_smash = { git = "https://github.com/jugeeya/skyline-smash.git", branch = "patch-2" }
skyline_smash = { git = "https://github.com/asimon-1/skyline-smash.git", branch = "13.0.3" }
skyline-web = { git = "https://github.com/skyline-rs/skyline-web.git" }
bitflags = "1.2.1"
parking_lot = { version = "0.12.0", features = ["nightly"] }
@ -46,6 +46,7 @@ native-tls = { git = "https://github.com/skyline-rs/rust-native-tls", branch = "
nnsdk = { git = "https://github.com/ultimate-research/nnsdk-rs" }
rand = { git = "https://github.com/skyline-rs/rand" }
getrandom = { git = "https://github.com/Raytwo/getrandom" }
skyline = { git = "https://github.com/ultimate-research/skyline-rs.git" }
[profile.dev]
panic = "abort"

106
link.ld
View file

@ -1,106 +0,0 @@
OUTPUT_FORMAT(elf64-littleaarch64)
OUTPUT_ARCH(aarch64)
ENTRY(_start)
PHDRS
{
text PT_LOAD FLAGS(5);
rodata PT_LOAD FLAGS(4);
data PT_LOAD FLAGS(6);
bss PT_LOAD FLAGS(6);
dynamic PT_DYNAMIC;
}
SECTIONS
{
. = 0;
.text : ALIGN(0x1000) {
HIDDEN(__text_start = .);
*(.nro_header)
KEEP(*(.text.jmp))
. = 0x80;
*(.text .text.*)
*(.plt .plt.*)
HIDDEN(__text_end = .);
} :text
/* Read-only sections */
. = ALIGN(0x1000);
.module_name : { KEEP (*(.rodata.module_name)) } :rodata
.hooks : {
__hook_array_start = .;
*(.rodata.hooks)
__hook_array_end = .;
} :rodata
.rodata : {
*(.rodata .rodata.*)
} :rodata
.mod0 : {
KEEP(crt0.nso.o(.data.mod0))
KEEP(crt0.nro.o(.data.mod0))
KEEP(crt0.lib.nro.o(.data.mod0))
}
.hash : { *(.hash) }
.dynsym : { *(.dynsym .dynsym.*) }
.dynstr : { *(.dynstr .dynstr.*) }
.rela.dyn : { *(.rela.dyn) }
.eh_frame : ONLY_IF_RO {
HIDDEN(__eh_frame_start = .);
KEEP (*(.eh_frame)) *(.eh_frame.*)
HIDDEN(__eh_frame_end = .);
}
.eh_frame_hdr : {
HIDDEN(__eh_frame_hdr_start = .);
*(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*)
HIDDEN(__eh_frame_hdr_end = .);
}
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
.gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
/* Read-write sections */
. = ALIGN(0x1000);
.data : {
*(.data .data.*)
*(.got .got.*)
*(.got.plt .got.plt.*)
} :data
.eh_frame : ONLY_IF_RW {
HIDDEN(__eh_frame_start = .);
KEEP (*(.eh_frame)) *(.eh_frame.*)
HIDDEN(__eh_frame_end = .);
}
.gnu_extab : ONLY_IF_RW { *(.gnu_extab*) }
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
.dynamic : {
HIDDEN(__dynamic_start = .);
*(.dynamic)
}
/* BSS section */
. = ALIGN(0x1000);
.bss : {
HIDDEN(__bss_start = .);
*(.bss .bss.*)
*(COMMON)
HIDDEN(__nx_module_runtime = .);
*(.bss.module_runtime)
. = ALIGN(8);
HIDDEN(__bss_end = .);
} :bss
}

View file

@ -104,7 +104,7 @@ static NEEDLE_SET_CPU_CONTROLS: &[u8] = &[
];
impl_offset!(SET_CPU_CONTROLS);
// OFFSET_ADD_DAMAGE = 0x3ff9a0
// OFFSET_ADD_DAMAGE = 0x3ff9c0
static NEEDLE_ADD_DAMAGE: &[u8] = &[
0x08, 0x20, 0x20, 0x1e,
0x8d, 0x00, 0x00, 0x54,
@ -114,7 +114,7 @@ static NEEDLE_ADD_DAMAGE: &[u8] = &[
];
impl_offset!(ADD_DAMAGE);
// OFFSET_CHANGE_ACTIVE_CAMERA = 0x4ee460
// OFFSET_CHANGE_ACTIVE_CAMERA = 0x4ee480
static NEEDLE_CHANGE_ACTIVE_CAMERA: &[u8] = &[
0xff, 0x03, 0x02, 0xd1,
0xf8, 0x5f, 0x04, 0xa9,
@ -127,15 +127,14 @@ static NEEDLE_CHANGE_ACTIVE_CAMERA: &[u8] = &[
];
impl_offset!(CHANGE_ACTIVE_CAMERA);
// OFFSET_SET_TRAINING_FIXED_CAMERA_VALUES = 0x3158830 (old: 0x3157bb0)
// static NEEDLE_SET_TRAINING_FIXED_CAMERA_VALUES: &[u8] = &[
// 0x01, 0xe4, 0x00, 0x2f,
// 0x20, 0x00, 0xc0, 0x3d,
// 0x22, 0x1c, 0xa1, 0x4e,
// 0x02, 0x44, 0x04, 0x6e,
// ];
// impl_offset!(SET_TRAINING_FIXED_CAMERA_VALUES);
// OFFSET_SET_TRAINING_FIXED_CAMERA_VALUES = 0x3158850
static NEEDLE_SET_TRAINING_FIXED_CAMERA_VALUES: &[u8] = &[
0x01, 0xe4, 0x00, 0x2f,
0x20, 0x00, 0xc0, 0x3d,
0x22, 0x1c, 0xa1, 0x4e,
0x02, 0x44, 0x04, 0x6e,
];
impl_offset!(SET_TRAINING_FIXED_CAMERA_VALUES);
// OFFSET_DRAW = 0x4b620
static NEEDLE_DRAW: &[u8] = &[
@ -150,7 +149,7 @@ static NEEDLE_DRAW: &[u8] = &[
];
impl_offset!(DRAW);
// OFFSET_CLOUD_ADD_LIMIT = 0x8dc140
// OFFSET_CLOUD_ADD_LIMIT = 0x8dc160
static NEEDLE_CLOUD_ADD_LIMIT: &[u8] = &[
0xff, 0x03, 0x03, 0xd1,
0xe9, 0x23, 0x05, 0x6d,
@ -173,7 +172,7 @@ impl_offset!(CLOUD_ADD_LIMIT);
// OFFSET_STALE_MENU = 0x13e88c0
static NEEDLE_STALE_MENU: &[u8] = &[
0xdf, 0x82, 0x2d, 0x39,
0xab, 0x43, 0x8e, 0x94,
0xb3, 0x43, 0x8e, 0x94,
0x00, 0x1d, 0xa8, 0x4e,
0xc0, 0xa2, 0x06, 0x91,
];
@ -182,7 +181,7 @@ impl_offset!(STALE_MENU);
// IMPORTANT! See above comment for STALE_MENU
// OFFSET_STALE = 0x13e88c4
static NEEDLE_STALE: &[u8] = &[
0xab, 0x43, 0x8e, 0x94,
0xb3, 0x43, 0x8e, 0x94,
0x00, 0x1d, 0xa8, 0x4e,
0xc0, 0xa2, 0x06, 0x91,
0xdf, 0x22, 0x2f, 0x39,
@ -190,7 +189,7 @@ static NEEDLE_STALE: &[u8] = &[
impl_offset!(STALE);
// todo!(Can we remove this and replace with SoundModule::play_se()?)
// OFFSET_PLAY_SE = 0x4cf6a0
// OFFSET_PLAY_SE = 0x4cf6c0
static NEEDLE_PLAY_SE: &[u8] = &[
0xa8, 0x00, 0x00, 0x12,
0x9f, 0x00, 0x00, 0x72,
@ -202,7 +201,7 @@ static NEEDLE_PLAY_SE: &[u8] = &[
];
impl_offset!(PLAY_SE);
// OFFSET_CAN_FUTTOBI_BACK = 0x260f950
// OFFSET_CAN_FUTTOBI_BACK = 0x26105f0
static NEEDLE_CAN_FUTTOBI_BACK: &[u8] = &[
0x00, 0x07, 0x00, 0xb4,
0x09, 0x04, 0x40, 0xf9,
@ -219,7 +218,7 @@ static NEEDLE_CAN_FUTTOBI_BACK: &[u8] = &[
];
impl_offset!(CAN_FUTTOBI_BACK);
// OFFSET_REUSED_UI = 0x68cd80
// OFFSET_REUSED_UI = 0x68cda0
static NEEDLE_REUSED_UI: &[u8] = &[
0xff, 0x43, 0x01, 0xd1,
0xf5, 0x13, 0x00, 0xf9,
@ -246,7 +245,7 @@ static NEEDLE_OPCF: &[u8] = &[
];
impl_offset!(OPCF);
// OFFSET_FIM = 0x17504a0
// OFFSET_FIM = 0x1750f70
static NEEDLE_FIM: &[u8] = &[
0xff, 0x03, 0x02, 0xd1,
0xf7, 0x23, 0x00, 0xf9,
@ -259,7 +258,7 @@ static NEEDLE_FIM: &[u8] = &[
];
impl_offset!(FIM);
// OFFSET_SSS_TRAINING = 0x184d1d8
// OFFSET_SSS_TRAINING = 0x184dcc8
static NEEDLE_SSS_TRAINING: &[u8] = &[
0x9f, 0xe3, 0x0b, 0x39,
0x88, 0xbf, 0x0b, 0x39,
@ -270,7 +269,7 @@ static NEEDLE_SSS_TRAINING: &[u8] = &[
];
impl_offset!(SSS_TRAINING);
// OFFSET_GENERATE_ARTICLE_FOR_TARGET = 0x3d40a0
// OFFSET_GENERATE_ARTICLE_FOR_TARGET = 0x3d40c0
static NEEDLE_GENERATE_ARTICLE_FOR_TARGET: &[u8] = &[
0xf4, 0x4f, 0xbe, 0xa9,
0xfd, 0x7b, 0x01, 0xa9,
@ -281,7 +280,7 @@ static NEEDLE_GENERATE_ARTICLE_FOR_TARGET: &[u8] = &[
];
impl_offset!(GENERATE_ARTICLE_FOR_TARGET);
// OFFSET_KIRBY_OPFF = 0xb971b0
// OFFSET_KIRBY_OPFF = 0xb971d0
static NEEDLE_KIRBY_OPFF: &[u8] = &[
0xff, 0x43, 0x02, 0xd1,
0xfc, 0x6f, 0x03, 0xa9,
@ -298,7 +297,7 @@ static NEEDLE_KIRBY_OPFF: &[u8] = &[
];
impl_offset!(KIRBY_OPFF);
// OFFSET_ACTIVATE_AUTONOMY = 0x34b5cf0
// OFFSET_ACTIVATE_AUTONOMY = 0x34b6990
static NEEDLE_ACTIVATE_AUTONOMY: &[u8] = &[
0xf6, 0x57, 0xbd, 0xa9,
0xf4, 0x4f, 0x01, 0xa9,
@ -311,7 +310,7 @@ static NEEDLE_ACTIVATE_AUTONOMY: &[u8] = &[
];
impl_offset!(ACTIVATE_AUTONOMY);
// OFFSET_POKEMON_DECIDE = 0x34ce8e4
// OFFSET_POKEMON_DECIDE = 0x34ce904
static NEEDLE_POKEMON_DECIDE: &[u8] = &[
0x28, 0x69, 0x2b, 0x38,
0x48, 0x26, 0x8b, 0x52,
@ -320,15 +319,14 @@ static NEEDLE_POKEMON_DECIDE: &[u8] = &[
];
impl_offset!(POKEMON_DECIDE);
// // OFFSET_LAYOUT_ARC_MALLOC = 0x3773d54 (old: 0x37730d4)
// static NEEDLE_LAYOUT_ARC_MALLOC: &[u8] = &[
// 0xe3, 0xe6, 0x06, 0x94,
// 0xa0, 0x05, 0x00, 0xb4,
// 0xe1, 0x03, 0x15, 0xaa,
// 0xe2, 0x03, 0x17, 0xaa,
// ];
// impl_offset!(LAYOUT_ARC_MALLOC);
// OFFSET_LAYOUT_ARC_MALLOC = 0x3773d74
static NEEDLE_LAYOUT_ARC_MALLOC: &[u8] = &[
0xe3, 0xe6, 0x06, 0x94,
0xa0, 0x05, 0x00, 0xb4,
0xe1, 0x03, 0x15, 0xaa,
0xe2, 0x03, 0x17, 0xaa,
];
impl_offset!(LAYOUT_ARC_MALLOC);
// OFFSET_TRAINING_RESET_CHECK = 0x1378e50
static NEEDLE_TRAINING_RESET_CHECK: &[u8] = &[

View file

@ -8,7 +8,7 @@ use smash::phx::{Hash40, Vector3f};
use crate::common::consts::*;
use crate::common::offsets::OFFSET_CHANGE_ACTIVE_CAMERA;
//use crate::common::offsets::OFFSET_SET_TRAINING_FIXED_CAMERA_VALUES;
use crate::common::offsets::OFFSET_SET_TRAINING_FIXED_CAMERA_VALUES;
use crate::common::*;
use crate::training::{frame_counter, mash, save_states};
@ -730,7 +730,7 @@ fn get_stage_camera_values(stage_id: i32) -> Option<Vector3f> {
}
// We hook where the training fixed camera fields are initially set, so we can change them later if necessary
#[skyline::hook(offset = 0x3157bb0)] // TODO: Fix for 13.0.2
#[skyline::hook(offset = *OFFSET_SET_TRAINING_FIXED_CAMERA_VALUES)]
pub unsafe fn handle_set_training_fixed_camera_values(
camera_manager: *mut u64, // not actually camera manager - is this even used?????
fixed_camera_values: &mut CameraValuesForTraining,

View file

@ -6,8 +6,7 @@ use smash::ui2d::SmashTextBox;
use training_mod_consts::{OnOff, MENU};
use crate::common::menu::QUICK_MENU_ACTIVE;
//use crate::common::offsets::{OFFSET_DRAW, OFFSET_LAYOUT_ARC_MALLOC};
use crate::common::offsets::OFFSET_DRAW;
use crate::common::offsets::{OFFSET_DRAW, OFFSET_LAYOUT_ARC_MALLOC};
use crate::common::{is_ready_go, is_training_mode};
#[cfg(feature = "layout_arc_from_file")]
use crate::consts::LAYOUT_ARC_PATH;
@ -129,7 +128,7 @@ static mut LAYOUT_ARC: &mut [u8; LAYOUT_ARC_SIZE] = &mut [0u8; LAYOUT_ARC_SIZE];
/// label_material.set_white_res_color(LABEL_WHITE_SELECTED_COLOR);
/// label_material.set_black_res_color(LABEL_BLACK_SELECTED_COLOR);
/// ```
#[skyline::hook(offset = 0x3773d54, inline)] // TODO: Fix for 13.0.2
#[skyline::hook(offset = *OFFSET_LAYOUT_ARC_MALLOC, inline)]
unsafe fn handle_layout_arc_malloc(ctx: &mut skyline::hooks::InlineCtx) {
if !is_training_mode() {
return;