This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCLPS2C_Documentation.txt
743 lines (576 loc) · 26.6 KB
/
CLPS2C_Documentation.txt
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
///////////////////////////////////////////////////////////////////////
CLPS2C (Custom Language for PlayStation 2 Cheats)
Version: 0.2
GitHub: https://github.com/NiV-L-A/CLPS2C
///////////////////////////////////////////////////////////////////////
Table Of Contents:
(1) Changelog
(2) Description and Settings
(3) List of commands
(4) Snippets
(5) Example code
(6) Credits
///////////////////////////////////////////////////////////////////////
_/|\-/|\-/|\_
(1) Changelog
_/|\-/|\-/|\_
Version 0.2 (31/05/2023)
- Added support for writing in MIPS assembly.
- Implemented the Keystone engine (version 0.9.2) to parse and assemble the instructions.
- Keystone.Net.dll was acquired by building the Keystone.Net project in Release mode, with target framework .Net Standard 2.0. The project can be found at https://github.com/keystone-engine/keystone/tree/master/bindings/csharp.
- keystone.dll was acquired by downloading the source code and following the guide at https://github.com/keystone-engine/keystone/blob/master/docs/COMPILE-WINDOWS.md.
- NOTE: After running the "..\nmake-dll.bat" command, no .dll was created in "\build\llvm\lib", contrary to what the guide says. Instead, the .dll was in the "\build\llvm\bin" directory.
- NOTE: Before building keystone.dll, the file located at "\llvm\include\llvm\MC\MCInstrDesc.h" has been changed so that the function "hasDelaySlot()" will always return false.
- Added an autocompletion list.
- The list pops up automatically as text is inserted into TextArea.
- By default, the list has the abbreviated commands listed in CLPS2C_Documentation.txt.
- The list auto-fills with words that have already been written before.
- Added the snippets function. Paste the snippets through the Snippets menu.
- By using the Snippets.txt file in the same path as the executable, the app can load chunk of text from it.
- The file can be changed manually to provide custom snippets. Read the section "Snippets" in CLPS2C_Documentation.txt to know more about the syntax of the snippets.
- Note that the app reads the file only once, on startup. If you modify the file, you must restart the app for the changes to take effect.
- If the file can't be found or if the file has no valid snippets, an error message will pop up saying so. In either case, the snippets function gets disabled.
- Added File->New (Ctrl+N).
- Creates a temporary new file.
- Added File->Open (Ctrl+O).
- When opening a file, the window's title is changed to the filename of the file opened.
- If the file opened has been modified since the opening, the character "*" will appear in the window's title.
- Added File->Save (Ctrl+S).
- If the file has been modified and has been saved, the "*" character gets removed.
- Added File->Save as... (Ctrl+Shift+S).
- Added Settings->Keep output's window scroll bar position.
- Added Settings->Enable SendRaw command.
- Added Settings->Enable auto-completion list.
- Added Settings->Write opcodes as comments in assembly's output.
- Changed Settings->Auto-indentation to Settings->Enable auto-indentation.
- Added a button to copy to clipboard the contents of the output's window.
- Added a message that pops up if the user is about to close the app and the current file has not been saved.
- Added regex to remove comments.
- Removed usage of Microsoft.CodeAnalysis to remove comments.
- Removed redundant packages from project.
- Polished code.
- Changed CLPS2C_Documentation.txt structure format.
- Fixed bugs:
- Prevent control characters from getting inserted into TextArea.
- Fixed a bug when only writing "" in TextArea and then sync.
- Known bugs:
- RemoveComments() doesn't detect single line comments in which quotes are present (example: SendRaw " //"OKAY").
- E-type codes have a maximum of 0xFF lines that they can execute. CLPS2C ignores it.
- If a label is missing in the assembly region, the error line displayed is at the "ASM_END" line (not really a bug but let's say it is).
- Zooming in the TextArea window eventually hides the line indicator on the left.
- If an opcode has a period (for example: abs.s), the letters after the period will not be highlighted.
Version 0.1 (23/03/2023)
- Initial Version
///////////////////////////////////////////////////////////////////////
_/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\_
(2) Description and Settings
_/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\_
CLPS2C is a domain-specific language, built specifically
for writing PS2 cheat codes.
This project was born because I wanted a way to write PS2 cheat codes
in an easier manner by using an imperative language.
Below is a list of commands you can use, in which () are the arguments
and [] are optional arguments.
Press the F5 key or the CLPS2C text to "Sync" (parse the commands).
- All (ADDRESS) values must be a correct hexadecimal number,
consisting of up to 8 digits, with or without the prefix "0x".
- All (VALUE) values are always considered decimal,
adding the prefix "0x" will make them hexadecimal
and placing the (VALUE) between quotes (") will make them a string.
- All (ADDRESS) and (VALUE) values can be replaced with variables
previously declared by using the "Set" command.
- Indentation does not matter.
- Support for single-line ("//") and multi-line ("/*" "*/") comments.
- Support for escape characters in strings:
\0 Appends 0x00 to the value (useful for terminating a string).
\n New line.
\t Tab.
- Auto-indentation is enabled by default. It can be disabled in Settings->Enable auto-indentation.
- The app can translate the RAW codes in the output window to PCSX2-Format codes. Enable it in Settings->PCSX2-Format output.
- CTRL-Z to undo, CTRL-Y to redo.
- Hold ALT and left click to go in rectangular selection mode.
Syntax that is case-sensetive:
- Variable names ("Set myVar 1" is different than "Set MYVAR 1").
- The escape characters ("\n" is different than "\N").
Syntax that is not case-sensetive:
- Commands (SET is equivalent to set).
///////////////////////////////////////////////////////////////////////
_/|\-/|\-/|\-/|\-/|\_
(3) List of commands
_/|\-/|\-/|\-/|\-/|\_
Unique
Set (NAME) (VALUE)
SetEncoding|SE (ENCODING)
SendRaw|SR (VALUE)
ASM_START (ADDRESS)
ASM_END
Write
Write8|W8 (ADDRESS) (VALUE)
Write16|W16 (ADDRESS) (VALUE)
Write32|W32 (ADDRESS) (VALUE)
WriteFloat|WF (ADDRESS) (VALUE)
WriteString|WS (ADDRESS) (VALUE)
WriteBytes|WB (ADDRESS) (VALUE)
WritePointer8|WP8 (ADDRESS)(OFFSET)[OFFSET] (VALUE)
WritePointer16|WP16 (ADDRESS)(OFFSET)[OFFSET] (VALUE)
WritePointer32|WP32 (ADDRESS)(OFFSET)[OFFSET] (VALUE)
WritePointerFloat|WPF (ADDRESS)(OFFSET)[OFFSET] (VALUE)
CopyBytes|CB (ADDRESS) (ADDRESS) (VALUE)
Increment / Decrement
Increment8|I8 (ADDRESS) (VALUE)
Increment16|I16 (ADDRESS) (VALUE)
Increment32|I32 (ADDRESS) (VALUE)
Decrement8|D8 (ADDRESS) (VALUE)
Decrement16|D16 (ADDRESS) (VALUE)
Decrement32|D32 (ADDRESS) (VALUE)
Boolean Operations
OR8 (ADDRESS) (VALUE)
OR16 (ADDRESS) (VALUE)
AND8 (ADDRESS) (VALUE)
AND16 (ADDRESS) (VALUE)
XOR8 (ADDRESS) (VALUE)
XOR16 (ADDRESS) (VALUE)
Conditional
If (ADDRESS) (COND)(DATATYPE) (VALUE)
EndIf|EI
///////////////////////////////////////////////////////////////////////
Set (NAME) (VALUE)
Declares a variable with the name (NAME) and
assigns the value (VALUE) to it.
Once a variable is declared, declaring it once again
will only replace its value.
NOTE: This instruction does NOT get translated to a cheat code.
Arguments:
NAME Name of the variable
VALUE Value assigned to the variable
Usage:
Set MapID 0x4AF8A4
Set TEMP 0x3A8B78
Set myVar 1000 // Equivalent to "Set myVar 0x3E8"
Set CharacterName "muse" // Will be converted to the array of bytes 6D 75 73 65
Set ProfileName "muse\0" // Will be converted to the array of bytes 6D 75 73 65 00
Set CharacterHP 0x12345678 // Now CharacterHP has the value of 0x12345678
Set CharacterHP 0xDEADBEEF // Now CharacterHP has the value of 0xDEADBEEF
///////////////////////////////////////////////////////////////////////
SetEncoding|SE (ENCODING)
Sets the current encoding (ENCODING) to be used for the WriteString command.
The encoding chosen will be used until another SetEncoding is encountered.
NOTE: This instruction does NOT get translated to a cheat code.
(ENCODING):
UTF-8 (default)
UTF-16
Usage:
SetEncoding UTF-8
WriteString 20E98100 "park"
SetEncoding UTF-16
WriteString 20E98100 "park"
///////////////////////////////////////////////////////////////////////
SendRaw|SR (VALUE)
Writes a raw string (VALUE).
Condition for (VALUE): Prefix and suffix always " when not using a declared variable.
Usage:
SendRaw "//Is there a better way to do this?"
SendRaw "park\n"
Set myStr "//All her doubts were someone else's point of view"
SendRaw myStr
///////////////////////////////////////////////////////////////////////
ASM_START (ADDRESS)
ASM_END
Defines the beginning and ending of an assembly region.
In this region, all the other CLPS2C commands can't be executed.
In this region, values set with the Set command will not be applied.
Labels can be used, but the first instruction must be on the same line as the label.
Every register must be prefixed with the dollar sign ($).
Always have an ASM_END to indicate the termination of the assembly scope.
NOTE: You must manually add the branch delay slot after any branch instruction.
Usage:
ASM_START 003D1000
addi $t2,$t1,0x0058 //$t2 = $t1 + 0x58
ASM_END
Set Cave 203D1000
ASM_START Cave
/*Load immediate ($t0 = 0x003D10A0). Equivalent to "lui $t0,0x003D; ori $t0,$t0,0x10A0".*/
li $t0,0x003D10A0
/*Load word ($t0 = *0x003D10A0). Reads 4 bytes at the specified address and stores the value in the specified register.*/
/*Equivalent to "lui $t0,0x003D; lw $t0,0x10A0($t0)".*/
lw $t0,0x003D10A0
/*Load immediate in a float register. Loads 60f in the $f4 register.*/
li $t0,60 //load 60 as int in $t0.
mtc1 $t0,$f4 //move to coprocessor 1 (FPU)'s register $f4.
cvt.s.w $f4,$f4 //converts a word to a floating point (60 -> 60f).
ASM_END
ASM_START 200FF000
//check flag
lw $t0,0x003D0D00
li $at,0x1
beq $t0,$at,DisableFlag //if flag == 1
nop
b Exit
nop
DisableFlag: li $at,0 //disable flag
lui $t0,0x003D
sw $at,0xD00($t0)
Exit: jr $ra //return
nop
ASM_END
///////////////////////////////////////////////////////////////////////
Write8|W8 (ADDRESS) (VALUE)
Writes an 8-bit (1 byte) value (VALUE) to the address (ADDRESS).
Condition for (VALUE): 0x00 <= (VALUE) <= 0xFF
Usage:
Write8 21F2E740 40 // Writes 40 to the memory address 0x21F2E740
Write8 21F2E740 0x40 // Writes 64 to the memory address 0x21F2E740
Set MapID 0x004AF8A4
Write8 MapID 6 // Writes 6 to the memory address 0x004AF8A4
Set MapID 0x004AF8A4
Set TargetValue 127
Write8 MapID TargetValue // Writes 127 to the memory address 0x004AF8A4
///////////////////////////////////////////////////////////////////////
Write16|W16 (ADDRESS) (VALUE)
Writes a 16-bit (2 bytes) value (VALUE) to the address (ADDRESS).
Condition for (VALUE): 0x0000 <= (VALUE) <= 0xFFFF
Usage:
Write16 21F2E740 123 // Writes 40 to the memory address 0x01F2E740
Write16 21F2E740 0x123 // Writes 291 to the memory address 0x01F2E740
Set CharacterID 0x20390018
Write16 CharacterID 0xDEAD // Writes 57005 to the memory address 0x00390018
Set MapID 0x004AF8A4
Set TargetValue 29827
Write16 MapID TargetValue // Writes 29827 to the memory address 0x004AF8A4
///////////////////////////////////////////////////////////////////////
Write32|W32 (ADDRESS) (VALUE)
Writes a 32-bit (4 bytes) value (VALUE) to the address (ADDRESS).
Condition for (VALUE): 0x00000000 <= (VALUE) <= 0xFFFFFFFF
Usage:
Write32 21F2E740 123 // Writes 40 to the memory address 0x01F2E740
Write32 21F2E740 0x123 // Writes 291 to the memory address 0x01F2E740
Set CharacterID 0x20390018
Write32 CharacterID 0xDEADDEAD // Writes 3735936685 to the memory address 0x00390018
Set MapID 0x004AF8A4
Set TargetValue 0x12341234
Write32 MapID TargetValue // Writes 305402420 to the memory address 0x004AF8A4
///////////////////////////////////////////////////////////////////////
WriteFloat|WF (ADDRESS) (VALUE)
Writes a 32-bit floating-point value (VALUE) to the address (ADDRESS).
Condition for (VALUE): Must be decimal.
Usage:
WriteFloat 21F2E740 123 // Writes 123 in float to the memory address 0x01F2E740. Equivalent to "Write32 01F2E740 0x42F60000"
Set XCoord 0x20390018
WriteFloat XCoord -5000 // Writes -5000 in float to the memory address 0x00390018. Equivalent to "Write32 00390018 0xC59C4000"
Set XCoord 0x20390018
Set TargetValue 1.5
WriteFloat XCoord TargetValue // Writes 1.5 in float to the memory address 0x00390018. Equivalent to "Write32 00390018 0x3FC00000"
WriteFloat 20390018 Infinity // Writes +Infinity in float to the memory address 0x00390018. Equivalent to "Write32 00390018 0x7F800000"
WriteFloat 20390018 -Infinity // Writes -Infinity in float to the memory address 0x00390018. Equivalent to "Write32 00390018 0xFF800000"
WriteFloat 20390018 NaN // Writes NaN in float to the memory address 0x00390018. Equivalent to "Write32 00390018 0xFFC00000"
///////////////////////////////////////////////////////////////////////
WriteString|WS (ADDRESS) (VALUE)
Writes a string (VALUE) to the address (ADDRESS) with the current encoding.
Condition for (VALUE): Prefix and suffix always " when not using a declared variable.
NOTE: Append "\0" at the end of the string to add a null terminator character.
NOTE: When ((VALUE).Length % 4 != 0), more writes of different data types are needed:
"park" -> Write32.
"parko" -> Write32+Write8.
"parkou" -> Write32+Write16.
"parkour" -> Write32+Write16+Write8.
Usage:
WriteString 01F2E740 "parkour_start" // Writes "parkour_start" in string form to the memory address 0x01F2E740
WriteString 01F2E740 "parkour_start\0" // Writes "parkour_start" in string form to the memory address 0x01F2E740 and appends a 0x00 at the end.
Set myAddr 0x01F2E740
Set TargetValue "Thanks for playing this map!\n\nPress any key to exit.\0"
WriteString myAddr TargetValue // Writes "Thanks for playing this map!\n\nPress any key to exit.\0", to the memory address 0x01F2E740
///////////////////////////////////////////////////////////////////////
WriteBytes|WB (ADDRESS) (VALUE)
Writes a byte array (VALUE) to the address (ADDRESS).
Condition for (VALUE): Prefix and suffix always " when not using a declared variable. "AA BB CC DD" format.
NOTE: When ((VALUE).Length % 4 != 0), more writes of different data types are needed:
"00 11 22 33" -> Write32.
"00 11 22 33 44" -> Write32+Write8.
"00 11 22 33 44 55" -> Write32+Write16.
"00 11 22 33 44 55 66" -> Write32+Write16+Write8.
Usage:
WriteBytes 00764590 "00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF"
Set myAddr 0x01F2E740
Set TargetValue "e4 7b bc 08 17 f5 7f a4 d2 2a 06 e8 74 82 29 d4 7e 0f 7d 86 c6 41 e4 a1 85 00"
WriteBytes myAddr TargetValue
///////////////////////////////////////////////////////////////////////
WritePointer8|WP8 (ADDRESS)(OFFSET)[OFFSET] (VALUE)
Writes an 8-bit (1 byte) value (VALUE) to the address calculated by
loading the base (ADDRESS) and adding (OFFSET) and [OFFSET].
Each offset must be separated by a comma (,).
Condition for (VALUE): 0x00 <= (VALUE) <= 0xFF
Usage:
WritePointer8 21F2E740,48 40 // Writes 40 to the memory address pointed by (the base from address 0x21F2E740 and adding the offset 0x48)
WritePointer8 21F2E740,0x1C,0x70 0x40 // Writes 64 to the memory address poined by (the base from address 0x21F2E740 and adding the offsets 0x1C and 0x70)
Set CharBase 0x004AF8A4
Set StatsOff 0x20
Set HPOff 0x30
WritePointer8 CharBase,StatsOff,HPOff 1
///////////////////////////////////////////////////////////////////////
WritePointer16|WP16 (ADDRESS)(OFFSET)[OFFSET] (VALUE)
Writes a 16-bit (2 bytes) value (VALUE) to the address calculated by
loading the base (ADDRESS) and adding (OFFSET) and [OFFSET].
Each offset must be separated by a comma (,).
Condition for (VALUE): 0x0000 <= (VALUE) <= 0xFFFF
Usage:
WritePointer16 21F2E740,48 40 // Writes 40 to the memory address pointed by (the base from address 0x21F2E740 and adding the offset 0x48)
WritePointer16 21F2E740,0x1C,0x70 0x40 // Writes 64 to the memory address poined by (the base from address 0x21F2E740 and adding the offsets 0x1C and 0x70)
Set CharBase 0x004AF8A4
Set StatsOff 0x20
Set HPOff 0x30
WritePointer16 CharBase,StatsOff,HPOff 1
///////////////////////////////////////////////////////////////////////
WritePointer32|WP32 (ADDRESS)(OFFSET)[OFFSET] (VALUE)
Writes a 32-bit (4 bytes) value (VALUE) to the address calculated by
loading the base (ADDRESS) and adding (OFFSET) and [OFFSET].
Each offset must be separated by a comma (,).
Condition for (VALUE): 0x00000000 <= (VALUE) <= 0xFFFFFFFF
Usage:
WritePointer32 21F2E740,48 40 // Writes 40 to the memory address pointed by (the base from address 0x21F2E740 and adding the offset 0x48)
WritePointer32 21F2E740,0x1C,0x70 0x40 // Writes 64 to the memory address poined by (the base from address 0x21F2E740 and adding the offsets 0x1C and 0x70)
Set CharBase 0x004AF8A4
Set StatsOff 0x20
Set HPOff 0x30
WritePointer32 CharBase,StatsOff,HPOff 1
///////////////////////////////////////////////////////////////////////
WritePointerFloat|WPF (ADDRESS)(OFFSET)[OFFSET] (VALUE)
Writes a 32-bit floating-point value (VALUE) to the address calculated by
loading the base (ADDRESS) and adding (OFFSET) and [OFFSET].
Each offset must be separated by a comma (,).
Condition for (VALUE): Must be decimal.
Usage:
WritePointerFloat 21F2E740,48 1.5 // Writes 1.5 to the memory address pointed by (the base from address 0x21F2E740 and adding the offset 0x48)
WritePointerFloat 21F2E740,0x1C,0x70 100 // Writes 100 to the memory address poined by (the base from address 0x21F2E740 and adding the offsets 0x1C and 0x70)
Set CharBase 0x004AF8A4
Set TransOff 0x58
Set XCoord 0x30
WritePointerFloat CharBase,TransOff,XCoord Infinity
///////////////////////////////////////////////////////////////////////
CopyBytes|CB (ADDRESS) (ADDRESS) (VALUE)
Copies a block of (VALUE) bytes from source address (ADDRESS) to destination address (ADDRESS).
Arguments:
ADDRESS Source address
ADDRESS Destination address
VALUE Length
Usage:
CopyBytes 15E6CB4 15E6CB8 4 // Copies 4 bytes from 0x015E6CB4 to 0x015E6CB8
Set source 0x004AF8A4
Set dest 0x01F2E740
CopyBytes source dest 0x40 // Copies 64 bytes from 0x004AF8A4 to 0x01F2E740
///////////////////////////////////////////////////////////////////////
Increment8|I8 (ADDRESS) (VALUE)
Increments the 8-bit value at address (ADDRESS) by the 8-bit value (VALUE).
Usage:
Increment8 20E98100 1 // Increments the value at address 0xE98100 by 1
Set Addr 0xA73910
Set Val 100
Increment8 Addr Val
///////////////////////////////////////////////////////////////////////
Increment16|I16 (ADDRESS) (VALUE)
Increments the 16-bit value at address (ADDRESS) by the 16-bit value (VALUE).
Usage:
Increment16 20E98100 1 // Increments the value at address 0xE98100 by 1
Set Addr 0xA73910
Set Val 100
Increment16 Addr Val
///////////////////////////////////////////////////////////////////////
Increment32|I32 (ADDRESS) (VALUE)
Increments the 32-bit value at address (ADDRESS) by the 32-bit value (VALUE).
Usage:
Increment32 20E98100 1 // Increments the value at address 0xE98100 by 1
Set Addr 0xA73910
Set Val 100
Increment32 Addr Val
///////////////////////////////////////////////////////////////////////
Decrement8|D8 (ADDRESS) (VALUE)
Decrements the 8-bit value at address (ADDRESS) by the 8-bit value (VALUE).
Usage:
Decrement8 20E98100 1 // Decrements the value at address 0xE98100 by 1
Set Addr 0xA73910
Set Val 100
Decrement8 Addr Val
///////////////////////////////////////////////////////////////////////
Decrement16|D16 (ADDRESS) (VALUE)
Decrements the 16-bit value at address (ADDRESS) by the 16-bit value (VALUE).
Usage:
Decrement16 20E98100 1 // Decrements the value at address 0xE98100 by 1
Set Addr 0xA73910
Set Val 100
Decrement16 Addr Val
///////////////////////////////////////////////////////////////////////
Decrement32|D32 (ADDRESS) (VALUE)
Decrements the 32-bit value at address (ADDRESS) by the 32-bit value (VALUE).
Usage:
Decrement32 20E98100 1 // Decrements the value at address 0xE98100 by 1
Set Addr 0xA73910
Set Val 100
Decrement32 Addr Val
///////////////////////////////////////////////////////////////////////
OR8 (ADDRESS) (VALUE)
Bitwise 8-bit OR operation between value stored at address (ADDRESS) and (VALUE). Store the result in (ADDRESS).
Usage:
OR8 90A64C 4
Set Addr 90A64C
Set Val 4
OR8 Addr Val
///////////////////////////////////////////////////////////////////////
OR16 (ADDRESS) (VALUE)
Bitwise 16-bit OR operation between value stored at address (ADDRESS) and (VALUE). Store the result in (ADDRESS).
Usage:
OR16 90A64C 4
Set Addr 90A64C
Set Val 4
OR16 Addr Val
///////////////////////////////////////////////////////////////////////
AND8 (ADDRESS) (VALUE)
Bitwise 8-bit AND operation between value stored at address (ADDRESS) and (VALUE). Store the result in (ADDRESS).
Usage:
AND8 90A64C 4
Set Addr 90A64C
Set Val 4
AND8 Addr Val
///////////////////////////////////////////////////////////////////////
AND16 (ADDRESS) (VALUE)
Bitwise 16-bit AND operation between value stored at address (ADDRESS) and (VALUE). Store the result in (ADDRESS).
Usage:
AND16 90A64C 4
Set Addr 90A64C
Set Val 4
AND16 Addr Val
///////////////////////////////////////////////////////////////////////
XOR8 (ADDRESS) (VALUE)
Bitwise 8-bit XOR operation between value stored at address (ADDRESS) and (VALUE). Store the result in (ADDRESS).
Usage:
XOR8 90A64C 4
Set Addr 90A64C
Set Val 4
XOR8 Addr Val
///////////////////////////////////////////////////////////////////////
XOR16 (ADDRESS) (VALUE)
Bitwise 16-bit XOR operation between value stored at address (ADDRESS) and (VALUE). Store the result in (ADDRESS).
Usage:
XOR16 90A64C 4
Set Addr 90A64C
Set Val 4
XOR16 Addr Val
///////////////////////////////////////////////////////////////////////
If (ADDRESS) (COND)(DATATYPE) (VALUE)
EndIf|EI
Compares the value at address (ADDRESS) with (VALUE), by using the condition (COND).
Always specify if to check for 1 byte or 2 bytes with (DATATYPE).
Always have an EndIf to indicate the termination of the If scope.
(COND):
= equality
! inequality
< less than
> greater than
(DATATYPE):
. 8-bit (1 byte)
: 16-bit (2 bytes)
Usage:
If 004AF8A4 =. 0xFF //If 0x4AF8A4's value equals to 0xFF (only check 1 byte)
Write32 01F2E740 1
EndIf
Set MapID 004AF8A4
If MapID =: 6 //If 0x4AF8A4's value equals to 6 (check 2 bytes)
Write32 01F2E740 1
EndIf
Set MapID 0x004AF8A4
Set ParisID 3
If MapID !: ParisID //If 0x4AF8A4's value is NOT equal to 3 (check 2 bytes)
Write32 01F2E740 1
EndIf
If 004AF8A4 <: 6
Write32 01F2E740 1 //If 0x4AF8A4's value is less than 6 (check 2 bytes)
EndIf
If 004AF8A4 >: 0x12
Write32 01F2E740 1 //If 0x4AF8A4's value is greater than 0x12 (check 2 bytes)
EndIf
///////////////////////////////////////////////////////////////////////
_/|\-/|\-/|\_
(4) Snippets
_/|\-/|\-/|\_
By using the Snippets.txt file in the same path as the executable, the app can load chunk of text from it.
You can paste the snippets through the Snippets menu.
To create a custom snippet, the right syntax must be followed:
Snippet[word]:[displayed word]
[code]
Snippet[word]End
The beginning of the snippet must start with the word "Snippet", followed by any other word, for example:
SnippetLoveMuse
On the same line, add a colon (:), and then any sentence. The sentence after the colon will be the one displayed in the app. For example:
SnippetLoveMuse:Paste love MUSE code
After this line, the chunk of text that is going to be copied will begin. For example:
SendRaw "I love MUSE!"
To end the snippet, you must write "Snippet", then the word you used for the beginning of the snippet, but add the word "End" to it. For example:
SnippetLoveMuseEnd
Altogether, it shoud look something like this:
SnippetLoveMuse:Paste love MUSE code
SendRaw "I love MUSE!"
SnippetLoveMuseEnd
If you add these 3 lines in Snippets.txt, the next time you will open the app the Snippets menu will have the "Paste love MUSE code" entry.
Sub-menus are possible by specifying the Parent menu:
Snippet[word]:[displayed parent word]:[displayed word]
[code]
Snippet[word]End
For example, if you want to create a menu in the Snippets menu called "Advanced", which has a sub-menu called "Paste hate MUSE code", you could do:
SnippetHateMuse:Advanced:Paste hate MUSE code
SendRaw "I hate MUSE!"
SnippetHateMuseEnd
///////////////////////////////////////////////////////////////////////
_/|\-/|\-/|\-/|\_
(5) Example code
_/|\-/|\-/|\-/|\_
Set MapID 0x3E1110
Set ParisID 3
Set JobID 0x67381C
Set CharBase 0x2E1E40
Set TransOff 0x58
Set XCoordOff 0x30
Set CharHP 3D4AB0
Set CharHPMax 40
Set MyStr "Parkour_Start\0"
If MapID =: ParisID
SendRaw " //If in paris"
If JobID !. 0xFF
SendRaw "\t //If not in a job"
WritePointerFloat CharBase,TransOff,XCoordOff 1500 //write 1500 (in float) to the character's x coordinate
EndIf
Write32 CharHP CharHPMax //Set the character's hp to 40
WriteString 0x87310 MyStr
EndIf
_/|\-/|\-/|\-/|\-/|\_
(5B) Outputs:
_/|\-/|\-/|\-/|\-/|\_
E0090003 003E1110 //If in paris
E10300FF 1067381C //If not in a job
602E1E40 44BB8000
00020002 00000058
00000030 00000000
203D4AB0 00000028
20087310 6B726150
20087314 5F72756F
20087318 72617453
1008731C 00000074
///////////////////////////////////////////////////////////////////////
_/|\-/|\-/|\_
(6) Credits
_/|\-/|\-/|\_
Author:
- NiV-L-A
Special thanks to:
- Sly Cooper Modding Discord Server: https://discord.gg/2GSXcEzPJA
- Luigi Auriemma's QuickBMS: http://aluigi.altervista.org/quickbms.htm
- ScintillaNET.Demo by robinrodricks: https://github.com/robinrodricks/ScintillaNET.Demo
- Icon made by Cooper941: https://www.youtube.com/@Cooper941
- MIPS assembler engine from Keystone-engine https://github.com/keystone-engine/keystone
Useful links:
- https://github.com/root670/CheatDevicePS2/wiki/Code-Types
- https://github.com/zzamizz/weed-sheet/wiki/PNACH-Code-Types
- https://slymods.info/wiki/Guide:Writing_pnach_files
- https://github.com/mlafeldt/ps2rd/blob/master/Documentation/code_types.txt
- https://github.com/root670/CheatDevicePS2/blob/master/engine/engine_asm.S
- https://github.com/PCSX2/pcsx2/blob/fdabc82342d82227901c9a709b10f02dfe1801a3/pcsx2/Patch_Memory.cpp
- https://math-atlas.sourceforge.net/devel/assembly/mips-iv.pdf
- https://psi-rockin.github.io/ps2tek/
///////////////////////////////////////////////////////////////////////