-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnipperpatch.go
57 lines (57 loc) · 3.32 KB
/
nipperpatch.go
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
// Rendered by GoodASM
package main
var nipperpatchSymbols = map[string]int{
"BACKTOIDLE": 0x7a48,
"BLOCKPARROT": 0x7a4c,
"BPTR": 0x023d,
"EECTRL": 0x0003,
"FLAGS0": 0x0230,
"FLAGS1": 0x0231,
"IDLETOP": 0x7385,
"IFPTR": 0x023f,
"LEN": 0x0236,
"NAD": 0x0234,
"NIB": 0x023e,
"PCB": 0x0235,
"RESET": 0x401e,
"RESPOND": 0x75ae,
"RESPONDAX": 0x757f,
"RESYNC": 0x4177,
"STACKCHECK": 0x40ed,
"STARTUP": 0x7305,
"base": 0x019c,
"loop": 0x01c6,
}
var nipperpatch = []byte {
// 019c:
0x4e, 0x69, 0x70, 0x70, 0x65, 0x72, 0x54, 0x6f, 0x6f, 0x6c, 0x00, // 019c:
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 01a7:
0xae, 0x20, // 01c4: ldx #0x20
0xd6, 0xff, 0xff, // 01c6: lda @0xffff, x; 0xffff replaced with source address.
0xd7, 0x01, 0xa1, // 01c9: sta @0x01a1, x; 0x01a1 is end of buffer in SRAM, begins at 0x19c.
0x5a, // 01cc: dec x
0x2a, 0xf7, // 01cd: bpl loop
0xa6, 0x93, // 01cf: lda #0x93 ; Response code 0x93.
0xae, 0x40, // 01d1: ldx #0x40 ; Length in bytes. Longer than our message.
0xcd, 0x75, 0x7f, // 01d3: jsr RESPONDAX; Send response.
0xcc, 0x73, 0x85, // 01d6: jmp IDLETOP
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 01d9:
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x20, 0x67, 0x61, 0x70, 0x2e, // 0200:
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 020d:
0x00, 0x01, 0x02, 0x03, // 0220:
0x05, 0x0a, 0x06, 0x07, // 0224:
0x08, 0x09, 0x0a, 0x0b, // 0228:
0x0c, 0x0d, 0x0e, 0x0f, // 022c:
// 0230:
0x01, // 0230:
0x01, // 0231:
0x00, 0x00, // 0232: ; More flags.
0x21, // 0234:
0x00, // 0235: ; 00 returns 40
0xff, // 0236:
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0237:
0xa1, // 023d: ; Bytes copied so far. (DC in Nipper)
0x34, // 023e: ; Number of Information Bytes
0xdf, // 023f: ; Pointer to target information.
0x01, 0xc4, 0x01, 0xc4, // 0240: ; Early entry, to shellcode at 0x019c.
}