Jump to content
Cartman.

[Dephi]&[ASM]Zeromem Replacement (x86-x64)

Recommended Posts

Posted

This function zero's dwLen starting at pPointer. This is used as replacement for API versions in my shellcode projects.


Procedure ZeroMem(pPointer : Pointer; dwLen : DWORD);stdcall;
//Zeroes Pointer -> Pointer+dwLen
var
i : DWORD;
begin
for i := 0 to dwLen -1 do
begin
pByte(tHandle(pPointer)+i)^ := 0;
end;
end;

and ASM :

ZeroMemoryASM
procedure ZeroMemoryASM(where : pointer; size : cardinal);
begin
ASM
PUSH EAX
PUSH EBX
PUSH ECX
NOP
MOV EAX,where
XOR EBX,EBX
MOV ECX,size

@loopzy
NOP
POP ECX
POP EBX
POP EAX
END;
end;

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...