Board index » Visual Studio » How to Retrieve Module Name

How to Retrieve Module Name

Visual Studio79
Hi all, i have a question for a my program of process information,

probably is a bit complex, hope someone know it and can help me, Some

program often uses various modules or dll to do some function, i need

a method to retrieve the module name used by a program writing the

memory location, for example, i have an application "blabla.exe" and

if i write in my program a memory location of this application for

example 10ABBF i wanna know the module name used by this application,

that sometimes can be a .dll file.

Greetings.


-
 

Re:How to Retrieve Module Name



"paraidy" <samoretta@tiscali.it>wrote in message

Quote
Hi all, i have a question for a my program of process information,

probably is a bit complex, hope someone know it and can help me, Some

program often uses various modules or dll to do some function, i need

a method to retrieve the module name used by a program writing the

memory location, for example, i have an application "blabla.exe" and

if i write in my program a memory location of this application for

example 10ABBF i wanna know the module name used by this application,

that sometimes can be a .dll file.

Greetings.



I for one have NO idea what you just said/asked. Try rephrasing.



--

Mike

Microsoft MVP Visual Basic





-

Re:How to Retrieve Module Name

On Tue, 5 Feb 2008 15:58:14 -0500, "MikeD" <nobody@nowhere.edu>wrote:



Quote


"paraidy" <samoretta@tiscali.it>wrote in message

news:236ea17a-c11e-4c9a-9574-93159b647b5d@f47g2000hsd.googlegroups.com...

>Hi all, i have a question for a my program of process information,

>probably is a bit complex, hope someone know it and can help me, Some

>program often uses various modules or dll to do some function, i need

>a method to retrieve the module name used by a program writing the

>memory location, for example, i have an application "blabla.exe" and

>if i write in my program a memory location of this application for

>example 10ABBF i wanna know the module name used by this application,

>that sometimes can be a .dll file.

>Greetings.



I for one have NO idea what you just said/asked. Try rephrasing.



Sounds like the OP is writing a process explorer type app and wants to,

by checking a particular memory location of another 'loaded'

process/app, find the 'calling' module/dll.



I have no idea if that's right or even possible :)

--

Alfie [UK]

<www.delphia.co.uk/>">www.delphia.co.uk/>

Remember my name...You'll be screaming it later.



-

Re:How to Retrieve Module Name

On 5 Feb, 21:58, "MikeD" <nob...@nowhere.edu>wrote:

Quote
"paraidy" <samore...@tiscali.it>wrote in message



news:236ea17a-c11e-4c9a-9574-93159b647b5d@f47g2000hsd.googlegroups.com...



>Hi all, i have a question for a my program of process information,

>probably is a bit complex, hope someone know it and can help me, Some

>program often uses various modules or dll to do some function, i need

>a method to retrieve the module name used by a program writing the

>memory location, for example, i have an application "blabla.exe" and

>if i write in my program a memory location of this application for

>example 10ABBF i wanna know the module name used by this application,

>that sometimes can be a .dll file.

>Greetings.



I for one have NO idea what you just said/asked. Try rephrasing.



--

Mike

Microsoft MVP Visual Basic



For Example, some games load various dll modules in memory, if in my

program i write in a textbox the name of a game, i wanna know all

modules that this game use, and if i write in another textbox i write

for example 10ACD i want to know what module is loaded in that

location, i know some programs that can do this, but i don't know is

it's possible in VB6

-

Re:How to Retrieve Module Name

paraidy wrote:

Quote
On 5 Feb, 21:58, "MikeD" <nob...@nowhere.edu>wrote:

>"paraidy" <samore...@tiscali.it>wrote in message

>

>news:236ea17a-c11e-4c9a-9574-93159b647b5d@f47g2000hsd.googlegroups.com...

>

>>Hi all, i have a question for a my program of process information,

>>probably is a bit complex, hope someone know it and can help me, Some

>>program often uses various modules or dll to do some function, i need

>>a method to retrieve the module name used by a program writing the

>>memory location, for example, i have an application "blabla.exe" and

>>if i write in my program a memory location of this application for

>>example 10ABBF i wanna know the module name used by this application,

>>that sometimes can be a .dll file.

>>Greetings.

>

>I for one have NO idea what you just said/asked. Try rephrasing.

>

>--

>Mike

>Microsoft MVP Visual Basic



For Example, some games load various dll modules in memory, if in my

program i write in a textbox the name of a game, i wanna know all

modules that this game use, and if i write in another textbox i write

for example 10ACD i want to know what module is loaded in that

location, i know some programs that can do this, but i don't know is

it's possible in VB6



--

.NET: It's About Trust!

vfred.mvps.org">vfred.mvps.org





-

Re:How to Retrieve Module Name

paraidy wrote:

Quote
For Example, some games load various dll modules in memory, if in my

program i write in a textbox the name of a game, i wanna know all

modules that this game use, and if i write in another textbox i write

for example 10ACD i want to know what module is loaded in that

location, i know some programs that can do this, but i don't know is

it's possible in VB6



This can get real ugly real fast, but it's doable. On NT platforms, anyway. Not

sure about 9x.



You'd start with EnumProcesses, to find the process of interest. Once you have

that, you'll use EnumProcessModules, to get handles for each loaded module in that

process. With those, you can query each using calls like GetModuleBaseName,

GetModuleFileNameEx, GetModuleInformation, and GetModuleMemoryInformation.

Somewhere in there, is most of what you're looking for, if not all of it.



Have fun...

--

.NET: It's About Trust!

vfred.mvps.org">vfred.mvps.org





-

Re:How to Retrieve Module Name

On 6 Feb, 19:17, "Karl E. Peterson" <k...@mvps.org>wrote:

Quote
paraidy wrote:

>For Example, some games load various dll modules in memory, if in my

>program i write in a textbox the name of a game, i wanna know all

>modules that this game use, and if i write in another textbox i write

>for example 10ACD i want to know what module is loaded in that

>location, i know some programs that can do this, but i don't know is

>it's possible in VB6



This can get real ugly real fast, but it's doable. On NT platforms, anyway. Not

sure about 9x.



You'd start with EnumProcesses, to find the process of interest. Once you have

that, you'll use EnumProcessModules, to get handles for each loaded module in that

process. With those, you can query each using calls like GetModuleBaseName,

GetModuleFileNameEx, GetModuleInformation, and GetModuleMemoryInformation.

Somewhere in there, is most of what you're looking for, if not all of it.



Have fun...

--

.NET: It's About Trust!

vfred.mvps.org">vfred.mvps.org



Thx i'll take a look to these functions, thx a lot! :)

-

Re:How to Retrieve Module Name



"Karl E. Peterson" <karl@mvps.org>wrote in message

Quote
paraidy wrote:

>For Example, some games load various dll modules in memory, if in my

>program i write in a textbox the name of a game, i wanna know all

>modules that this game use, and if i write in another textbox i write

>for example 10ACD i want to know what module is loaded in that

>location, i know some programs that can do this, but i don't know is

>it's possible in VB6



This can get real ugly real fast, but it's doable. On NT platforms,

anyway. Not sure about 9x.



You'd start with EnumProcesses, to find the process of interest. Once you

have that, you'll use EnumProcessModules, to get handles for each loaded

module in that process. With those, you can query each using calls like

GetModuleBaseName, GetModuleFileNameEx, GetModuleInformation, and

GetModuleMemoryInformation. Somewhere in there, is most of what you're

looking for, if not all of it.



Have fun...

--

.NET: It's About Trust!

vfred.mvps.org">vfred.mvps.org



From the way he's expressed the question it looks to me like he wants to

determine dependencies on games/programs which may not be running at that

time. Sounds like a job for the Depends applet that shipped with VS6 but

possibly one with a friendlier UI.







Regards



Dave O.





-