Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Partial troubleshooting of Win32::Process::Memory and request for fixes

by Veltro (Hermit)
on Jul 04, 2018 at 23:05 UTC ( [id://1217916]=note: print w/replies, xml ) Need Help??


in reply to Partial troubleshooting of Win32::Process::Memory and request for fixes

Hello Lotus1

I wrote that concern recently. Please note though that I don't know how well these module are maintained exactly. The only thing that I said in my post that some things that I have tried didn't work, so I just expressed my concerns.

Now back to why this may not work...

I think that the problem is in the NT.pm module:

if ($EnumProcessModules->Call ($prchdl, $modhdl, length $modhdl, $ +modgot)) { $modhdl = unpack ('L', $modhdl); my $mfn = ' ' x MAX_PATH; if ($GetModuleFileNameEx->Call ($prchdl, $modhdl, $mfn, length $mf +n)) { $mfn =~ s/\0.*//; $mfn =~ s/^\\(\w+)/$ENV{$1} ? $ENV{$1} : "\\$1"/ex; $mfn =~ s/^\\\?\?\\//; $self->_build_hash ($dat, ExecutablePath => $mfn); my $base = basename ($mfn); $self->_build_hash ($dat, Name => $base) if $base; } }

I think EnumProcessModules is not returning anything in $modhdl. One thing that I don't exactly understand about this code that EnumProcessModules returns an array (according to Microsoft docs). And then there is an unpack statement and passed on to GetModuleFileNameEx which takes a module handle as second argument.

Other things that can be said about EnumProcessModules is that there is also an EnumProcessModulesEx which can be used to get 32-bit processes and 64-bit processes, so there may be the problem as well, that EnumProcessModules is not working on 64-bit

See also this discussion here

So to fix these kind of problems I think that someone may need to have a look at things.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217916]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-10 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found