Bill, dear guru, using your code snippet: _______________________________ use strict; use warnings; use Win32::Process::Memory;
my %memlist = $proc->get_memlist; foreach (sort { $a <=> $b } keys %memlist) { print $proc->hexdump($_, $memlist{$_}) . "\n"; } _______________________________ I was able to get the memory chunk in the following format: 01EA8BA0 : 20 2D 20 70 74 50 72 69 63 65 55 70 64 61 74 65 : - ptPriceUpdate 01EA8BB0 : 00 35 00 35 B4 8B EA 01 B4 8B EA 01 18 00 00 00 : .5.5............ 01EA8BC0 : 41 64 64 43 61 6C 6C 62 E4 00 00 00 27 00 00 00 : AddCallb....'... 01EA8BD0 : 00 00 00 00 14 00 00 00 54 4D 50 72 69 63 65 41 : ........TMPriceA 01EA8BE0 : 72 72 61 79 2E 52 65 63 65 69 76 65 00 36 37 20 : rray.Receive.67 01EA8BF0 : F8 3D E9 01 F8 3D E9 01 E0 01 00 00 31 32 31 33 : .=...=......1213 01EA8C00 : 2E 35 20 20 20 20 20 00 08 8C EA 01 08 8C EA 01 : .5 ......... 01EA8C10 : C8 01 00 00 31 32 31 33 2E 35 20 20 20 20 20 00 : ....1213.5 . 01EA8C20 : 20 8C EA 01 20 8C EA 01 B0 01 00 00 35 20 20 20 : ... .......5 01EA8C30 : 20 20 20 20 20 20 20 00 38 8C EA 01 38 8C EA 01 : .8...8... 01EA8C40 : 98 01 00 00 37 34 36 36 32 33 20 20 20 20 20 00 : ....746623 . 01EA8C50 : 64 E0 E9 01 A0 18 EE 01 80 01 00 00 43 4D 45 20 : d...........CME The number I am seeking is 1213.5, which is located in the thirt block of the txt file so I've tried to separate the third block using the split command, but the result wasn't the third block of data, but something unexpected. This is the code I used instead of yours ( I've changed one line to perform the split). Can you tell me what am I doing wrong? my %memlist = $proc->get_memlist; foreach (sort { $a <=> $b } keys %memlist) { #print $proc->hexdump($_, $memlist{$_}) . "\n"; #I replaced this line by the three following lines: $line= $proc->hexdump($_, $memlist{$_}) . "\n"; ($begin,$middle,$end)=split(/:/,$line); $everything=$everything.$end; } print $everything; Thank you very much, Alejandro ----- Original Message ----- From: "$Bill Luebkert" <[EMAIL PROTECTED]> To: "Alejandro Santillan Iturres" <[EMAIL PROTECTED]> Cc: <perl-win32-users@listserv.ActiveState.com> Sent: Monday, August 29, 2005 11:11 AM Subject: Re: Win 32 memory access Alejandro Santillan Iturres wrote: > Well, I am getting closer to understand. Bill, what would be the sintax to > find the number 1196.75? > Maybe something like: > > my @results = $proc->search_float(1196.75); > print $proc->hexdump($_, 0x32)."\n" foreach @results; That should do it, but it has to be exact. Actual bytes (\x00\x98\x95\x44). > What does the search_range_float means, and what is the syntax. Maybe > something like: > my @results = $proc->search_float(1196.00,1197.00); > print $proc->hexdump($_, 0x32)."\n" foreach @results; The above will look for a pair of floats one after the other with the values 1196.0 and 1197.0 or (\x00\x80\x95\x44\x00\xA0\x95\x44) You can modify search_pack so it shows the actual pattern and values by adding the 3 prints below : sub search_pack { my ( $this, $packtype ) = ( shift, shift ); my $pattern = pack( $packtype, @_ ); $pattern = sprintf( "\\x%02X" x length($pattern), unpack ("C*", $pattern)); my @array = (); print "Packtype: '$packtype'\n"; print "Pattern: '$pattern'\n"; print "SearchValue: '@_'\n"; $this->search_sub( $pattern, sub { push @array, $_[0]; } ); return @array; } -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.16/83 - Release Date: 26/08/2005 _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs