Einzelnen Beitrag anzeigen

randy_dom

Registriert seit: 28. Apr 2008
17 Beiträge
 
#1

is there any error in this function

  Alt 20. Mär 2012, 12:38
Delphi-Version: 7
here is my function

Delphi-Quellcode:
Function call_to_func(mem, a, c: DWORD): integer;
var
b: integer;
begin
b := 0;
writeln(format('call_to_func: mem=%X a=%X c=%X',[mem,a,c]));
asm
mov ecx,a
mov edx,c
mov eax, mem
push ecx
call eax //--->!!! Program try to call assembled code which is stored in mem pointer
pop ecx
mov b, eax
end;
call_to_func := b;
end;
But when i call it i get an AV

Access violation at address 01496180. Write of address 01496180
...........
01496180 push esi ; <-- EXCEPTION
............

call_to_func works correctly
and assembled function called by "call eax"
but this assembled function can not push register??!!
stack not writeable???
All this under windows 7 .


Please is there any error in the above Function ?


many thanks
  Mit Zitat antworten Zitat