| Posted on 2005-08-26 16:14:56-07 by alela |
| Any documentation about this module? |
|
I need to access a number (a floating one, or maybe an integer) within a windows application.
I thought that this module would be adecuate an I installed it.
So far I could not understand what the module doeas. I am not much skilled in memory managing and I tried to play a bit with the sentences written in the module examples:
my %memlist = $proc->get_memlist;
printf " %08X -> %08X : Len=0x%X\n", $_, $_+$memlist{$_}, $memlist{$_}
foreach (sort {$a <=> $b} keys %memlist);
and with:
print $proc->hexdump($from, $len);
$getvalue = $proc->get_i16($from, $undef_val);
Anyway I could'nt find a way of getting the number (it is a number like
122356, always positive, lying somewhere in the
memory map of the application).
Maybe I am not gettin the complete memory allocated by the program.
Could someone please point me to any source of knowledge about it. Is there any
discussion group a propos?
Alejandro Santillan
PS: I am adding below the script I am using on a windows XP box, but whose output I do not understand:
================================================================================================
#first install the modules via ppm by executing this
#commands below on a dos window:
#ppm install http://www.bribes.org/perl/ppm/Win32-Process-Memory.ppd
#ppm install http://www.bribes.org/perl/ppm/Win32-Process-Info.ppd
#ppm install http://www.bribes.org/perl/ppm/Win32-API.ppd
use Win32::Process::Memory;
use Win32::Process::Info; #is it needed?
# open process
my $proc = Win32::Process::Memory->new({ name=>'cmd.exe' });
# my $proc = Win32::Process::Memory->new({ pid => 2676 });
# do debug
printf "\nTotal Memory = 0x%X\n", $proc->get_memtotal;
print "\nMemory block list:\n";
my %memlist = $proc->get_memlist;
printf " %08X -> %08X : Len=0x%X\n", $_, $_+$memlist{$_}, $memlist{$_}
foreach (sort {$a <=> $b} keys %memlist);
print "\nContent of 0x10004 -> 0x10103\n";
print $proc->hexdump(0x10004, 0x100);
#ale
# print $proc->hexdump(0x10004, 0xF00);
#finale
# search a sequence of unsigned int16
print "\nFind a sequence of unsinged int16:\n";
my @results = $proc->search_u16(92, 87, 105, 110, 51, 50);
print $proc->hexdump($_, 0x32)."\n" foreach @results;
# read and change value
printf "\n0x%X [unsigned int16] : %d\n", 0x10004, $proc->get_u16(0x10004);
printf "0x%X [unsigned int32] : %d\n", 0x10004, $proc->get_u32(0x10004);
#$proc->set_u32(0x10004, 55); # BE CAREFUL, MAY DAMAGE YOUR SYSTEM
# close process
undef $proc;
================================================================================================
|
| Direct Responses: Write a response |