Skip to content

Instantly share code, notes, and snippets.

@jugeeya
jugeeya / script_11.c
Last active May 13, 2018 23:05
Sm4sh teleporting via input command script
// in script_11, see accompanying asm example to see where loc_9 is
// this contains all the code between loc_9 and loc_A in that
void loc_9()
{
global18 = sys_18(1);
// If this is a new frame, i.e. currentFrame globalvar isn't current
if(global14 != sys_13(1))
{
if(global26 & 0x4 /*If B is pressed*/ || sys_e(10002, 1) /*Or if B is held*/)
// Peach turnip 1 function
float __fastcall app::peachdaikon::PEACH_PEACHDAIKON_DAIKON_1_POWER(app::peachdaikon *this)
{
return *(float *)(*(_QWORD *)(*(_QWORD *)(*off_710456A320[0] + 840) + 344LL) + 32LL);
}
// Peach turnip 1 assembly
EXPORT _ZN3app11peachdaikon32PEACH_PEACHDAIKON_DAIKON_1_POWEREv
.text:00000071010795D0 _ZN3app11peachdaikon32PEACH_PEACHDAIKON_DAIKON_1_POWEREv
.text:00000071010795D0 ADRP X8, #off_710456A320@PAGE
@jugeeya
jugeeya / NRO Loading Function
Created March 27, 2019 23:11
NRO loading function
__int64 __fastcall sub_7102DA00E0(__int64 a1)
{
__int64 v1; // x23
int v2; // w24
_QWORD *v3; // x27
__int64 v4; // x9
__int64 v5; // x9
signed __int64 v6; // x8
const void *v7; // x20
__int64 v8; // x28
@jugeeya
jugeeya / FUN_01925b80.c
Last active April 5, 2019 20:00
2.0.0 Battle_Module_Object_Accessor function
void FUN_01925b80(longlong lParm1)
{
undefined8 *puVar1;
undefined8 *puVar2;
longlong local_38;
undefined4 local_30;
undefined4 uStack44;
uint local_28;
@jugeeya
jugeeya / EFFECT_FOLLOW_COLOR.s
Created April 2, 2019 22:39
EFFECT_FOLLOW_COLOR calling func
loc_7101956394 ; CODE XREF: sub_7101955F10+6A8↓j
.text:0000007101956394 MOV X8, #0xFFFFFFFF00000000
.text:0000007101956398 STUR X8, [SP,#0x110+var_84]
.text:000000710195639C STR WZR, [SP,#0x110+var_7C]
.text:00000071019563A0 LDR X0, [X22,#0x140]
.text:00000071019563A4 LDR X8, [X0]
.text:00000071019563A8 LDR X8, [X8,#0x80]
.text:00000071019563AC MOV V0.16B, V8.16B
.text:00000071019563B0 ADD X9, SP, #0x110+var_C0
.text:00000071019563B4 ADD X3, X9, #0x10
@jugeeya
jugeeya / standard_result.lua
Created April 5, 2019 19:36
standard_result.lc Decompilation
DecompiledFunction_0_1 = function(l_2_0)
-- function num : 0_1 , upvalues : upval_0_1_0, upval_0_1_1, upval_0_1_2, upval_0_1_3, upval_0_1_4, upval_0_1_5, upval_0_1_6, upval_0_1_7
local l_2_1 = upval_0_1_0.SCENE_EXIT_CODE_NONE
upval_0_1_0.exit_code = l_2_1
l_2_1 = upval_0_1_0.LayoutRootList
l_2_1 = l_2_1.standard_result
l_2_0.layout_root = l_2_1
l_2_1 = l_2_0.layout_root
l_2_1 = l_2_1(l_2_1)
l_2_0.layout_view = l_2_1
@jugeeya
jugeeya / standard_result.s
Created April 5, 2019 19:41
standard_result.lc Disassembly
; Function: 0_1
; Defined at line: 48
; #Upvalues: 8
; #Parameters: 1
; Is_vararg: 0
; Max Stack Size: 20
0 [-]: GETTABUP R1 U0 K1 ; R1 := U0["SCENE_EXIT_CODE_NONE"]
1 [-]: SETTABUP U0 K0 R1 ; U0["exit_code"] := R1
2 [-]: GETTABUP R1 U0 K3 ; R1 := U0["LayoutRootList"]
@jugeeya
jugeeya / build_system.md
Last active May 29, 2019 22:41
ACMD code-mod-framework build system

Hopefully this turns into a layer of a build system that occurs when the user types make or some similar bash command that triggers this build process before ultimately starting the Makefile process.

The idea is that firstly, we take input from the user. This is probably the most flexible part.

Somehow, we read in these ACMD scripts from the user, each associated with metadata including the category, kind, acmd type, and animation.

Example of input:

input_1:
@jugeeya
jugeeya / 500_module_offsets.c
Created September 19, 2019 00:48
5.0.0 module impl offsets
// From modules 0x38 (PostureModule) to 0x198 (unk)
// Each is the offset of the first function in the module's function list
// To find any module function given these, find any of the XREFs of the function and it will be the first in a list of the module function implementations
0x4a0d20
0x4c1c30
0x683350
0x6b8580
0x691f00
0x3d5d80
@jugeeya
jugeeya / 500_module_table_offsets.c
Created September 19, 2019 01:50
5.0.0 module table offsets
// From modules 0x38 (PostureModule) to 0x198 (unk)
// Each is the offset of the module's function table
// Generated with p/x **(unsigned long long**)($boma + $module_offset)
0x4943800
0x495a118
0x49567f0
0x495a6e0
0x4957978
0x493c968