This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ghidra.program.model.listing import CodeUnit | |
from ghidra.app.util.datatype import DataTypeSelectionDialog | |
from ghidra.program.model.data import ArrayDataType, DataUtilities | |
from ghidra.util.data.DataTypeParser import AllowedDataTypes | |
from ghidra.program.model.symbol import Namespace, SourceType | |
import re | |
def CalculateArraySize(addr): | |
i = 0 | |
while getLong(addr) > 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Param: string [snow, storm, rain, diamonddust, sandstorm] | |
function changeWeather(weather) | |
local L2_2 = c4C26B52F.f544F902B() | |
L1_2 = L2_2.fBF4010E1(L2_2) | |
L1_2.fE0598362(L1_2, weather) | |
CC6FE82819C6E1D55.SF42297B52592C534(2) | |
end | |
--Adds item to bag | |
function AddItem(id, count) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 1. Boot game | |
* 2. Wait a second or so (for the game tid to register but before the code mounts the savedata) | |
* 3. Home button | |
* 4. Run this script | |
* 5. ??? | |
* 6. PROFIT | |
*/ | |
var tid = '0000000000000000'; //Change Title ID here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tid = '0000000000000000'; //Set appropriate game TID; Need to find a way to get TID automatically... | |
utils.log("stage1, hijack fsppr and set perms"); | |
sc.getFSPPR(); | |
sc.ipcMsg(1).sendPid().data(0).sendTo('fsp-srv').assertOk(); | |
var pid = sc.read4(sc.ipcBufAddr, 0xC >> 2); | |
utils.log('Got process PID: '+pid.toString(16)); | |
var buf1_sz = 0x1C; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bufPrivk = sc.malloc(0x134); | |
var bufCert = sc.malloc(0x804); | |
var bufOut = sc.malloc(0x100); | |
sc.ipcMsg(16).bDescriptor(bufPrivk, 0x134, 0).sendTo('set:cal').assertOk(); //set:cal#GetSslKey | |
utils.log('Obtained SSL key.'); | |
sc.ipcMsg(17).bDescriptor(bufCert, 0x804, 0).sendTo('set:cal').assertOk(); //set:cal#GetSslCert | |
utils.log('Obtained SSL cert.'); | |
sc.memdump(utils.add2(bufCert, 4), 0x800, 'clcert.der'); |