2020-04-08 04:21:52 +00:00
|
|
|
#![no_std]
|
2020-04-08 10:28:33 +00:00
|
|
|
#![feature(proc_macro_hygiene)]
|
2020-04-08 04:21:52 +00:00
|
|
|
|
2020-04-09 02:39:10 +00:00
|
|
|
use skyline::hook;
|
2020-04-08 10:28:33 +00:00
|
|
|
|
|
|
|
#[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 04:21:52 +00:00
|
|
|
pub fn main() {
|
2020-04-08 05:13:06 +00:00
|
|
|
println!("Hello from Skyline Rust Plugin!\n");
|
2020-04-08 04:21:52 +00:00
|
|
|
|
2020-04-08 05:13:06 +00:00
|
|
|
for i in 0..3 {
|
|
|
|
println!("{}", i);
|
2020-04-08 04:21:52 +00:00
|
|
|
}
|
2020-04-08 10:28:33 +00:00
|
|
|
|
2020-04-09 02:39:10 +00:00
|
|
|
for hook in skyline::iter_hooks() {
|
|
|
|
println!("hook: {}", hook.info.fn_name);
|
|
|
|
}
|
2020-04-08 04:21:52 +00:00
|
|
|
}
|