Can one develop a program that can see and access the edits one makes to a file? - daemon

I know about key loggers and root kits. I know it is possible for these programs to know what keys a user is pressing and what programs a user has open at any given time but, is it possible for a program (or background process) to know what commands (functions) with in a program are being executed?
e.g. A user is in Photoshop and does the following:
Opens the file called mountain.jpg
Crops 103 pixels off the top
Increases the Contrast by a value of 50
Saves the file as mountain-EDIT_1.jpg
Can a background process (daemon) understand that a user ran Photoshop's Open, Crop, Contrast and Save functions?
To be more specific, can a background process:
gain access to those unsaved edits like Crop and Contrast
take that data and save it else where
Also how does one locate where a program like Microsoft Word, Photoshop or ProTools is saving each of the edits a user makes?

The more close you would get to this functionality would be by using the photoshop's built-in scripts. I do not have enough knowledge to talk about this more, and I also doubt its the place to discuss this functionality.
On a more programming oriented point of view, you would need to look at memory photoshop is allocating for this image file and reverse-engineer photoshop's code to understand what happens on every edits you mentionned. I doubt its humanly possible.
If the user is saving the image after each edits though, you could watch for changes in the image, and try to look for the what you want to understand.

You may create a Photoshop plugin or script. But a generic software in such detail I don't think is possible.

Related

How do I get started automating my workflow for enhancing and editing photos using Remini web app and photoshop?

I have hundreds of photos from the 70s-90s that I need to edit. I've left it for years because it is so labor intensive. I want to get it done. I have limited experience with DIY artificial pancreas systems as well as home automation systems like hubitat and am not afraid of a command prompt, but don't know how to start learning more to accomplish my current objectives.
Photos are stored in folders labeled by the year in which they were taken on my Mac desktop (latest OS). The photos go up by one integer each time. I need to automate the following:
Tell remini web app to upload the photo and enhance it (this usually takes 30 seconds to accomplish)
Save the finished photo (Remini automatically leaves the original name and adds remini enhanced to the end, so I don't need to worry about changing the names)
Rinse and repeat.
For Photoshop:
Open the photo from a specified folder, open the neural filters and apply the colorize option.
Save the photo as the same name it currently has plus put "photoshop edit" at the end.
Rinse and repeat.
After this completes, I will review the photos by hand and remove any that didn't work out. But being able to free up my time from clicking would help speed the process up.
Is this a possibility? How do I get started? Thank you!
I have been searching for information to help me get started but am concerned about the website thinking I am a bot if I do this.

Is it possible to hide certain files from "show package contents"?

I have a MacOS app coded in swift, and when someone right clicks > show package contents there is a file that reveals some information I do not want the user to see. Is it at all possible to hide that file?
There's no way to secure data on the client (mac) side. If your program can read something, so can a hacker. You can do 3 things about it:
Make it obfuscated enough to make it annoying to deal with, hoping that bad actors would get discouraged.
Make the reward of reading the sensitive data lower, so there's less incentive to do so
Make the sensitive data be black boxed by a server you control and have secured, and have all the sensitive operations be out-sourced to computation on that secure server.
No, you can't hide files in a meaningful way.
If you name the file starting with a dot (".") they are not shown in the Finder by default, but that's very easy to get around.
Better to encrypt the file and decrypt it in your app. That way nosy users can see the file but can't make any sense out of the contents.

Is there any way, any way at all, a Word document could become a PNG? (Probable case of cheating)

I think a student of mine renamed a PNG a Word document and intentionally submitted a corrupted file to buy more time (or something) on an assignment. The student denies everything and claims it was a computer malfunction. Before I submit an honor code violation I want to be sure that there's no explanation that does not involve cheating that I'm somehow overlooking.
Basically, I'm a TA and a student submitted a paper, let's say it was Smith.docx. When I was working on grading and went to open Smith.docx Word wouldn't open it and said that it was corrupted. I eventually had the idea of opening it in a text editor and there it was a massive jumbled file of all sorts of odd characters (total file size: 180kb for what was supposed to be a 5 page paper).
I noticed, though, that the first few characters of the file were:
‰PNG
I renamed the file Smith.png and it opened. Bizarrely, it was an image of the first page of a Word document. More specifically, it looks like a screenshot of a Word doc cropped so as to show just the page. What makes it seem like a screenshot is that the cursor thingy (the vertical bar marking where you're typing) shows up next to the title.
An additional interesting bit of data is that if I scroll further down in the file (opened in notepad) I come to this:
XML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:exif="http://ns.adobe.com/exif/1.0/">
<exif:PixelXDimension>996</exif:PixelXDimension>
<exif:PixelYDimension>1286</exif:PixelYDimension>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
I'm not sure what all that means but 1286x996 are the dimensions of the png image. The rest suggests to me that the file was created in some Adobe program but I'm not sure if that's right and how to figure out more about that.
So, my actual question: Is there any conceivable explanation of any kind for how I would come to have a file called Smith.docx that is a perfectly functioning png of what sure looks like a screenshot of the first page of a Word document other than that the student did it on purpose? The student claimed that their computer was "corrupting" files and that they had to take it into the Apple for service. I find this incredibly implausible (student has also not provided the receipt for this, which I requested).
Additionally, other than the case I laid out here, is there any positive evidence for my theory (that it was a straightforward case of cheating) that I can present to strengthen my case? eg, is the data from the file that I posted above a smoking gun that it was created in an Adobe program or is there any conceivable way that could come out of a Word document or other sort of corrupted file?
Also, is there anything else I can look for in the PNG file that would be a smoking gun?
Thanks in advance for any help you might be able to offer!
just rename the file with .png at the end instead of .docx and if it was a png then it should open just fine as a png
The key is that you see the cursor in the screenshot, there is no way Word would export (somehow) a docx file as a png AND draw the cursor for typing. Also, any tool that could do that would save the file as png not docx, only the user could deliberately change the file extension.
Also, does the screenshot show an empty document? or it looks like the final document your student delivered at the end?
Short answer:
The student is lying and is in fact a cheater (in my opinion).
Also, even if they were telling the truth, it is still their responsibility to have their work done, ready, and fully functional on time. Your computer is corrupting your files? Tough cookies. No one cares. You should have done your work on another computer. In the real world, excuses don't get you anywhere and they shouldn't get you anywhere in school either.
Lastly, it is very easy to re-name an extension of another file type and claim it's corrupt and very unlikely that a computer is just creating corrupted files. If their computer would otherwise create corrupted files, I would imagine it would be nearly impossible to get the computer to boot. In other words, they probably wouldn't have been able to turn on their "corrupted" computer to create "corrupted" files in the first place.

Is there a way to convert epub format to images?

I need a tool to programmatically convert epub files to a series of images. The output should look like screenshots taken on a canonical device (for this application, an iPad). I haven't been able to find any tools that do something like this.
So what I'd really like (1) is a tool that does that. But assuming that I'm correct that no such tool exists, is there (2) a library (preferably a Perl module, but I'm not that picky) that will read and render ePub?
Obviously, rolling my own I could combine tools for unzipping, reading html, reading xml, putting everything in the right order, and rendering html within certain constraints. Though I'd rather not do that, and if that's the only option I'll have to go on to look for a tool that will do the last part of that or I'll have to create that too.
Any leads on (1), or failing that (2)?
Apologies if what I'm about to type is just crazy-talk on my part--in fact, I'm pretty sure it is--but perhaps something like this might work and I'm kind of interested in knowing how well it might work for you:
Use Frank (https://github.com/moredip/Frank) to control the iOS Simulator on a Mac. Program it to open up the EPUB docs you need.
All you need then is something to automate the taking of the screen shots. Obviously, these will look like the EPUBs are being rendered in an iPad (or an iPhone if you wish--the iOS Simulator does both, of course).
Automating the screenshots can probably be done with AppleScript, although the hard part might be getting it to talk to Frank. Worst case, you can tell Frank to pause for 5 seconds after it loads each page and tell AppleScript to take a screen shot every five seconds. That sucks, but if you're desperate, it will get it done. It's also possible Frank can somehow make the screenshots happen--I haven't used it enough to know.
Pandoc can convert from EPub to LaTeX (and therefore to PDF) or to any number of other formats. Conceptually this should be a type (1) solution.
depends on your definition of "look like" - do you want the user-chrome or just the epub rendering for a given screen size.
I would check out the various epub readers for your platform of choice, size the window to your preferred dimensions, and then just "print" the epub to a virtual printer that outputs to image files - on windoze I use imageprint.
You could easily make a "frame" from an iPad product shot and place your screenshots within that - only thing missing would be as I said the user chrome.

Prevent Save As Functionality

I need to prevent a document from being saved / saved as (say from ms word). I've looked around and I havn't quite found a satifying answer. I've considered EFS... but I don't think it prevents the user from saving the document as... (though it prevents access to the original source file). Any ideas outthere?
Run it on completely locked-down system with read-only disk, no network and no removable drives. Access to the computer must be phisically restricted as well.
This should prevent Save As from working, but still won't prevent document from being copied (someone may take photo of the screen and OCR it).
It usually isn't worth it to disable Save As, because you need access to the original in order to open it in the first place. There are always ways to copy a file.
I had the same issue come up when someone asked me to disable Save As for a PDF.
There is no way take an arbitrary document and modify it in such a way that it cannot be saved. You could modify a program such as Word not to allow Save or Save As but that would still allow someone to open and save the document with a different program or on a different machine.