appo icon

A simple example call WinAPI with encryption

appo | PRO | 12/27/13 11:35:30 PM UTC | 0 ⭐ | 6946 👁️ | Never ⏰ | []
Delphi |

1.08 KB

|

None

|

0 👍

/

0 👎

program DynamiqueAPI;
uses
  Windows;
 
type
  TMessageBoxA = function(Handle : Cardinal;
                          lpText : PAnsiChar;
                          lpCaption : PAnsiChar;
                          uType : Cardinal) : Cardinal; stdcall;
 
function EnDeCrypt(const Value : String) : String;
var
  CharIndex : integer;
begin
  Result := Value;
  for CharIndex := 1 to Length(Value) do
    Result[CharIndex] := chr(not(ord(Value[CharIndex])));
{Объявление функции простого обратимого шифрования, желательно заменить на что-то более веселое, типа rc4}
end;
 
var
  hUser32 : Cardinal;
  xMessageBoxA : TMessageBoxA;
  sMessageBoxA : PAnsiChar;
begin
  sMessageBoxA := PAnsiChar(EnDeCrypt('²šŒŒž˜š½‡¾'));
  hUser32 := LoadLibraryA('user32.dll');
  @xMessageBoxA := GetProcAddress(hUser32, sMessageBoxA);
  if Assigned(xMessageBoxA) then
    xMessageBoxA(0, 'Hello World', '', 0);
{Вызов функции через обертку}
end.
 
// Coded by molotsnk //

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎