Code:
unit uAntiDump;
interface
uses
Winapi.Windows;
procedure FuncInArray; assembler;
procedure WriteShit(MyFunction: Pointer; SizeOfFunction: Cardinal);
implementation
procedure FuncInArray; assembler;
asm
DB $90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90
DB $90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90
DB $90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90,$90
end;
procedure WriteShit(MyFunction: Pointer; SizeOfFunction: Cardinal);
const
instrIncDec : Array[0 .. 3] of Byte = ($40, $48, $43, $4B);
instrMovExx : Array[0 .. 3] of Byte = ($8B, $C0, $8B, $DB);
instrPUSHPOP: Array[0 .. 3] of Byte = ($50, $58, $53, $5B);
instrAntiJMP: Array[0 .. 3] of Byte = ($EB, $00, $8A, $C0);
instrOrOr : Array[0 .. 3] of Byte = ($09, $C9, $09, $D2);
var
OldProtect: Cardinal;
i: Cardinal;
begin
if VirtualProtect(MyFunction, SizeOfFunction, PAGE_EXECUTE_READWRITE, OldProtect) then
begin
for i := 0 to (SizeOfFunction div 4) -1 Do
begin
case Random(4) of
0: PDWORD(Pointer(DWORD(MyFunction) + (i * 4)))^ := PDWORD(@instrIncDec)^;
1: PDWORD(Pointer(DWORD(MyFunction) + (i * 4)))^ := PDWORD(@instrMovExx)^;
2: PDWORD(Pointer(DWORD(MyFunction) + (i * 4)))^ := PDWORD(@instrPUSHPOP)^;
3: PDWORD(Pointer(DWORD(MyFunction) + (i * 4)))^ := PDWORD(@instrAntiJMP)^;
4: PDWORD(Pointer(DWORD(MyFunction) + (i * 4)))^ := PDWORD(@instrOrOr)^;
end;
end;
VirtualProtect(MyFunction, SizeOfFunction, OldProtect, OldProtect)
end;
end;
end.
i dont remeber who coded it, but i think its DeepBlueSee ;)