aboutsummaryrefslogtreecommitdiff
path: root/elymas/lib
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2015-06-20 21:38:52 +0200
committerDrahflow <drahflow@gmx.de>2015-06-20 21:38:52 +0200
commitaa3bb00f946ecdb89008c07760098089b09f8bca (patch)
tree5655a6ea376a01d6e5a7e842d46a1840aabe1946 /elymas/lib
parentff27332bdd2d06273cdce7ff87d8566c983da980 (diff)
Correctly parse patched FUNCTIONCREATEs
Diffstat (limited to 'elymas/lib')
-rw-r--r--elymas/lib/sys/opt.ey17
1 files changed, 15 insertions, 2 deletions
diff --git a/elymas/lib/sys/opt.ey b/elymas/lib/sys/opt.ey
index d24d111..ef5cdd4 100644
--- a/elymas/lib/sys/opt.ey
+++ b/elymas/lib/sys/opt.ey
@@ -150,6 +150,13 @@
[
8 /r15 :subqImm8Reg
/r15 :popqMem
+ 0 /rdi :movqImmReg
+ 0 :jmpRel8
+ ] ==:customFunctionObjectCreationHeaderPatternPatched
+
+ [
+ 8 /r15 :subqImm8Reg
+ /r15 :popqMem
] ==:customFunctionHeaderPattern
/NOP ==:NOP
@@ -1832,7 +1839,6 @@
canRewrite {
arrayStart i range { ==j [ NOP ] j logic =[] } each
[ RAWCONSTCONDSTHISSCOPE collectedFunctions ] i logic =[]
- /RAWCONSTCONDSTHISSCOPE dump
}' rep
}
] conds
@@ -2240,6 +2246,13 @@
functionBody ::rawObject protectReference
}
+ { customFunctionObjectCreationHeaderPatternPatched callTargetMatch }' {
+ [ calledAddress 9 add _ 8 add range peek each ] 256 math .unbase ==functionBody # function code object address
+
+ [ FUNCTIONCREATE calledAddress functionBody ] emitLogic
+ functionBody ::rawObject protectReference
+ }
+
{ customFunctionHeaderPattern callTargetMatch }' {
[ CALL calledAddress ] emitLogic
}
@@ -2820,7 +2833,7 @@
}
{ action RAWCONSTCONDSTHISSCOPE eq }' {
- 1 entry _ dump ==functions
+ 1 entry ==functions
{ =*function
[