Skip to content

Instantly share code, notes, and snippets.

View jam1garner's full-sized avatar
🦀

jam1garner

🦀
View GitHub Profile
@jam1garner
jam1garner / switch-gdb-cheatsheet.md
Last active October 30, 2024 05:40
GDB for Switch Modding Cheatsheet/Tutorial

This is a mini-tutorial of sorts for getting started with gdb on the Switch, with the target audience being people who want to mod and/or reverse games, with no prerequisite knowledge of gdb. The goal will be to walk you through some of the basic workflows needed to use a debugger on the Switch, while being brief enough for skimming for when you forget things.

If some part is unclear, your OS doesn't have install instructions, or you feel part of your workflow should be added here, feel free to comment any additions.

(If you only need a quick reference Jump to the Appendix)

Installing GDB

First off you'll need a version of GDB compatible with aarch64. This can be obtained via either a distribution of

@jam1garner
jam1garner / Cargo.toml
Last active October 31, 2021 22:30
How to setup doc_cfg for Rust to document your cfg features (credit to benesch and mcarton on stackoverflow)
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
@jam1garner
jam1garner / README.md
Created September 21, 2021 01:54
A slightly better version of Rust attribute highlighting in vim

A vim script for making the Rust attribute highlighting a tiny bit better

Install

Neovim

Copy the file to '~/.config/nvim/after/syntax/rust.vim'

---
- id: 2
vols:
- 0.6000000238418579
- 0.20000000298023225
- 0.30000001192092898
- 0.30000001192092898
- 0.30000001192092898
- 0.30000001192092898
- 0.0
0 - dirt
1 - vertical oak log
2 - stone
3 - iron ore
4 - oak leaves
5 - grassy dirt block
6 - grassy dirt block (dry)
7 - grassy dirt block (taiga)
8 - snowy dirt block
9 - hay bail
@jam1garner
jam1garner / nnsdk_syms.txt
Last active September 21, 2020 00:05
list of exposed nnsdk symbols
This file has been truncated, but you can view the full file.
_init
_fini
__nnDetailNintendoSdkRuntimeObjectFileRefer
nndetailRoGetRoDataStart
nndetailRoGetRoDataEnd
android::IBinder::IBinder()
android::IBinder::~IBinder()
android::IBinder::~IBinder()
virtual thunk to android::IBinder::~IBinder()
android::IBinder::~IBinder()
@jam1garner
jam1garner / game.lua
Created June 28, 2020 22:07
A broken turnip for daisy
function game_Throw()
if sv_animcmd.is_excute() then
sv_animcmd.ATTACK(
0, 0, 0x31ED91FCA, WorkModule.get_int64(ITEM_DAISYDAIKON_INSTANCE_WORK_INT_ATTACK_POWER) * 10,
0x1E, 0x2D, 0, 0x19, 100.0, 0.0, -1.0, 0.0, nil, nil, nil, 0.8, 1.0, ATTACK_SETOFF_KIND_ON,
ATTACK_LR_CHECK_SPEED, false, -2.5, 0.0, 0x64, true, false, false, false, false,
COLLISION_SITUATION_MASK_GA, COLLISION_CATEGORY_MASK_NO_STAGE, COLLISION_PART_MASK_ALL,
false, 0x15A2C502B3, ATTACK_SOUND_LEVEL_M, COLLISION_SOUND_ATTR_KAMEHIT, ATTACK_REGION_NONE
)
AttackModule.enable_safe_pos()
@jam1garner
jam1garner / Cargo.toml
Created June 25, 2020 23:05
Basic example for getting started with ACMD with skyline-acmd and skyline-rs
[package]
name = "acmd_test"
version = "0.1.0"
authors = ["jam1garner <jam1.mcleod@hotmail.com>"]
edition = "2018"
[package.metadata.skyline]
titleid = "01006A800016E000"
[lib]
@jam1garner
jam1garner / Cargo.toml
Created June 21, 2020 22:09
ACMD Example
[package]
name = "acmd_test"
version = "0.1.0"
authors = ["jam1garner <jam1.mcleod@hotmail.com>"]
edition = "2018"
[package.metadata.skyline]
titleid = "01006A800016E000"
[lib]
#![feature(proc_macro_hygiene)]
use skyline::nro::{self, NroInfo};
use smash::app::{self, lua_bind::*, sv_system, sv_animcmd};
use smash::hash40;
use smash::lib::{lua_const::*, L2CValue, L2CAgent};
use smash::lua2cpp::L2CFighterCommon;
pub fn get_category(boma: &mut app::BattleObjectModuleAccessor) -> i32{
return (boma.info >> 28) as u8 as i32;