Alejandro Santillan Iturres wrote:

> 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

This float is in string format - not binary float format.

> .
> 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?

Since the float is in string format, you can find the float string by doing a
byte or string search:

        @results = $proc->search_u8(0x31, 0x32, 0x31, 0x33, 0x2e, 0x35);
        print $proc->hexdump($_, 0x32) . "\n" foreach @results;
or

        @results = $proc->search_string('1213.5');
        print $proc->hexdump($_, 0x32) . "\n" foreach @results;

That will tell you where it is/they are.

> 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;

Don't top-post and clean up the prior post before posting (remove sig etc).

-- 
  ,-/-  __      _  _         $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

Reply via email to