Re: How come this is different?

Michael C <[email protected]> Fri, 9 Dec 2016 16:12:33 -0800
Newsgroups gmane.comp.python.ctypes
Message-ID <CANyKM1gdwRmAT2K48F9NMTfK+BY-W2Kn-jQMpoHqeiv6D-MP2g@mail.gmail.com>
--===============2465479404650028654==
Content-Type: multipart/alternative; boundary=94eb2c062b0a2e8f4d054342baba

--94eb2c062b0a2e8f4d054342baba
Content-Type: text/plain; charset=UTF-8

Here is my entire current work in progress:




#import modules
import ctypes
import time


# PID of the target process whose to be scanned.
#PID = 1234

time.sleep(2)

#All the following is to set up some parameters to feed to
#Openprocess
#
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684320(v=vs.85).aspx
#and
#ReadProcessMemory
#
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680553(v=vs.85).aspx
# and I am not sure I got it all right, please take a look


user32 = ctypes.WinDLL('user32', use_last_error=True)

### proof of user32 being accessible
#hwnd = user32.GetForegroundWindow()
#pid = ctypes.c_ulong()
#user32.GetWindowThreadProcessId(hwnd, ctypes.byref(pid))
#print(pid.value)

### proof of kernel32
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
PROCESS_QUERY_INFORMATION = 0x0400
PROCESS_VM_READ = 0x0010

ph = kernel32.OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,False,
20224)
#print(ph)

mem = kernel32.ReadProcessMemory()

#The following is to set up the parametes to feed to ReadProcessMemory.
#ReadProcessMemory = ctypes.windll.kernel32.ReadProcessMemory!
#
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680553(v=vs.85).aspx
#This part is problematic, since I am using python.ctypes so what I declare
#here could be error-prone

data = ctypes.create_string_buffer(4)
bufferSize = ctypes.sizeof(data)
bytesRead = ctypes.c_size_t(bufferSize)


#The range of memory space to be scanned through. I don't understand what
are
#the appropriate values because I am only beginning to learn about memory
#scanning.
#Doesn't each process get its own memory space? Therefore do I simply give
it
#0x000000 to 0xFFFFFF ?

address = 0x4000000
addresses_list = range(address,0x9000000,0x4)


#This is the part where the scanning takes place.
for i in addresses_list:
    ReadProcessMemory(ph, ctypes.c_void_p(i), data, bufferSize,
                      ctypes.byref(bytesRead))
    #Each i from the loop returns things like 0xNNNNNN, right?
    #somehow, that's not what I get.

    #Here, the value to be looked for: If looking for a number that is 1234,
    # make value == 1234
    if value == int(1234):
        #print the hit address.
        print(i)


On Fri, Dec 9, 2016 at 4:09 PM, Michael C <[email protected]>
wrote:

> I am working on a memory scanner of my own, but I am stuck at
> Virtualqueryex() and readprocessmemory()
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms6
> 80553(v=vs.85).aspx
> https://msdn.microsoft.com/en-us/library/windows/desktop/aa3
> 66907(v=vs.85).aspx
>
> if Anyone would help, here is the problem:
>
>
> For
>
> SIZE_T WINAPI VirtualQueryEx(
>   _In_     HANDLE                    hProcess,
>   _In_opt_ LPCVOID                   lpAddress,
>   _Out_    PMEMORY_BASIC_INFORMATION lpBuffer,
>   _In_     SIZE_T                    dwLength
> );
>
>
> For this, how do I declare the lpbuffer? and what is dwlength? Do I use another function to retrieve those values?
>
>
> And then, I need to feed this function to find my target address of my value!
>
> BOOL WINAPI ReadProcessMemory(
>   _In_  HANDLE  hProcess,
>   _In_  LPCVOID lpBaseAddress,
>   _Out_ LPVOID  lpBuffer,
>   _In_  SIZE_T  nSize,
>   _Out_ SIZE_T  *lpNumberOfBytesRead
> );
>
>
> I am working on virtualQueryEx at the moment, hopefully I'll get it soon!
>
>
>
>
> On Fri, Dec 9, 2016 at 4:03 PM, Michael C <[email protected]>
> wrote:
>
>> Oh this is my entire work in progress, I pull those out to figure out the
>> windows API line by line, so I do have a .py containing only those, as seen
>> here:
>>
>> import ctypes
>>
>> kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
>>
>> PROCESS_QUERY_INFORMATION = 0x0400
>> PROCESS_VM_READ = 0x0010
>>
>> ph = kernel32.OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,False,
>> 20224)
>> print(ph)
>>
>>
>> On Fri, Dec 9, 2016 at 3:26 PM, Rob Gaddi <[email protected]>
>> wrote:
>>
>>> That's not it, Python is perfectly happy with 0x0400 as a literal.
>>>
>>> Michael, is the code you've provided below all copied and pasted from
>>> your actual code, or did you retype any of it?  Is it all in fact at the
>>> 0-indent level and in the same file?  Likewise is that error report copied
>>> and pasted, or are you just paraphrasing?
>>>
>>> On Fri, 9 Dec 2016 15:33:12 -0700
>>> "David A. Van Arnem" <[email protected]> wrote:
>>>
>>> > Hi Michael,
>>> >
>>> > I believe Python doesn't accept a hex representation like "0x0400".  In
>>> > situations where I've needed a hex value like that, I've used something
>>> > like:
>>> >
>>> > PROCESS_QUERY_INFORMATION = int("400", 16)
>>> >
>>> > This creates an integer from the string "400" in base 16 (hex).
>>> >
>>> > David
>>> >
>>> > On 12/09/2016 03:25 PM, Michael C wrote:
>>> > > Hi all:
>>> > >
>>> > >        I am trying to write my own memory scanner, but I have
>>> encountered a
>>> > > few problem. Apparently, directly specifying "
>>> > > PROCESS_QUERY_INFORMATION|PROCESS_VM_READ" is not ok, since the
>>> interpreter
>>> > > returns "NameError: name 'PROCESS_QUERY_INFORMATION' is not defined"
>>> > >
>>> > > so I should do what I did here, to define it for myself first? is
>>> this
>>> > > correct?
>>> > >
>>> > > Thanks
>>> > >
>>> > > Code:
>>> > >
>>> > > import ctypes
>>> > >
>>> > > kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
>>> > >
>>> > > PROCESS_QUERY_INFORMATION = 0x0400
>>> > > PROCESS_VM_READ = 0x0010
>>> > >
>>> > > ph = kernel32.OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_RE
>>> AD,False,
>>> > > 20224)
>>> > >
>>> > > print(ph)
>>> > >
>>> > >
>>> > >
>>> > > ------------------------------------------------------------
>>> ------------------
>>> > > Developer Access Program for Intel Xeon Phi Processors
>>> > > Access to Intel Xeon Phi processor-based developer platforms.
>>> > > With one year of Intel Parallel Studio XE.
>>> > > Training and support from Colfax.
>>> > > Order your platform today.http://sdm.link/xeonphi
>>> > >
>>> > >
>>> > >
>>> > > _______________________________________________
>>> > > ctypes-users mailing list
>>> > > [email protected]
>>> > > https://lists.sourceforge.net/lists/listinfo/ctypes-users
>>> > >
>>> >
>>>
>>>
>>> --
>>> Rob Gaddi, Highland Technology
>>> 18 Otis St.
>>> San Francisco, CA 94103
>>> 415-551-1700
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Developer Access Program for Intel Xeon Phi Processors
>>> Access to Intel Xeon Phi processor-based developer platforms.
>>> With one year of Intel Parallel Studio XE.
>>> Training and support from Colfax.
>>> Order your platform today.http://sdm.link/xeonphi
>>> _______________________________________________
>>> ctypes-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/ctypes-users
>>>
>>
>>
>

--94eb2c062b0a2e8f4d054342baba
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Here is my entire current work in progress:<div><br></div>=
<div><br></div><div><br></div><div><br></div><div><div>#import modules</div=
><div>import ctypes</div><div>import time</div><div><br></div><div><br></di=
v><div># PID of the target process whose to be scanned.</div><div>#PID =3D =
1234</div><div><br></div><div>time.sleep(2)</div><div><br></div><div>#All t=
he following is to set up some parameters to feed to</div><div>#Openprocess=
</div><div>#<a href=3D"https://msdn.microsoft.com/en-us/library/windows/des=
ktop/ms684320(v=3Dvs.85).aspx">https://msdn.microsoft.com/en-us/library/win=
dows/desktop/ms684320(v=3Dvs.85).aspx</a></div><div>#and</div><div>#ReadPro=
cessMemory</div><div>#<a href=3D"https://msdn.microsoft.com/en-us/library/w=
indows/desktop/ms680553(v=3Dvs.85).aspx">https://msdn.microsoft.com/en-us/l=
ibrary/windows/desktop/ms680553(v=3Dvs.85).aspx</a></div><div># and I am no=
t sure I got it all right, please take a look</div><div><br></div><div><br>=
</div><div>user32 =3D ctypes.WinDLL(&#39;user32&#39;, use_last_error=3DTrue=
)</div><div><br></div><div>### proof of user32 being accessible</div><div>#=
hwnd =3D user32.GetForegroundWindow()</div><div>#pid =3D ctypes.c_ulong()</=
div><div>#user32.GetWindowThreadProcessId(hwnd, ctypes.byref(pid))</div><di=
v>#print(pid.value)</div><div><br></div><div>### proof of kernel32</div><di=
v>kernel32 =3D ctypes.WinDLL(&#39;kernel32&#39;, use_last_error=3DTrue)</di=
v><div>PROCESS_QUERY_INFORMATION =3D 0x0400</div><div>PROCESS_VM_READ =3D 0=
x0010</div><div><br></div><div>ph =3D kernel32.OpenProcess(PROCESS_QUERY_IN=
FORMATION|PROCESS_VM_READ,False, 20224)</div><div>#print(ph)</div><div><br>=
</div><div>mem =3D kernel32.ReadProcessMemory()</div><div><br></div><div>#T=
he following is to set up the parametes to feed to ReadProcessMemory.</div>=
<div>#ReadProcessMemory =3D ctypes.windll.kernel32.ReadProcessMemory!</div>=
<div>#<a href=3D"https://msdn.microsoft.com/en-us/library/windows/desktop/m=
s680553(v=3Dvs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/d=
esktop/ms680553(v=3Dvs.85).aspx</a></div><div>#This part is problematic, si=
nce I am using python.ctypes so what I declare</div><div>#here could be err=
or-prone</div><div><br></div><div>data =3D ctypes.create_string_buffer(4)</=
div><div>bufferSize =3D ctypes.sizeof(data)</div><div>bytesRead =3D ctypes.=
c_size_t(bufferSize)</div><div><br></div><div><br></div><div>#The range of =
memory space to be scanned through. I don&#39;t understand what are</div><d=
iv>#the appropriate values because I am only beginning to learn about memor=
y</div><div>#scanning.</div><div>#Doesn&#39;t each process get its own memo=
ry space? Therefore do I simply give it</div><div>#0x000000 to 0xFFFFFF ?</=
div><div><br></div><div>address =3D 0x4000000</div><div>addresses_list =3D =
range(address,0x9000000,0x4)</div><div><br></div><div><br></div><div>#This =
is the part where the scanning takes place.</div><div>for i in addresses_li=
st:</div><div>=C2=A0 =C2=A0 ReadProcessMemory(ph, ctypes.c_void_p(i), data,=
 bufferSize,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 ctypes.byref(bytesRead))</div><div>=C2=A0 =C2=A0 #=
Each i from the loop returns things like 0xNNNNNN, right?</div><div>=C2=A0 =
=C2=A0 #somehow, that&#39;s not what I get.</div><div>=C2=A0 =C2=A0=C2=A0</=
div><div>=C2=A0 =C2=A0 #Here, the value to be looked for: If looking for a =
number that is 1234,</div><div>=C2=A0 =C2=A0 # make value =3D=3D 1234</div>=
<div>=C2=A0 =C2=A0 if value =3D=3D int(1234):</div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 #print the hit address.</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 pr=
int(i)</div><div><br></div></div></div><div class=3D"gmail_extra"><br><div =
class=3D"gmail_quote">On Fri, Dec 9, 2016 at 4:09 PM, Michael C <span dir=
=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_b=
lank">[email protected]</a>&gt;</span> wrote:<br><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr"><font face=3D"arial, helvetica, sans-ser=
if">I am working on a memory scanner of my own, but I am stuck at Virtualqu=
eryex() and readprocessmemory()</font><div><font face=3D"arial, helvetica, =
sans-serif"><a href=3D"https://msdn.microsoft.com/en-us/library/windows/des=
ktop/ms680553(v=3Dvs.85).aspx" target=3D"_blank">https://msdn.microsoft.com=
/en-<wbr>us/library/windows/desktop/ms6<wbr>80553(v=3Dvs.85).aspx</a><br></=
font></div><div><font face=3D"arial, helvetica, sans-serif"><a href=3D"http=
s://msdn.microsoft.com/en-us/library/windows/desktop/aa366907(v=3Dvs.85).as=
px" target=3D"_blank">https://msdn.microsoft.com/en-<wbr>us/library/windows=
/desktop/aa3<wbr>66907(v=3Dvs.85).aspx</a><br></font></div><div><font face=
=3D"arial, helvetica, sans-serif"><br></font></div><div><font face=3D"arial=
, helvetica, sans-serif">if Anyone would help, here is the problem:</font><=
/div><div><font face=3D"arial, helvetica, sans-serif"><br></font></div><div=
><font face=3D"arial, helvetica, sans-serif"><br></font></div><div><font fa=
ce=3D"arial, helvetica, sans-serif">For=C2=A0</font></div><div><pre style=
=3D"padding:5px;margin-top:0px;margin-bottom:0px;overflow:auto;word-wrap:br=
eak-word;word-break:break-word;white-space:pre-wrap;color:rgb(0,0,0);font-s=
ize:14px"><font face=3D"arial, helvetica, sans-serif">SIZE_T WINAPI Virtual=
QueryEx(
  _In_=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0HANDLE =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=A0=C2=
=A0=C2=A0hProcess,
  _In_opt_=C2=A0LPCVOID =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=A0=C2=A0lpAddress,
  _Out_=C2=A0=C2=A0=C2=A0=C2=A0PMEMORY_BASIC_INFORMA<wbr>TION lpBuffer,
  _In_=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0SIZE_T =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=A0=C2=
=A0=C2=A0dwLength
);</font></pre><pre style=3D"padding:5px;margin-top:0px;margin-bottom:0px;o=
verflow:auto;word-wrap:break-word;word-break:break-word;white-space:pre-wra=
p;color:rgb(0,0,0);font-size:14px"><br></pre><pre style=3D"padding:5px;marg=
in-top:0px;margin-bottom:0px;overflow:auto;word-wrap:break-word;word-break:=
break-word;white-space:pre-wrap;color:rgb(0,0,0);font-size:14px"><font face=
=3D"arial, helvetica, sans-serif">For this, how do I declare the lpbuffer? =
and what is dwlength? Do I use another function to retrieve those values?</=
font></pre><pre style=3D"padding:5px;margin-top:0px;margin-bottom:0px;overf=
low:auto;word-wrap:break-word;word-break:break-word;white-space:pre-wrap;co=
lor:rgb(0,0,0);font-size:14px"><font face=3D"arial, helvetica, sans-serif">=
<br></font></pre><pre style=3D"padding:5px;margin-top:0px;margin-bottom:0px=
;overflow:auto;word-wrap:break-word;word-break:break-word;white-space:pre-w=
rap;color:rgb(0,0,0);font-size:14px">And then, I need to feed this function=
 to find my target address of my value!</pre><pre style=3D"padding:5px;marg=
in-top:0px;margin-bottom:0px;overflow:auto;word-wrap:break-word;word-break:=
break-word;white-space:pre-wrap;color:rgb(0,0,0);font-size:14px"><pre style=
=3D"padding:5px;margin-top:0px;margin-bottom:0px;overflow:auto;word-wrap:br=
eak-word;word-break:break-word;white-space:pre-wrap;font-family:consolas,co=
urier,monospace">BOOL WINAPI ReadProcessMemory(
  _In_=C2=A0=C2=A0HANDLE =C2=A0hProcess,
  _In_=C2=A0=C2=A0LPCVOID lpBaseAddress,
  _Out_=C2=A0LPVOID =C2=A0lpBuffer,
  _In_=C2=A0=C2=A0SIZE_T =C2=A0nSize,
  _Out_=C2=A0SIZE_T =C2=A0*lpNumberOfBytesRead
);</pre></pre><pre style=3D"padding:5px;margin-top:0px;margin-bottom:0px;ov=
erflow:auto;word-wrap:break-word;word-break:break-word;white-space:pre-wrap=
;color:rgb(0,0,0);font-size:14px"><font face=3D"arial, helvetica, sans-seri=
f"><br></font></pre><pre style=3D"padding:5px;margin-top:0px;margin-bottom:=
0px;overflow:auto;word-wrap:break-word;word-break:break-word;white-space:pr=
e-wrap;color:rgb(0,0,0);font-size:14px"><font face=3D"arial, helvetica, san=
s-serif">I am working on virtualQueryEx at the moment, hopefully I&#39;ll g=
et it soon!</font></pre><pre style=3D"padding:5px;margin-top:0px;margin-bot=
tom:0px;overflow:auto;word-wrap:break-word;word-break:break-word;white-spac=
e:pre-wrap;color:rgb(0,0,0);font-size:14px"><font face=3D"arial, helvetica,=
 sans-serif"><br></font></pre><pre style=3D"padding:5px;margin-top:0px;marg=
in-bottom:0px;overflow:auto;word-wrap:break-word;word-break:break-word;whit=
e-space:pre-wrap;color:rgb(0,0,0);font-size:14px"><font face=3D"arial, helv=
etica, sans-serif"><br></font></pre></div><div><div class=3D"h5"><div class=
=3D"gmail_extra"><font face=3D"arial, helvetica, sans-serif"><br></font><di=
v class=3D"gmail_quote"><font face=3D"arial, helvetica, sans-serif">On Fri,=
 Dec 9, 2016 at 4:03 PM, Michael C <span dir=3D"ltr">&lt;<a href=3D"mailto:=
[email protected]" target=3D"_blank">mysecretrobotfactory@gmai=
l.co<wbr>m</a>&gt;</span> wrote:<br></font><blockquote class=3D"gmail_quote=
" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex"><div dir=3D"ltr"><font face=3D"arial, helvetica, sans-ser=
if">Oh this is my entire work in progress, I pull those out to figure out t=
he windows API line by line, so I do have a .py containing only those, as s=
een here:<span class=3D"m_1602938871547318736m_-5920348481470861325gmail-">=
<div><br></div><div><div>import ctypes</div><div><br></div><div>kernel32 =
=3D ctypes.WinDLL(&#39;kernel32&#39;, use_last_error=3DTrue)</div><div><br>=
</div><div>PROCESS_QUERY_INFORMATION =3D 0x0400</div><div>PROCESS_VM_READ =
=3D 0x0010</div><div><br></div><div>ph =3D kernel32.OpenProcess(PROCESS_Q<w=
br>UERY_INFORMATION|PROCESS_VM_RE<wbr>AD,False, 20224)</div><div>print(ph)<=
/div></div><div><br></div></span></font></div><div class=3D"m_1602938871547=
318736m_-5920348481470861325gmail-HOEnZb"><div class=3D"m_16029388715473187=
36m_-5920348481470861325gmail-h5"><div class=3D"gmail_extra"><font face=3D"=
arial, helvetica, sans-serif"><br></font><div class=3D"gmail_quote"><font f=
ace=3D"arial, helvetica, sans-serif">On Fri, Dec 9, 2016 at 3:26 PM, Rob Ga=
ddi <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a><wbr>&gt;</span> wrote:<=
br></font><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face=3D"a=
rial, helvetica, sans-serif">That&#39;s not it, Python is perfectly happy w=
ith 0x0400 as a literal.<br>
<br>
Michael, is the code you&#39;ve provided below all copied and pasted from y=
our actual code, or did you retype any of it?=C2=A0 Is it all in fact at th=
e 0-indent level and in the same file?=C2=A0 Likewise is that error report =
copied and pasted, or are you just paraphrasing?<br>
</font><div class=3D"m_1602938871547318736m_-5920348481470861325gmail-m_742=
9241619834784684HOEnZb"><div class=3D"m_1602938871547318736m_-5920348481470=
861325gmail-m_7429241619834784684h5"><font face=3D"arial, helvetica, sans-s=
erif"><br>
On Fri, 9 Dec 2016 15:33:12 -0700<br>
&quot;David A. Van Arnem&quot; &lt;<a href=3D"mailto:[email protected]" t=
arget=3D"_blank">[email protected]</a>&gt; wrote:<br>
<br>
&gt; Hi Michael,<br>
&gt;<br>
&gt; I believe Python doesn&#39;t accept a hex representation like &quot;0x=
0400&quot;.=C2=A0 In<br>
&gt; situations where I&#39;ve needed a hex value like that, I&#39;ve used =
something<br>
&gt; like:<br>
&gt;<br>
&gt; PROCESS_QUERY_INFORMATION =3D int(&quot;400&quot;, 16)<br>
&gt;<br>
&gt; This creates an integer from the string &quot;400&quot; in base 16 (he=
x).<br>
&gt;<br>
&gt; David<br>
&gt;<br>
&gt; On 12/09/2016 03:25 PM, Michael C wrote:<br>
&gt; &gt; Hi all:<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 I am trying to write my own memory sca=
nner, but I have encountered a<br>
&gt; &gt; few problem. Apparently, directly specifying &quot;<br>
&gt; &gt; PROCESS_QUERY_INFORMATION|PROC<wbr>ESS_VM_READ&quot; is not ok, s=
ince the interpreter<br>
&gt; &gt; returns &quot;NameError: name &#39;PROCESS_QUERY_INFORMATION&#39;=
 is not defined&quot;<br>
&gt; &gt;<br>
&gt; &gt; so I should do what I did here, to define it for myself first? is=
 this<br>
&gt; &gt; correct?<br>
&gt; &gt;<br>
&gt; &gt; Thanks<br>
&gt; &gt;<br>
&gt; &gt; Code:<br>
&gt; &gt;<br>
&gt; &gt; import ctypes<br>
&gt; &gt;<br>
&gt; &gt; kernel32 =3D ctypes.WinDLL(&#39;kernel32&#39;, use_last_error=3DT=
rue)<br>
&gt; &gt;<br>
&gt; &gt; PROCESS_QUERY_INFORMATION =3D 0x0400<br>
&gt; &gt; PROCESS_VM_READ =3D 0x0010<br>
&gt; &gt;<br>
&gt; &gt; ph =3D kernel32.OpenProcess(PROCESS_Q<wbr>UERY_INFORMATION|PROCES=
S_VM_RE<wbr>AD,False,<br>
&gt; &gt; 20224)<br>
&gt; &gt;<br>
&gt; &gt; print(ph)<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ------------------------------<wbr>------------------------------=
<wbr>------------------<br>
&gt; &gt; Developer Access Program for Intel Xeon Phi Processors<br>
&gt; &gt; Access to Intel Xeon Phi processor-based developer platforms.<br>
&gt; &gt; With one year of Intel Parallel Studio XE.<br>
&gt; &gt; Training and support from Colfax.<br>
&gt; &gt; Order your platform today.<a href=3D"http://sdm.link/xeonphi" rel=
=3D"noreferrer" target=3D"_blank">http://sdm.link/xeonphi</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ______________________________<wbr>_________________<br>
&gt; &gt; ctypes-users mailing list<br>
&gt; &gt; <a href=3D"mailto:[email protected]" target=3D"_=
blank">[email protected]<wbr>.net</a><br>
&gt; &gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/ctypes-us=
ers" rel=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/<wb=
r>lists/listinfo/ctypes-users</a><br>
&gt; &gt;<br>
&gt;<br>
<br>
<br>
</font></div></div><span class=3D"m_1602938871547318736m_-59203484814708613=
25gmail-m_7429241619834784684HOEnZb"><font color=3D"#888888" face=3D"arial,=
 helvetica, sans-serif">--<br>
Rob Gaddi, Highland Technology<br>
18 Otis St.<br>
San Francisco, CA 94103<br>
<a href=3D"tel:415-551-1700" value=3D"+14155511700" target=3D"_blank">415-5=
51-1700</a><br>
</font></span><div class=3D"m_1602938871547318736m_-5920348481470861325gmai=
l-m_7429241619834784684HOEnZb"><div class=3D"m_1602938871547318736m_-592034=
8481470861325gmail-m_7429241619834784684h5"><font face=3D"arial, helvetica,=
 sans-serif"><br>
------------------------------<wbr>------------------------------<wbr>-----=
-------------<br>
Developer Access Program for Intel Xeon Phi Processors<br>
Access to Intel Xeon Phi processor-based developer platforms.<br>
With one year of Intel Parallel Studio XE.<br>
Training and support from Colfax.<br>
Order your platform today.<a href=3D"http://sdm.link/xeonphi" rel=3D"norefe=
rrer" target=3D"_blank">http://sdm.link/xeonphi</a><br>
______________________________<wbr>_________________<br>
ctypes-users mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">cty=
[email protected]<wbr>.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/ctypes-users" rel=
=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/<wbr>lists/=
listinfo/ctypes-users</a><br>
</font></div></div></blockquote></div><font face=3D"arial, helvetica, sans-=
serif"><br></font></div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>

--94eb2c062b0a2e8f4d054342baba--


--===============2465479404650028654==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
--===============2465479404650028654==
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

--===============2465479404650028654==--