2020-04-08 00:21:52 -04:00
|
|
|
#![no_std]
|
2020-04-08 06:28:33 -04:00
|
|
|
#![feature(proc_macro_hygiene)]
|
2020-04-08 00:21:52 -04:00
|
|
|
|
2020-04-08 06:28:33 -04:00
|
|
|
use skyline::{hook, hooks};
|
|
|
|
|
|
|
|
#[hook(sym = "nn::fs::MountSaveData")]
|
|
|
|
fn test1(path: *const u8, user_id: u64) {
|
|
|
|
println!("user id: {}", user_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[hook(inline, offset = 0x71000030)]
|
|
|
|
fn test2(x: u32) -> u64 {
|
|
|
|
(x as u64) + 1
|
|
|
|
}
|
|
|
|
|
|
|
|
#[skyline::main]
|
2020-04-08 00:21:52 -04:00
|
|
|
pub fn main() {
|
2020-04-08 01:13:06 -04:00
|
|
|
println!("Hello from Skyline Rust Plugin!\n");
|
2020-04-08 00:21:52 -04:00
|
|
|
|
2020-04-08 01:13:06 -04:00
|
|
|
for i in 0..3 {
|
|
|
|
println!("{}", i);
|
2020-04-08 00:21:52 -04:00
|
|
|
}
|
2020-04-08 06:28:33 -04:00
|
|
|
|
|
|
|
hooks![test1, test2].install_hooks();
|
2020-04-08 00:21:52 -04:00
|
|
|
}
|