diff options
| author | Drahflow <drahflow@gmx.de> | 2015-06-20 21:38:52 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2015-06-20 21:38:52 +0200 |
| commit | aa3bb00f946ecdb89008c07760098089b09f8bca (patch) | |
| tree | 5655a6ea376a01d6e5a7e842d46a1840aabe1946 | |
| parent | ff27332bdd2d06273cdce7ff87d8566c983da980 (diff) | |
Correctly parse patched FUNCTIONCREATEs
| -rw-r--r-- | elymas/lib/sys/opt.ey | 17 |
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 [ |
