Jump to content

How can i call to internal function with DllCall() ?


Guest
 Share

Recommended Posts

Hello,

 
A few months ago I found in this forum a method how to call to internal function using DllCall().
 
i can't find the method again ..
I did a search but could not find it. (I forgot to save it)

Anyone know how to do it?

 

If I'm not clear enough, then here more explanation of what I want to do:

Suppose I have this code:

EDIT:

Oops ...

Sorry,
I accidentally opened the thread in the wrong place .. >_<

Please move the thread to the help and support area.

It happened because I was looking for this at the Example Scripts area and then when i decided to ask for it, i forgot to go to the help and support area.

Edited by Guest
Link to comment
Share on other sites

thanks, i will test it and see if this is what i want.

 

Oops ...

Sorry,
I accidentally opened the thread in the wrong place .. >_<

Please move the thread to the help and support area.

It happened because I was looking for this at the Example Scripts area and then when i decided to ask for it, i forgot to go to the help and support area.

 

EDIT:

I did not find what I wanted in IE.au3.

can you give me a short example?
Or tell me where to look?

Edited by Guest
Link to comment
Share on other sites

thanks, i will test it and see if this is what i want.

 

Oops ...

Sorry,

I accidentally opened the thread in the wrong place .. >_<

Please move the thread to the help and support area.

It happened because I was looking for this at the Example Scripts area and then when i decided to ask for it, i forgot to go to the help and support area.

 

EDIT:

I did not find what I wanted in IE.au3.

can you give me a short example?

Or tell me where to look?

If I get what you're asking, you want to use an autoit script like a dll?

If so you need to write a script containing the functions you want to call, then add command line processing for each, so the resulting exe can pass the parameters to the function. You can use consolewrite() to output and data. Then simply run() the executable with the parameters and the '0x1 + 0x2' flag.

I don't know of any dll that allows you to call custom functions from your autoit script.

You can use autoitx.dll to call autoit functions, but only existing ones, and it's intended for other languages, as using it inside autoit would be redundant.

Link to comment
Share on other sites

You asked good questions.
So is the purpose and why I need it -

as part in Obfuscation & anti manual debugging & confusion technique, i need to call to MsgBox with these parameters:

MsgBox(16,"Error","Unknown Error")

but because it's also for anti manual debugging, i need to hide the MsgBox function.

and because MsgBox is a autoit native function, the obfuscator can't hide this function by change the name of the function.

so i need to call the function in a way that i can hide it. and it can be done if i can call to the function if the function is written as string.

so call the function using the Call() function can be the solution. but i don't want to use the Call() function because i also want to hide the Call() function and i can't do it for the same reason.

so the solution is to use a replacement for the Call() function and the replacement can be obfuscated by obfuscator.

this way i can call

MsgBox(16,"AutoIt Error","Unknown Error")

and also completely obfuscate this line.

EDIT:

i found the solution!

this line can be completely obfuscated :
 

_WinAPI_MsgBox(16,"AutoIt Error","Unknown Error")

And it work exactly the same!

Edited by Guest
Link to comment
Share on other sites

From the AutoIt help for _WinAPI_MsgBox function in the Remarks: "This function produces (IMO) a better looking message box. ...".

Well this example should look twice as good as the message box.  And it work exactly the same!

To see the full extent of the irony of this example, see the workings of the _WinAPI_MsgBox function in the WinAPI.au3 include file.

#include <WinAPI.au3>

_gil900_MsgBox(16, "AutoIt Error", "Unknown Error")


Func _gil900_MsgBox($iFlags, $sTitle, $sText)
    _WinAPI_MsgBox($iFlags, $sTitle, $sText & "      ")
EndFunc   ;==>_gil900_MsgBox
Link to comment
Share on other sites

You basically need to figure out which API's a native function is using and look it/them up on MSDN for the parameters.

Good luck "hiding" the strings needed for dllcall, and Gui* functions.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

thanks but i don't need to work hard on the msgbox looking.

the fake error triggers this system:

so you don't really see this msgbox :)

this is still enough.

Edited by Guest
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...