AutoHotkey Community

It is currently May 24th, 2012, 6:10 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: February 6th, 2007, 1:30 pm 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
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:

Image

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:

Image

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 February 6th, 2007, 3:42 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 3:42 pm 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
bump :P 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!! :D

Adam


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 4:02 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 4:40 pm 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 6:08 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2007, 8:56 am 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2007, 6:10 pm 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
bump :( any ideas?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2007, 9:19 am 
Offline
User avatar

Joined: December 20th, 2004, 12:19 pm
Posts: 794
Location: LooseChange911.com Ask Questions, Demand Answers █ The WTC bldgs █ shouldn't have fallen █ that fast
adamrgolf wrote:
bump :( any ideas?

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

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...

_________________
AutoHotkey-Hotstring.ahk - Helping the world spell "AutoHotkey" correctly! (btw, it's a lowercase k!)


Last edited by JSLover on February 15th, 2007, 9:51 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2007, 9:51 am 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
JSLover,

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

:)

Adam


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, engunneer, Exabot [Bot], rbrtryn, Yahoo [Bot] and 75 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group