Re: [python-win32] PyWin32 API

2017-10-22 Thread Tim Roberts
On Oct 20, 2017, at 7:58 AM, Josh Clayton  wrote:
> 
> Just following up since I have not heard back.

Heard back on what?  I sent a long and detailed message on Thursday including 
demonstration code.
— 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] PyWin32 API

2017-10-22 Thread Josh Clayton
Just following up since I have not heard back.


Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Oct 14, 2017 at 7:18 AM, Josh Clayton  wrote:

> To Whom it May Concern,
>
> I've been reading the documentation and had a question.
>
> How would I create a custom tag in the details tab of a file then set it,
> and read it?
>
> If creating it is not possible, would it then be possible just set an
> already existing tag and then read it? My end goal is to try and metatag a
> large group of files to avoid having to open them to read them.  I'd rather
> just use a script to blast through 10,000 files and understand what files
> are in my folder structure.
>
> Thanks.
>
> Josh Clayton
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] PyWin32 API

2017-10-20 Thread Michael C
oops!

Ok, I'll take a look, thanks!

On Fri, Oct 20, 2017 at 11:16 AM, Tim Roberts  wrote:

> Michael C wrote:
> >
> > I am wrestling with my life right now, but I'll post more hopefully by
> > tomorrow.
> >
> > Also, I am trying to write my own 'Cheat Engine' or just a memory
> > scanner in general,
> > I am just looking for simple values such as a int or a double.
>
> Wrong thread.
>
> Here is C++ code that does what you asked, based on a StackExchange
> article that was trying to cheat on games by increasing the money
> level.  This one scans my gvim editor process looking for the "cpp"
> extension.  It finds several hundred occurrences:
> https://pastebin.com/BbyrXxsf
>
> It's possible to convert that to Python, but you're using ctypes so much
> that you're basically writing C code in Python.  Further, Python doesn't
> worry about representations in memory.  If you're searching for a
> specific floating point value, then you need to know exactly how it was
> stored, bit for bit.  Is it single precision?  Double precision?  Scaled
> integer?  Are you sure?
>
> And if you do find the value, you can't change it unless you're sure
> it's not a false positive.  You're likely to find any 4-byte random
> value somewhere in a process, perhaps even as bytes of machine code.
> You don't want to change it unless you're sure it's a numeric constant
> and not, say, a pointer.
>
> --
> Tim Roberts, t...@probo.com
> Providenza & Boekelheide, Inc.
>
> ___
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] PyWin32 API

2017-10-20 Thread Tim Roberts
Michael C wrote:
>
> I am wrestling with my life right now, but I'll post more hopefully by
> tomorrow.
>
> Also, I am trying to write my own 'Cheat Engine' or just a memory
> scanner in general, 
> I am just looking for simple values such as a int or a double.

Wrong thread.

Here is C++ code that does what you asked, based on a StackExchange
article that was trying to cheat on games by increasing the money
level.  This one scans my gvim editor process looking for the "cpp"
extension.  It finds several hundred occurrences:
    https://pastebin.com/BbyrXxsf

It's possible to convert that to Python, but you're using ctypes so much
that you're basically writing C code in Python.  Further, Python doesn't
worry about representations in memory.  If you're searching for a
specific floating point value, then you need to know exactly how it was
stored, bit for bit.  Is it single precision?  Double precision?  Scaled
integer?  Are you sure?

And if you do find the value, you can't change it unless you're sure
it's not a false positive.  You're likely to find any 4-byte random
value somewhere in a process, perhaps even as bytes of machine code. 
You don't want to change it unless you're sure it's a numeric constant
and not, say, a pointer.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] PyWin32 API

2017-10-19 Thread Michael C
I am wrestling with my life right now, but I'll post more hopefully by
tomorrow.

Also, I am trying to write my own 'Cheat Engine' or just a memory scanner
in general,
I am just looking for simple values such as a int or a double.

Thanks for reponding!

On Thu, Oct 19, 2017 at 4:58 PM, Tim Roberts  wrote:

> Josh Clayton wrote:
> >
> > I've been reading the documentation and had a question.
> >
> > How would I create a custom tag in the details tab of a file then set
> > it, and read it?
> >
> > If creating it is not possible, would it then be possible just set an
> > already existing tag and then read it? My end goal is to try and
> > metatag a large group of files to avoid having to open them to read
> > them.  I'd rather just use a script to blast through 10,000 files and
> > understand what files are in my folder structure.
>
> The answer is quite complicated.
>
> The Details tab in Explorer is exposing whatever metadata the underlying
> file format supports.  If you look at a JPG, for example, the JPG format
> has the ability to add "tags".  If you change the tag list while you're
> looking at that tab, Windows modifies the file to add that to the tag
> list in the JPG file.  Similar, a Word document supports metadata like
> "DocTitle" and "Author", and Explorer understand the Word file format
> and how to modify it.  There is no generic "hidden store" for these
> properties.
>
> You can get access to these properties using the Shell object model.
> Theoretically, this should do it, but this returned "None" for all of
> the properties I tried.  I wish you luck.  If Tim Golden is listening,
> he may have a better idea.
>
> Note that the Shell.NameSpace API is one of the very few places in
> Windows where the path MUST be specified with backslashes.  It will not
> accept forward slashes.
>
> from win32com.client import Dispatch
> shell = Dispatch("Shell.Application")
> y = shell.NameSpace(r"c:\tmp\pvt")
> print( y.Title )
> for z in y.Items():
> print( z.Path )
> print( z.ExtendedProperty("Author"),
> z.ExtendedProperty("Date"),
> z.ExtendedProperty("Tags"))
>
> --
> Tim Roberts, t...@probo.com
> Providenza & Boekelheide, Inc.
>
> ___
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] PyWin32 API

2017-10-19 Thread Tim Roberts
Josh Clayton wrote:
>
> I've been reading the documentation and had a question. 
>
> How would I create a custom tag in the details tab of a file then set
> it, and read it?
>
> If creating it is not possible, would it then be possible just set an
> already existing tag and then read it? My end goal is to try and
> metatag a large group of files to avoid having to open them to read
> them.  I'd rather just use a script to blast through 10,000 files and
> understand what files are in my folder structure.

The answer is quite complicated.

The Details tab in Explorer is exposing whatever metadata the underlying
file format supports.  If you look at a JPG, for example, the JPG format
has the ability to add "tags".  If you change the tag list while you're
looking at that tab, Windows modifies the file to add that to the tag
list in the JPG file.  Similar, a Word document supports metadata like
"DocTitle" and "Author", and Explorer understand the Word file format
and how to modify it.  There is no generic "hidden store" for these
properties.

You can get access to these properties using the Shell object model. 
Theoretically, this should do it, but this returned "None" for all of
the properties I tried.  I wish you luck.  If Tim Golden is listening,
he may have a better idea.

Note that the Shell.NameSpace API is one of the very few places in
Windows where the path MUST be specified with backslashes.  It will not
accept forward slashes.

from win32com.client import Dispatch
shell = Dispatch("Shell.Application")
y = shell.NameSpace(r"c:\tmp\pvt")
print( y.Title )
for z in y.Items():
    print( z.Path )
    print( z.ExtendedProperty("Author"),
    z.ExtendedProperty("Date"),
    z.ExtendedProperty("Tags"))

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32