-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpvp.pcl
40 lines (38 loc) · 876 Bytes
/
pvp.pcl
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
proc in_cif {} {
if {[gra [pc]] != 0x8} {
puts "Doesn't look like we're in a CIF call"
return 0
}
return 1
}
proc cif_dump {} {
if {[in_cif] == 0} {
return
}
set cia [r3]
set service [mrs [mr32 [+ $cia 0]]]
set in [mr32 [+ $cia 4]]
set out [mr32 [+ $cia 8]]
puts "Service: "$service
puts "Argument array: "$cia
puts "In: "$in\ Out:\ $out
for {set i 0x0} {$i < $in} {incr i} {
set addr [+ $cia [* 4 [+ $i 3]]]
set val [mr32 $addr]
puts "Arg"$i\ ($addr):\ $val
}
for {set i 0x0} {$i < $out} {incr i} {
set n [+ $in 3]
set addr [+ $cia [* 4 [+ $i $n]]]
set val [mr32 $addr]
puts "Ret"$i\ ($addr):\ $val
}
}
proc cif_fail {} {
if {[in_cif] == 0} {
return
}
r3 -1
pc [lr]
cont
}