Memory.CallFunction

variant Memory.CallFunction ( 

number  ID,

variant  Arg1,

variant  Arg2,

variant  ...,

variant  ArgN )

Description

Calls a function in a dynamically linked library (DLL, ...). It can be used to extend AutoPlay's functionality with your own functions.

Parameters

ID

(number) Number of your opened dll that before .OpenFunction returned it.

Arg1

(variant) First argument of function that just can be number or string.

Arg2

(variant) Second argument of function that just can be number or string.

ArgN

(variant) Nth argument of function that just can be number or string.

Returns

(variant) Return a byte, char, long, int, string or short value depends on that function you open.

ResultVariable

When adding an action with the script editor, you can use this field to specify a variable that the return value will be stored in.

Note: For now this method just can pass number or string in this version there is no datatype, for now sorry.

Note: This api is amazing you can call functions with real parameter this is simple that IR team method(that you must pass all parameters in one string parameter).

Example 1

-- Call MessageBoxA Function With 4 Parameters Memory.OpenLibrary(0, "user32.dll") a = Memory.OpenFunction(0, "MessageBoxA", DLL_CALL_STDCALL, DLL_RETURN_INT) Memory.CallFunction(a, Application.GetWndHandle(), "Test", "Test From AMSWaves", 36) Memory.CloseLibrary(0)

Example 2

-- Call beep Function With 2 Parameters Memory.OpenLibrary(0, "kernel32.dll") a = Memory.OpenFunction(0, "Beep", DLL_CALL_STDCALL, DLL_RETURN_INT) Memory.CallFunction(a, 3000, 1000) Memory.CloseLibrary(0)

Example 3

-- Load a HYPOTHETICAL DLL that is coded on Base64 method and want load on memory My_Base64_Dll = TextFile.ReadToString("AutoPlay\\Docs\\Base64DLL.txt") Memory.OpenLibrary(0, My_Base64_Dll) -- Call its AMSWaves function (HYPOTHETICAL) With no Parameters and return String a = Memory.OpenFunction(0, "AMSWaves", DLL_CALL_STDCALL, DLL_RETURN_STRING) result = Memory.CallFunction(a) Memory.CloseLibrary(0)

See also:  Related Actions

Сайт управляется системой uCoz