I need to automate some text editing and encryption. I've been doing some research and it seems uhooker can detect when a file is saved or when a program is closed, but I didn't see any examples to find the path to file for any saved files, like say from notepad. I did find techniques of directory watching, but there are some recourse overheads for going that route. Can anyone point me in the right direction, and provide documentation to any example that does this? Or let me know if I simply missed it in the uhooker documentation? Thanks.

  • Can you explain what you're actually trying to achieve? If you only need to do "some text editing and encryption", any programmation language should do the trick.. – Dillinur Oct 18 '17 at 19:23
  • I'm looking to automate the process on save. I want to wrap a Windows program and when a user saves via save or save as, I want that event to trigger my script to run against that save file. The actual program I'm targeting is slic3r or craftware. These produce gcode files which are essentially text files.I use non planar sinoidal layering in my 3d prints and currently I have to run it command line every file I do and it takes time. If I set up a .bat file to open the program and run my script, all I have to do is save my file and it will be ready to print. – Jasong Oct 18 '17 at 20:27
  • I posted here because api hooking is typically an re sort of thing. I found uhooker and winappdbg, but I haven't figured out how to actually get the output file. I found directory watching, but I'd have to watch all of c:/ to find a save since I can't garantee where a user might save to. It seems I'd have a bit too much overhead that way. It would take too long. – Jasong Oct 18 '17 at 20:42
  • Intels pin has been suggested to me, but that is done in c or c++. The only two languages I can do anything in is c# and python. I barely started learning c# so I'm hoping it can be done pure python. – Jasong Oct 18 '17 at 20:53
  • 1
    You can use the official Windows API to hook functions - and you can use the pretty convienient win32-warper for python. There are examples available – Nordwald Oct 19 '17 at 4:53

Browse other questions tagged or ask your own question.