summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-07-07 15:29:48 +0200
committerTreeki <treeki@gmail.com>2011-07-07 15:29:48 +0200
commit42af9e06e59747bd133559fd25b0582c6984ad44 (patch)
treeee331f3c2df2df5a28d3099eed3591b712e3211f
parent7f8da8ec6001ca72ceb0f0a22e8c58ee74184231 (diff)
downloadkamek-42af9e06e59747bd133559fd25b0582c6984ad44.tar.gz
kamek-42af9e06e59747bd133559fd25b0582c6984ad44.zip
added a module that OSReports created actors/processes
-rw-r--r--NewerProject.yaml1
-rw-r--r--actorlog.yaml9
-rw-r--r--src/actorlog.S41
3 files changed, 51 insertions, 0 deletions
diff --git a/NewerProject.yaml b/NewerProject.yaml
index b3248b1..f796ec6 100644
--- a/NewerProject.yaml
+++ b/NewerProject.yaml
@@ -20,3 +20,4 @@ modules:
- processed/levelspecial.yaml
- processed/eventlooper.yaml
- processed/compression.yaml
+# - processed/actorlog.yaml
diff --git a/actorlog.yaml b/actorlog.yaml
new file mode 100644
index 0000000..3e4adb2
--- /dev/null
+++ b/actorlog.yaml
@@ -0,0 +1,9 @@
+---
+source_files: [../src/actorlog.S]
+hooks:
+ - name: ActorLogHook
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80162BC0
+ target_func: 'ActorLogHook'
+
diff --git a/src/actorlog.S b/src/actorlog.S
new file mode 100644
index 0000000..f4e7205
--- /dev/null
+++ b/src/actorlog.S
@@ -0,0 +1,41 @@
+.text
+
+.set sp, 1
+
+.align 4
+.extern OSReport
+
+.global ActorLogHook
+ActorLogHook:
+ stwu sp, -0x20(sp)
+ mflr r0
+ stw r0, 0x24(sp)
+ stw r3, 0x1C(sp)
+ stw r4, 0x18(sp)
+ stw r5, 0x14(sp)
+ stw r6, 0x10(sp)
+
+ lis r8, 0x8032
+ ori r8, r8, 0xB58
+ slwi r7, r3, 2
+ lwzx r7, r8, r7
+
+ lis r3, M@h
+ ori r3, r3, M@l
+ crclr 4*cr1+eq
+ bl OSReport
+
+ lwz r6, 0x10(sp)
+ lwz r5, 0x14(sp)
+ lwz r4, 0x18(sp)
+ lwz r3, 0x1C(sp)
+ lwz r0, 0x24(sp)
+ mtlr r0
+ addi sp, sp, 0x20
+
+ # Return to __objCreate
+ clrlslwi r31, r3, 16, 2
+ blr
+
+.data
+M: .string "P:%p S:%08x T:%d N:%s\n"