Jump to content
Sign in to follow this  
ReubenParsons

Using DLLOpen with an unpacked dll file

Recommended Posts

ReubenParsons

My script requires a dll file that is called during function. It is currently unpacked to system32 however this is sometimes registered as malicious. Also when attempting to cleanup on close(I dont want to leave an unused file floating around) the delete from system32 is always flagged as malicious.

Really what i want is for some way to call a local dll from ./ directory so i can avoid the windows folder altogether.

EDIT:Corrected typo

Edited by ReubenParsons

Share this post


Link to post
Share on other sites
ReubenParsons

Sorry, I need to call a DLL using the script. It says somewhere I read that they find them in localdir but when I tried that the script did not find the dll. Quite simply I want to FileInstall a .dll somewhere that wont set off any alarms with the antivirus programs then open it with DLLOpen then delete it all in one script. I know how to do all three things but I need to know which dirctories are valid for DLLOpen.

EDIT: I was using @systemdir because I know autoit will find a dll file from there.

Edited by ReubenParsons

Share this post


Link to post
Share on other sites
Werty

Take a look at Ward's that way you dont need a file at all.

Share this post


Link to post
Share on other sites
AdmiralAlkex

It says somewhere I read that they find them in localdir but when I tried that the script did not find the dll.

Well, it should have, so you did something wrong. Did you use a full path? Post a reproducer (fully working example script that shows your problem).

Share this post


Link to post
Share on other sites
ReubenParsons

Take a look at Ward's that way you dont need a file at all.

This does not look like it will function with my DLL. My DLL has more than 4 parameters.

And the dll it isn't made by me.

Also looks more complicated than I really wanted

Right now I want to be able to share my script with some non techie friends without having to explain to them how to use those funky dll files and put it into that risky system32 folder - yes ignore the warning message i know what i'm doing- or say, no allow it through the antivirus it's a false positive. ETC.

Share this post


Link to post
Share on other sites
ReubenParsons

Well, it should have, so you did something wrong. Did you use a full path? Post a reproducer (fully working example script that shows your problem).

It worked when run from the autoit program, when the .au3 was saved in the same folder, as soon as I compiled to .exe it lost that functionality. Can I use full path in DLLOpen? If i can then that would solve my problem. simply change DLLOpen("imagesearch.dll") to DLLOpen("./imagesearch.dll")?

Also sorry I meant @scriptdir.

Share this post


Link to post
Share on other sites
monoscout999

try running with administrator rights... i am not sure about this, but try it costs nothing

Share this post


Link to post
Share on other sites
ProgAndy

Never install a DLL in system32. Always use @TempDir, @AppDataDir or @ScriptDir. Only with @TempDir or @AppDataDir you can be sure to have the required rights to write to disk.

FileInstall("mydll.dll", @TempDir & "\myspecialdll.dll")
$hDLL = DllOpen(@TempDir & "\myspecialdll.dll")
Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
ReubenParsons

try running with administrator rights... i am not sure about this, but try it costs nothing

It already runs with administrator rights.

And thanks Andy I'll see how that goes next chance I get.

Edited by ReubenParsons

Share this post


Link to post
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
Sign in to follow this  

×