Advertisement
appo

A simple example call WinAPI with encryption

Dec 27th, 2013
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.08 KB | None | 0 0
  1. program DynamiqueAPI;
  2. uses
  3.   Windows;
  4.  
  5. type
  6.   TMessageBoxA = function(Handle : Cardinal;
  7.                           lpText : PAnsiChar;
  8.                           lpCaption : PAnsiChar;
  9.                           uType : Cardinal) : Cardinal; stdcall;
  10.  
  11. function EnDeCrypt(const Value : String) : String;
  12. var
  13.   CharIndex : integer;
  14. begin
  15.   Result := Value;
  16.   for CharIndex := 1 to Length(Value) do
  17.     Result[CharIndex] := chr(not(ord(Value[CharIndex])));
  18. {Объявление функции простого обратимого шифрования, желательно заменить на что-то более веселое, типа rc4}
  19. end;
  20.  
  21. var
  22.   hUser32 : Cardinal;
  23.   xMessageBoxA : TMessageBoxA;
  24.   sMessageBoxA : PAnsiChar;
  25. begin
  26.   sMessageBoxA := PAnsiChar(EnDeCrypt('²šŒŒž˜š½‡¾'));
  27.   hUser32 := LoadLibraryA('user32.dll');
  28.   @xMessageBoxA := GetProcAddress(hUser32, sMessageBoxA);
  29.   if Assigned(xMessageBoxA) then
  30.     xMessageBoxA(0, 'Hello World', '', 0);
  31. {Вызов функции через обертку}
  32. end.
  33.  
  34. // Coded by molotsnk //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement