Jump to content

DllCallAddress - Calling process function


Recommended Posts

Hi,

I have some trouble with calling a process function:

0093F470 :: GetUIElementByHash($hash)

How exactly can I call that function with $hash parameter?

$hash is 64 bit

My script crashes every time I try to call:

$hash = 'A53AF1388A1C1CBA'

$result = DllCallAddress("INT", 0x0093F470, "HWND", $hWnd, "INT64", $hash)

I know I'm doing something wrong...

[indent=3][/indent]

Link to comment
Share on other sites

Okay I got info that it should be done in some other way similar to that:

#include './[Includes]/_ProcessCreateRemoteThread.au3'
#include './[Includes]/_ProcessFunctions.au3'

$pID = WinGetProcess("Application")

$hProcess = _ProcessOpen($pID,0x043A,False)

$hash = 'A53AF1388A1C1CBA'
$address = 0x0093F470

$result = _ProcessCreateRemoteThread($hProcess,$address,$hash,False,0,False)
_ProcessCloseHandle($hProcess)

MsgBox(0,'Result',$result)

But all what I got it's "0". How to get 0x0093F470 function's return?

[indent=3][/indent]

Link to comment
Share on other sites

_ProcessCreateRemoteThread() probably returns an handle to the thread instead of the return code. If it returns 0, that probably is an error. Ensure both your and the targeted program is same bitness. If you successfully get an handle, you should call WaitForSingleObject on the handle to wait while the thread does its thing, and then close the handle afterwards.

Also, the function you're calling must be stdcall, must accept one pointer-sized parameter and return a dword.

Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...