Committed new register_native system

This commit is contained in:
David Anderson
2005-07-31 20:11:58 +00:00
parent 34acc54cc9
commit abfca025d5
15 changed files with 745 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; (C)2005 by David "BAILOPAN" Anderson ;
; register_native functions for x86 ;;;;;;
; Based on the concept by Julien "dJeyL" Laurent ;
; (C)2005 by David "BAILOPAN" Anderson ;
; register_native functions for x86 ;;;;;;
; Based on the concept by Julien "dJeyL" Laurent ;
; Thanks to T(+)rget for pushing me to implement this ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -11,6 +11,8 @@
;;Initializes the global variable
section .text
global amxx_DynaInit, _amxx_DynaInit
;void amxx_DynaInit(void *ptr);
amxx_DynaInit:
@@ -43,8 +45,8 @@ _amxx_DynaMake:
rep movsb
mov edi, [ebp+8] ;get buffer again
;align us to mov eax, 1234
add edi, _amxx_DynaMoveOffset + 1
;align us to mov eax, 1234 - on x86 this is 4 bytes
add edi, (_amxx_DynaMoveOffset-_amxx_DynaFuncStart) + 1
mov eax, [ebp+12]
mov [edi], eax
@@ -73,6 +75,7 @@ _amxx_DynaMoveOffset:
push dword [ebp+8] ;push amx
push eax ;push the id
call [GLOBAL_GATE] ;pass through teh global gateway.
add esp, 12 ;reset stack oops
pop ebp
ret
@@ -86,6 +89,7 @@ _amxx_DynaCodesize:
push ebp
mov ebp, esp
; on x86 is this 17 bytes
mov eax, _amxx_DynaFuncEnd - _amxx_DynaFuncStart
pop ebp