diff --git a/Ghidra/Processors/PowerPC/certification.manifest b/Ghidra/Processors/PowerPC/certification.manifest index d54ea3210c..fb01089819 100644 --- a/Ghidra/Processors/PowerPC/certification.manifest +++ b/Ghidra/Processors/PowerPC/certification.manifest @@ -64,6 +64,8 @@ data/languages/vsx.sinc||GHIDRA||||END| data/manuals/PowerISA.idx||GHIDRA||||END| data/manuals/PowerPC.idx||GHIDRA||||END| data/patterns/PPC_BE_patterns.xml||GHIDRA||||END| +data/patterns/PPC_BE_prepatterns.xml||GHIDRA||||END| data/patterns/PPC_LE_patterns.xml||GHIDRA||||END| +data/patterns/PPC_LE_prepatterns.xml||GHIDRA||||END| data/patterns/patternconstraints.xml||GHIDRA||||END| -data/ppc64-r2CallStubs.xml||GHIDRA||||END| +data/patterns/prepatternconstraints.xml||GHIDRA||||END| diff --git a/Ghidra/Processors/PowerPC/data/patterns/PPC_BE_prepatterns.xml b/Ghidra/Processors/PowerPC/data/patterns/PPC_BE_prepatterns.xml new file mode 100644 index 0000000000..a3e7ef7023 --- /dev/null +++ b/Ghidra/Processors/PowerPC/data/patterns/PPC_BE_prepatterns.xml @@ -0,0 +1,208 @@ + + + + + 0xf8410028 + 001111.. ...00010 0xff 0xff + 0xe9 ........ ........ ........ + 0x7d 0x.9 0x03 0xa6 + 0xe8 010..... ........ ........ + 0x28220000 + 0x4c 1..00010 0x04 0x20 + 010010.. ........ ........ ......00 + + + + + + + 0xf8410028 + 0xe9 ........ ........ ........ + 0x7d 0x.9 0x03 0xa6 + 0xe8 010..... ........ ........ + 0x28220000 + 0x4c 1..00010 0x04 0x20 + 010010.. ........ ........ ......00 + + + + + + + 011111.. ...01000 0x02 0xa6 + 0x42 1....... 0x00 0x05 + 011111.. ...01000 0x02 0xa6 + 001111.. ........ 0x.. 0x.. + 001110.. ........ 0x.. 0x.. + 011111.. ...01000 0x03 0xa6 + 011111.. ...01001 0x03 0xa6 + 0x4e 10000... 0x04 0x20 + + + + + + + + 0x....823d # addis r12,r2,0x#### + 0x..0041f8 # std r2,0x##(r1) + 0x....6ce9 # ld r11,0x####(r12) + 0xa603697d # mtspr CTR,r11 + 0x....4ce8 # ld r2,0x####(r12) + 0x....6ce9 # ld r11,0x####(r12) + 0x2004804e # bctr + + + + + + 0x..0041f8 # std r2,0x##(r1) + 0x....62e9 # ld r11,0x####(r2) + 0xa603697d # mtspr CTR,r11 + 0x....62e9 # ld r11,0x####(r2) + 0x....42e8 # ld r2,0x####(r2) + 0x2004804e # bctr + + + + + + 0x..0041f8 # std r2,0x##(r1) + 0x....82e9 # ld r12,0x####(r2) + 0xa603897d # mtspr CTR,r12 + 0x2004804e # bctr + + + + + + + 0x....623d # addis r11,r2,0x#### + 0x....8be9 # ld r12,0x####(r11) + 0xa603897d # mtspr CTR,r12 + 0x....4be8 # ld r2,0x####(r11) + 0x2004804e # bctr + + + + + + 0x....623d # addis r11,r2,0x#### + 0x....8be9 # ld r12,0x####(r11) + 0x....6b39 # addi r11,r11,0x#### + 0xa603897d # mtspr CTR,r12 + 0x....4be8 # ld r2,0x####(r11) + 0x....6be9 # ld r11,0x####(r11) + 0x2004804e # bctr + + + + + + 0x....623d # addis r11,r2,0x#### + 0x....8be9 # ld r12,0x####(r11) + 0xa603897d # mtspr CTR,r12 + 0x7862827d # xor r2,r12,r12 + 0x14126b7d # add r11,r11,r2 + 0x....4be8 # ld r2,0x####(r11) + 0x2004804e # bctr + + + + + + 0x....623d # addis r11,r2,0x#### + 0x....8be9 # ld r12,0x####(r11) + 0x....6b39 # addi r11,r11,0x#### + 0xa603897d # mtspr CTR,r12 + 0x7862827d # xor r2,r12,r12 + 0x14126b7d # add r11,r11,r2 + 0x....4be8 # ld r2,0x####(r11) + 0x....6be9 # ld r11,0x####(r11) + 0x2004804e # bctr + + + + + + 0x..0041f8 # std r2,0x##(r1) + 0x....623d # addis r11,r2,0x#### + 0x....8be9 # ld r12,0x####(r11) + 0xa603897d # mtspr CTR,r12 + 0x....4be8 # ld r2,0x####(r11) + 0x2004804e # bctr + + + + + + 0x..0041f8 # std r2,0x##(r1) + 0x....623d # addis r11,r2,0x#### + 0x....8be9 # ld r12,0x####(r11) + 0x....6b39 # addi r11,r11,0x#### + 0xa603897d # mtspr CTR,r12 + 0x....4be8 # ld r2,0x####(r11) + 0x....6be9 # ld r11,0x####(r11) + 0x2004804e # bctr + + + + + + 0x..0041f8 # std r2,0x##(r1) + 0x....623d # addis r11,r2,0x#### + 0x....8be9 # ld r12,0x####(r11) + 0xa603897d # mtspr CTR,r12 + 0x7862827d # xor r2,r12,r12 + 0x14126b7d # add r11,r11,r2 + 0x....4be8 # ld r2,0x####(r11) + 0x2004804e # bctr + + + + + + 0x..0041f8 # std r2,0x##(r1) + 0x....623d # addis r11,r2,0x#### + 0x....8be9 # ld r12,0x####(r11) + 0x....6b39 # addi r11,r11,0x#### + 0xa603897d # mtspr CTR,r12 + 0x7862827d # xor r2,r12,r12 + 0x14126b7d # add r11,r11,r2 + 0x....4be8 # ld r2,0x####(r11) + 0x....6be9 # ld r11,0x####(r11) + 0x2004804e # bctr + + + + + + + 0x0000823d # addis r12,r2,0x#### + 0x00008ce9 # ld r12,0x####(r12) + 0xa603897d # mtspr CTR,r12 + 0x2004804e # bctr + + + + + + 0x000041f8 # std r2,0x####(r1) + 0x0000823d # addis r12,r2,0x#### + 0x00008ce9 # ld r12,0x####(r12) + 0xa603897d # mtspr CTR,r12 + 0x2004804e # bctr + + + + diff --git a/Ghidra/Processors/PowerPC/data/ppc64-r2CallStubs.xml b/Ghidra/Processors/PowerPC/data/patterns/PPC_LE_prepatterns.xml similarity index 60% rename from Ghidra/Processors/PowerPC/data/ppc64-r2CallStubs.xml rename to Ghidra/Processors/PowerPC/data/patterns/PPC_LE_prepatterns.xml index 5be83ca944..e467dc3a56 100644 --- a/Ghidra/Processors/PowerPC/data/ppc64-r2CallStubs.xml +++ b/Ghidra/Processors/PowerPC/data/patterns/PPC_LE_prepatterns.xml @@ -1,12 +1,52 @@ - + + + + + 0x280041f8 + 0xff 0xff ...00010 001111.. + ........ ........ ........ 0xe9 + 0xa6 0x03 0x.9 0x7d + ........ ........ 010..... 0xe8 + 0x00002228 + 0x20 0x04 1..00010 0x4c + ......00 ........ ........ 010010.. + + + + + + + 0x280041f8 + ........ ........ ........ 0xe9 + 0xa6 0x03 0x.9 0x7d + ........ ........ 010..... 0xe8 + 0x00002228 + 0x20 0x04 1..00010 0x4c + ......00 ........ ........ 010010.. + + + + + + + 0xa6 0x02 ...01000 011111.. + 0x05 0x00 1....... 0x42 + 0xa6 0x02 ...01000 011111.. + 0x.. 0x.. ........ 001111.. + 0x.. 0x.. ........ 001110.. + 0xa6 0x03 ...01000 011111.. + 0xa6 0x03 ...01001 011111.. + 0x20 0x04 10000... 0x4e + + + + @@ -18,6 +58,7 @@ 0xe96c.... # ld r11,0x####(r12) 0x4e800420 # bctr + @@ -28,6 +69,7 @@ 0xe842.... # ld r2,0x####(r2) 0x4e800420 # bctr + @@ -36,6 +78,7 @@ 0x7d8903a6 # mtspr CTR,r12 0x4e800420 # bctr + @@ -46,6 +89,7 @@ 0xe84b.... # ld r2,0x####(r11) 0x4e800420 # bctr + @@ -57,6 +101,7 @@ 0xe96b.... # ld r11,0x####(r11) 0x4e800420 # bctr + @@ -68,6 +113,7 @@ 0xe84b.... # ld r2,0x####(r11) 0x4e800420 # bctr + @@ -81,6 +127,7 @@ 0xe96b.... # ld r11,0x####(r11) 0x4e800420 # bctr + @@ -91,6 +138,7 @@ 0xe84b.... # ld r2,0x####(r11) 0x4e800420 # bctr + @@ -103,6 +151,7 @@ 0xe96b.... # ld r11,0x####(r11) 0x4e800420 # bctr + @@ -115,6 +164,7 @@ 0xe84b.... # ld r2,0x####(r11) 0x4e800420 # bctr + @@ -129,6 +179,7 @@ 0xe96b.... # ld r11,0x####(r11) 0x4e800420 # bctr +