Re: [Tutor] using while loop for read process memory
Michael C <[email protected]> Sun, 8 Oct 2017 12:18:21 -0700
| Newsgroups | gmane.comp.python.ctypes,gmane.comp.python.tutor |
|---|---|
| Message-ID | <CANyKM1iO0tchmDzwrTAHPFnn_JTH_sFCv5i8LXPqqUwM1LSRHQ@mail.gmail.com> |
--===============2435862365009123877==
Content-Type: multipart/alternative; boundary="f40304353a08fbe6a5055b0defee"
--f40304353a08fbe6a5055b0defee
Content-Type: text/plain; charset="UTF-8"
This is the red part
index = current_address
end = current_address + mbi.RegionSize
while index < end:
if ReadProcessMemory(Process, index, ctypes.byref(buffer), \
ctypes.sizeof(buffer),
ctypes.byref(nread)):
## value comparison to be implemented.
pass
else:
raise ctypes.WinError(ctypes.get_last_error())
index += 1
On Oct 8, 2017 12:16 PM, "Mats Wichmann" <[email protected]> wrote:
> On 10/08/2017 11:20 AM, Michael C wrote:
> > Hi all:
>
> > Now, I know the problem is not with VirtualQueryEx, because if I comment
> out
> > the red part and just run VirtualQueryEx, it would actually skim through
> > all regions
> > without a single error.
> >
> > The red part is the problem.
>
> what red part? colors don't come through mailers that use text-based
> settings. This is an example of what your mail looks like to many of us:
>
> https://mail-archive.com/[email protected]/msg77570.html
>
> please explain in words.
>
--f40304353a08fbe6a5055b0defee
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto">This is the red part=C2=A0<div dir=3D"auto"><div style=3D=
"font-family:sans-serif;font-size:13.696px" dir=3D"auto"><font color=3D"#ff=
0000">=C2=A0 index =3D current_address</font></div><div style=3D"font-famil=
y:sans-serif;font-size:13.696px" dir=3D"auto"><font color=3D"#ff0000">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 end =3D current_address + mbi.RegionSize</font></d=
iv><div style=3D"font-family:sans-serif;font-size:13.696px" dir=3D"auto"><b=
r></div><div style=3D"font-family:sans-serif;font-size:13.696px" dir=3D"aut=
o"><font color=3D"#ff0000">=C2=A0 =C2=A0 =C2=A0 =C2=A0 while index < end=
:</font></div><div style=3D"font-family:sans-serif;font-size:13.696px" dir=
=3D"auto"><font color=3D"#ff0000">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
if ReadProcessMemory(Process, index, ctypes.byref(buffer), \</font></div><=
div style=3D"font-family:sans-serif;font-size:13.696px" dir=3D"auto"><font =
color=3D"#ff0000">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ctypes.sizeof=
(buffer), ctypes.byref(nread)):</font></div><div style=3D"font-family:sans-=
serif;font-size:13.696px" dir=3D"auto"><font color=3D"#ff0000">=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ## value comparison to be imp=
lemented.</font></div><div style=3D"font-family:sans-serif;font-size:13.696=
px" dir=3D"auto"><font color=3D"#ff0000">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 pass=C2=A0 =C2=A0</font></div><div style=3D"font-fami=
ly:sans-serif;font-size:13.696px" dir=3D"auto"><font color=3D"#ff0000">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else:</font></div><div style=3D"font=
-family:sans-serif;font-size:13.696px" dir=3D"auto"><font color=3D"#ff0000"=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rais=
e ctypes.WinError(ctypes.get_<wbr>last_error())</font></div><div style=3D"f=
ont-family:sans-serif;font-size:13.696px" dir=3D"auto"><font color=3D"#ff00=
00"><br></font></div><div style=3D"font-family:sans-serif;font-size:13.696p=
x" dir=3D"auto"><font color=3D"#ff0000">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 index +=3D 1</font></div></div></div><div class=3D"gmail_extra"><br>=
<div class=3D"gmail_quote">On Oct 8, 2017 12:16 PM, "Mats Wichmann&quo=
t; <<a href=3D"mailto:[email protected]">[email protected]</a>> wrote:<=
br type=3D"attribution"><blockquote class=3D"gmail_quote" style=3D"margin:0=
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/08/2017 11:20 =
AM, Michael C wrote:<br>
> Hi all:<br>
<br>
> Now, I know the problem is not with VirtualQueryEx, because if I comme=
nt out<br>
> the red part and just run VirtualQueryEx, it would actually skim throu=
gh<br>
> all regions<br>
> without a single error.<br>
><br>
> The red part is the problem.<br>
<br>
what red part?=C2=A0 colors don't come through mailers that use text-ba=
sed<br>
settings.=C2=A0 This is an example of what your mail looks like to many of =
us:<br>
<br>
<a href=3D"https://mail-archive.com/[email protected]/msg77570.html" rel=3D"=
noreferrer" target=3D"_blank">https://mail-archive.com/<wbr>[email protected]=
g/msg77570.html</a><br>
<br>
please explain in words.<br>
</blockquote></div></div>
--f40304353a08fbe6a5055b0defee--
--===============2435862365009123877==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============2435862365009123877==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users
--===============2435862365009123877==--