forked from 0xDC00/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNS_010044800D2EC000_Toraware_no_Paruma.js
41 lines (35 loc) · 1.1 KB
/
NS_010044800D2EC000_Toraware_no_Paruma.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ==UserScript==
// @name [0100982015606000] Toraware no Paruma
// @version 1.0.0
// @author [DC]
// @description Yuzu
// * Capcom
// * Unity (il2cpp)
// ==/UserScript==
const gameVer = '1.0.0';
const { setHook } = require('./libYuzu.js');
const mainHandler = trans.send(handler, '250+');
setHook({
'1.0.0': {
[0x8015b7a8 - 0x80004000]: mainHandler.bind_(null, 0), // text x0
[0x8015b46c - 0x80004000]: mainHandler.bind_(null, 1), // name x1
// choice?
// alert?
// prompt?
}
}[globalThis.gameVer = globalThis.gameVer ?? gameVer]);
function handler(regs, index) {
const address = regs[index].value;
console.log('onEnter');
//console.log(hexdump(address, { header: false, ansi: false, length: 0x50 }));
/* processString */
const len = address.add(0x10).readU32() * 2;
let s = null;
if (len > 0) {
s = address.add(0x14).readUtf16String(len);
s = s.replace(/\n+/g, ' '); // single line
s = s.replace(/\<PL_N\>/g, '???'); // name
s = s.replace(/<.+?>/g, ''); // html tag
}
return s;
}