Pastebin

New pastes are no longer accepted · Stats

Latest Pastes

EOAddons

{(
 )) EOAddons.pas
((    A quick and dirty "header" for EO.Addons
 ))   ...now quit nagging me! XD
((
 )) by Lady Sordie Aranka Solomon-Smith of Bavant © 2010
((  sordie@sordie.com
 )}

unit EOAddons;

// Projects should be compiled as dynamic link libraries with the .eaf extension
{$E eaf}

// NOTE: This file assumes PChar points to wide character strings.

// Define your requirements here
{$DEFINE EditMem}
{$DEFINE HookAPI}
{$DEFINE WindowHook}

interface

// Calling this function will display your addons status in the splash window.
// if EOConsole.eaf is enabled the status string will also be echoed there.
procedure SetStatus(S: PChar); stdcall; external 'msimg32.dll';

{$IFDEF EditMem}
// This will allow writing to any part of the clients memory.
// Memory locking flags are adjusted during this call but are are preserved upon return
function EditMem(Addr: Cardinal; Data: PAnsiChar; Size: Integer): Boolean; stdcall; external 'EOEditMem.eaf';
{$ENDIF}

{$IFDEF HookAPI}
// This function will create a JMP patch and copy of the original code (patched for correct memory locations)
// of any API function loaded within the clients context. The "OldProc" should be called to allow any other
// addons to chain hook the API
// NOTE: Some API used by EO.Addons (such as LoadLibrary) cannot be hooked.
function HookAPI(ModName, APIName: PChar; NewProc: Pointer; var OldProc: Pointer): Boolean; stdcall; external 'EOAPIHook.eaf';
// TODO: UnhookAPI
{$ENDIF}

{$IFDEF WindowHook}
// Returns the clients window handle or null if the window hasn't been created yet.
// This function will always return the handle of the Window for the current process only.
function GetEOWindow: HWND; stdcall; external 'EOWindowHook.eaf';
// TODO: function HookMessage
// TODO: function AddMenuItem
{$ENDIF}

implementation

end.