Joke Collection Website - Public benefit messages - The method of finding the address of process module with easy language.

The method of finding the address of process module with easy language.

Send you a source code with this ~

Version 2

. The subroutine GetModule, integer type,, returns the module address of the specified module in the specified process.

. Parameter ProcessID, integer type.

Parameter module name, text type

. Local variable hObject, integer.

. Local variable ModuleEntry32, module address _

. Local variable module, module address _

Clear the array (module)

Hoobject = API _ createtoolhelp32 snapshot (8, processid)' If the id is 0, it means the current process.

ModuleEntry32。 Structure size = 1024.

. If true (find the first 32-bit module _(ho object, ModuleEntry32))

. Cyclic judgment takes precedence ()

. If true (converted to lowercase (converted to text (ModuleEntry32. Module name)) = lowercase (module name))

API_CloseHandle (hObject)

Return (ModuleEntry32。 Module handle)

If it's over.

Loop judgment tail (find the next 32-bit module _(ho object, ModuleEntry32))

If it's over.

API_CloseHandle (hObject)

Debugging output (module)

Return (0)

You can get it by calling "GetModule" directly after pasting.