-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathHeader.cs
More file actions
147 lines (113 loc) · 7.21 KB
/
Copy pathHeader.cs
File metadata and controls
147 lines (113 loc) · 7.21 KB
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
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
using System;
public class Header
{
const string VERSION = "v18 (8.0.M)";
public static void PrintUsage(bool justTheTip = false)
{
#if !DebugArgs
if (!justTheTip)
{
Console.Clear();
}
#endif
Utils.SetDefaultColour();
// assuming 80 columns
Log.Write("\n");
Log.Write("================================================================================\n");
Log.Write(" NOPS " + VERSION + "\n");
Log.Write(" Thanks: Jihad of HITMEN, Shendo, Type79, Dax, \n");
Log.Write(" r0r0, Skitchin, danhans42, Schnappy, smf, \n");
Log.Write(" Nicolas Noble, T0fuZ, Arthur & spicyjpeg!\n");
Log.Write("\n");
Log.Write(" Instructions : http://unirom.github.io\n");
Log.Write(" Discord : http://psx.dev\n");
Log.Write("================================================================================\n");
Log.Write("\n");
Log.Write(" Note: You may have to install mono and launch via 'mono nops.exe /args' if...\n");
Log.Write(" - Windows cant put your serial device (FTDI, etc) into 115200baud\n");
Log.Write(" - You are using a Sharklink/Net Yaroze cable\n");
Log.Write(" - Any flavour of *nix/OSX\n");
Log.Write("\n\n");
if (justTheTip)
{
Log.FlushBuffer();
return;
}
// COM8, /dev/tty*, /dev/cu.usbserial*, etc
string suggestedComPort = Utils.SampleCOMPortForEnvironment;
Log.Write(" Usage : nops [/args] [FILENAME] [COMPORT]\n");
Log.Write(" Usage : nops [/args] [FILENAME] [IPADDRESS:PORT]\n\n");
Log.Write($" Send an .EXE : nops /exe FILE.EXE /dest {suggestedComPort}\n\n");
Log.Write($" Flash a .ROM : nops /rom FILE.ROM /dest {suggestedComPort}\n\n");
Log.Write($" Send a .BIN : nops /bin 0xADDRESS FILE.BIN /dest {suggestedComPort}\n\n");
Log.Write($" View serial : nops /m /dest {suggestedComPort}\n\n");
Log.Write($" Note: /dest will be cached to comport.txt after first use and may be omitted.\n\n");
Log.Write($" Upload in fast mode, return to 115200, and monitor:\n\n");
Log.Write($" nops /fast /exe MYFILE.EXE /m /returntoslow {suggestedComPort}\n\n");
Log.Write($" Dumpy Stuff:\n");
Log.Write($" RAM ( 2m) : nops /dump 0x80000000 0x200000 dump.bin\n");
Log.Write($" ROM (128k) : nops /dump 0x1F000000 0x20000 dump.bin\n");
Log.Write($" ROM (384k) : nops /dump 0x1F000000 0x60000 dump.bin\n");
Log.Write($" ROM (512k) : nops /dump 0x1F000000 0x80000 dump.bin\n");
Log.Write($" BIOS (512k) : nops /dump 0xBFC00000 0x80000 dump.bin\n");
Log.Write($" SPAD ( 1k) : nops /dump 0x1F800000 0x400 dump.bin\n\n");
Log.Write($" WARNING! If named dump file already exist it will be overwritten!\n");
Log.Write($" Also note that you can use * for <DUMP.BIN> to have automagically generated filename\n\n");
Log.Write($" Memory Cards:\n");
Log.Write($" MC0->File : nops /mcdown 0 filename.mcr\n");
Log.Write($" MC1->File : nops /mcdown 1 filename.mcr\n");
Log.Write($" File->MC0 : nops /mcup 0 filename.mcr\n\n");
Log.Write($" Pokey Poke:\n");
Log.Write($" 8 bits : nops /poke8 0x80100001 0x01\n");
Log.Write($" 16 bits : nops /poke16 0x80100002 0x0202\n");
Log.Write($" 32 bits : nops /poke32 0x80100004 0x04040404\n\n");
Log.Write($" Program flow:\n");
Log.Write($" Jump addr (jr) : nops /jmp 0xADDRESS0\n");
Log.Write($" Call addr (jal): nops /jal 0xADDRESS0\n\n");
Log.Write($" Continuous Hex Dump (to screen):\n");
Log.Write($" CD REGS: nops /watch 0x1F801800 0x4\n\n");
Log.Write($" Extra switches:\n");
Log.Write($" /m to open the Serial IO monitor (can be used on its own)\n");
Log.Write($" /fast to enable or continue using 500k baud\n");
Log.Write($" /debug to enable kernel level debugger during gameplay\n");
Log.Write($" /v Verbose logging\n");
Log.Write("\n");
Log.Write($" Examples:\n");
Log.Write($" nops /fast /rom unirom_b.rom\n");
Log.Write($" nops /exe mything.exe /m\n");
Log.Write($" nops /fast /poke8 0x80100000 0x04\n");
Log.Write("\n");
Log.Write($" Bridge:\n");
Log.Write($" nops /bridge [LOCALIP:PORT] /dest {suggestedComPort}\n\n");
Log.Write($" Bridges a remote machine to local serial:\n\n");
Log.Write($" nops /bridge 127.0.0.1:1234 /dest {suggestedComPort}\n");
Log.Write($" nops /m /dest 127.0.0.1:1234\n");
Log.Write("\n\n");
Log.Write($" Debug Functions: (Must be in debug mode via L1+Square or nops /debug)\n");
Log.Write($" Halt the PSX : nops /halt\n");
Log.Write($" Continue from halt/exeception/hook : nops /cont\n");
Log.Write($" Show registers from last interrupt : nops /regs\n");
Log.Write($" Set a register while halted : nops /setreg 0xADDR 0xVALUE\n");
Log.Write($" Hook (halt) on memory read * : nops /hookread 0xADDR\n");
Log.Write($" Hook (halt) on memory write * : nops /hookwrite 0xADDR\n");
Log.Write($" Hook (halt) on memory exec * : nops /hookex 0xADDR\n");
Log.Write($" Unhook (read/write/exec) : nops /unhook\n");
Log.Write($" * = Resume with nops /cont\n");
Log.Write($"\n");
Log.Write($" GDB Server:\n");
Log.Write($" /gdb Starts a GDB listen server. Requires IP:port and com port\n");
Log.Write($" It's highly recommended to start the server with /fast\n");
Log.Write($" i.e. nops /fast /gdb 127.0.0.1:3333 /dest {suggestedComPort}\n");
Log.Write($" You can then connect to the server with a GDB client\n");
Log.Write($" such as GDB or Visual Studio Code\n");
Log.Write($" /nomanifest Don't send manifest to GDB client, may be required for IDA\n");
Log.Write($" STDIN Functions:\n");
Log.Write($" Types a string into stdin : nops /type \"something\"\n");
Log.Write($" at about 1 char per frame : nops /type 'something'\n");
Log.Write("\n");
Log.FlushBuffer();
}
}