AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DllCall Help -- Multi-Monitor Switch Library

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
adamrgolf



Joined: 28 Dec 2006
Posts: 440

PostPosted: Tue Feb 06, 2007 12:30 pm    Post subject: DllCall Help -- Multi-Monitor Switch Library Reply with quote

I've got a program that runs with my Acer laptop. it basically controls the function + whatever keys on the keyboard, as well as volume buttons and such

well, it appears that it uses MMDutl.dll (Dritek System Inc. Multi-Monitor Switch Library.) to manage switching between the laptop's lcd, laptop's lcd + external monitor, or just the external monitor.

i can press Fn + F5 while my "launch mananager" program is running to get this:



that works exactly like alt + tab, accept fn is the alt and f5 is the tab...

anyway, when the lanch manager is not running it will not work... so i thought id like to learn how to call the dll to do what the launch mananger is doing w/o using the launch manager.

i found a DLL Export viewer to find the functions used by this DLL, adn they are:



but i have no idea how to call those functions or anything :S

anyway, there is just an image folder withing the launch manager directory that it uses for the images

Any idea how i can re-create this with a dll call? i have NO idea how to even start since i have never used dll calls and i'm having trouble understanding them

Any help is very much appreciated!

Thanks!!

Adam


Last edited by adamrgolf on Tue Feb 06, 2007 2:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
adamrgolf



Joined: 28 Dec 2006
Posts: 440

PostPosted: Tue Feb 06, 2007 2:42 pm    Post subject: Reply with quote

bump Razz anyone have at least a starting point for me to try out? I'm having a hard time grasping what i should be typing in for the dllcall parameters.

Thanks!! Very Happy

Adam
Back to top
View user's profile Send private message
Helpy
Guest





PostPosted: Tue Feb 06, 2007 3:02 pm    Post subject: Reply with quote

Alas, the info given by the DLL Export Viewer is not enough, as it doesn't show (and cannot) which parameters are necessary. Without these (number of parameters, their type), you cannot use the functions.

Try to google for your DLL name to see if somebody published an API.
Back to top
adamrgolf



Joined: 28 Dec 2006
Posts: 440

PostPosted: Tue Feb 06, 2007 3:40 pm    Post subject: Reply with quote

i cant find any API information via google on this particular dll, i did find something in IDA after disassembling this DLL that looks similar to what the dllcall help file syntax looks like

Code:
DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)


or this

Code:
 Attributes: library function
.text:100078F0
.text:100078F0 ; public: __thiscall strstreambuf::strstreambuf(char *, int, char *)


or maybe this:

Code:
BOOL __stdcall DialogFunc(HWND,UINT,WPARAM,LPARAM)


also found an instance of post message:

Code:
PostMessageA(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam)


does that mean anything to anyone?
Back to top
View user's profile Send private message
Helpy
Guest





PostPosted: Tue Feb 06, 2007 5:08 pm    Post subject: Reply with quote

DllMain is mandatory in all DLLs.
strstreambuf::strstreambuf looks like a standard C++ method.
DialogFunc is probably just an internal handle of the dialog message pump.
PostMessageA is a standard WinAPI.

Basically, you had a good idea, but you must look for the functions you shown in the first message.
Back to top
adamrgolf



Joined: 28 Dec 2006
Posts: 440

PostPosted: Wed Feb 14, 2007 7:56 am    Post subject: Reply with quote

i found this in IDA for the "Run" function, which produces the first image in my first post. Can anyone tell if the information needed to create a DllCall to recreate this is maybe in this section of IDA dissassembled code?:

Code:
.text:003C5350 ; Exported entry   3. MMDUtl_Run
.text:003C5350
.text:003C5350 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
.text:003C5350
.text:003C5350
.text:003C5350                 public MMDUtl_Run
.text:003C5350 MMDUtl_Run      proc near
.text:003C5350                 mov     eax, dword_3D5F98
.text:003C5355                 test    eax, eax
.text:003C5357                 jz      short loc_3C5375
.text:003C5359                 mov     ecx, offset dword_3D5F9C
.text:003C535E                 call    sub_3C1C20
.text:003C5363                 test    eax, eax
.text:003C5365                 mov     ecx, offset dword_3D5F9C
.text:003C536A                 jnz     short loc_3C5378
.text:003C536C                 call    sub_3C3C30
.text:003C5371                 test    eax, eax
.text:003C5373                 jnz     short loc_3C537D
.text:003C5375
.text:003C5375 loc_3C5375:                             ; CODE XREF: MMDUtl_Run+7j
.text:003C5375                 xor     eax, eax
.text:003C5377                 retn
.text:003C5378 ; ---------------------------------------------------------------------------
.text:003C5378
.text:003C5378 loc_3C5378:                             ; CODE XREF: MMDUtl_Run+1Aj
.text:003C5378                 call    sub_3C2580
.text:003C537D
.text:003C537D loc_3C537D:                             ; CODE XREF: MMDUtl_Run+23j
.text:003C537D                 mov     eax, 1
.text:003C5382                 retn
.text:003C5382 MMDUtl_Run      endp
.text:003C5382
.text:003C5382 ; ---------------------------------------------------------------------------
.text:003C5383                 align 10h


Or maybe can anyone take a guess at a dllcall example i could try with this just to see if it works? Something like:

Code:
SetWorkingDir,C:\adam\ahk
res := DLLCall("volume_osd\vosdLaunch Manager\vosdLaunch Manager\MMDUtl.dll\MMDUtl_Run")
msgbox % "errorlevel: " errorlevel "`nresult: " res


which returns 0 for error level and result, but maybe with some extra parameters i could try out
Back to top
View user's profile Send private message
adamrgolf



Joined: 28 Dec 2006
Posts: 440

PostPosted: Wed Feb 14, 2007 5:10 pm    Post subject: Reply with quote

bump Sad any ideas?
Back to top
View user's profile Send private message
JSLover



Joined: 20 Dec 2004
Posts: 634
Location: LooseChange911.com The WTC bldgs shouldn't have fallen that fast. The official story is a lie!

PostPosted: Thu Feb 15, 2007 8:19 am    Post subject: Reply with quote

adamrgolf wrote:
bump Sad any ideas?

...only 1...assembly language...

DLL function parameters - borland.public.delphi.winapi | Google Groups wrote:
Van Opstal Yves schrieb:

> Can anyone tell me if there is a program or any other way I can get the
> function parameters from an exported function in an undocumented DLL ???

Yes: no. Unless you do a lot of disassembling.

-Michael
...but it looks like you've already disassemled it into something, but it don't help me know what those params are...only other thing to try is some SysInternals (now Microsoft eek!) program that I think could watch DLL calls...but I can't think of the exact program or if I'm just confused, but I know there's a RegMon & FileMon, so perhaps there's a DLL-call monitor...Process Explorer? (more: Process Monitor, SysInternals - Process & Thread Utils)...that will show which DLLs are loaded, hopefully it can list the actual calls & maybe the params of the call...I dunno...haven't installed/used many SysInternals progs yet...
_________________

Home • Click image! • Blog


Last edited by JSLover on Thu Feb 15, 2007 8:51 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
adamrgolf



Joined: 28 Dec 2006
Posts: 440

PostPosted: Thu Feb 15, 2007 8:51 am    Post subject: Reply with quote

JSLover,

Thanks for the help! I'll check into the information you posted and see what i can find.

Smile

Adam
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group