How can we take the new virus that has the extension called MZTU out or removerd and restore my folders? - virus

I had some words and pdf files,and then suddunly I am unable to open them,due to the extension of the pdf had altered to Mztu.How to return my data and the files?
It would be an honor, if you inform me how to deal with it to remove it and return my data.
All wishes.
I tried to copy the files into my flash, and I look forwred it in the start windows, but i didnot find it.

Related

How to replace an entire file using FileManager

Let's say I have an UIImage cached in my Cache folder:
/.../Cache/Image Cache/<firstImage.id>
Now I want this folder to only ever have 10 image cached at a time, so if a new one comes in I want to take a file and replace the entire file and not just the contents of it. I.e.
/.../Cache/Image Cache/<firstImage.id> becomes
/.../Cache/Image Cache/<secondImage.id>.
As far as I can tell, replaceItem(at:withItemAt:backupItemName:options: only replaces the contents of the file but the file name remains the same. And I'm not too sure what replaceItem(at:withItemAt:backupItemName:options:resultingItemURL:) does even though it might be what I'm looking for (I don't know what an AutoreleasingUnsafeMutablePointer<NSURL?>? was but it sounded dangerous so I decided to leave it alone, specially since it has the word "unsafe" in it).
Is there a straightforward way of doing using an in-built function or is manually deleting the old file and adding the new file the best way? Please let me know.
Thanks in advance!

Is it possible to configure Serilog to truncate (i.e. make empty) the log file for each new process?

Moving from nlog to serilog, I would like my .NET framework desktop application to reuse a statically-named log file each time I run it, but to clear out the contents of the file with each new process. Is it possible to configure serilog this way?
This is a similar question, but it's not quite the same. In the linked question, the user uses a new log file each time with a unique filename. In my case, I want to use the same log file name each time.
This is not something Serilog can do for you as of this writing.
Serilog.Sinks.File is hard-coded to open the file with FileMode.Append thus if the file already exists, it will always append contents at the end of the file.
FileLifecycleHooks allows you to intercept when the file is being opened, and that would give you an opportunity to remove the contents of the file (by calling SetLength(0) on the stream), but unfortunately the stream implementation that Serilog.Sinks.File uses (WriteCountingStream) does not support SetLength.
Your best bet is to just truncate or delete the log file yourself at the start of the app, and let Serilog create a new one.
e.g.
// Ensure that the log file is empty
using (var fs = File.OpenWrite("mylog.log")) { fs.SetLength(0); }
// ... Configure Serilog pipeline

LibTiff.net - Save Directory

I have massive tiff file that contains 8 directories (resolutions). It's also a tiled.
I can cycle thru the directories and get the resolution of each. I want to save the 4th directory to a new tif file. I think it's possible but can't get my hands on it.
Basically want to do this:
using (LibTiff.Classic.Tiff image = LibTiff.Classic.Tiff.Open(file, "r"))
{
if (image.NumberOfDirectories() > 4) {
image.SetDirectory(4);
image.WriteDirectory("C:\\Temp\Test.tif");
}
}
It would be so nice if that was possible but I know I have to create an output image and copy the rows of data into it. Not sure how yet. Any help would be much appreciated.
There are no built-in methods in LibTiff.Net library that can be used to copy one directory into a new file.
The task is quite complex and the best place to start is to look at TiffCP utility's source code.
The utility no only can copy images but it can also extract directories.

Alter DICOM tags without saving

I'm using EvilDicom to grab DICOM data from my DB and transfer it out to a directory where it can be used another program. The secondary program checks in for new files periodically but I need to change a DICOM tag before it does.
I could have a temp location, change my tag, then resave it but I would rather change it while it is in memory and write it directly where it needs to go. I can't seem to figure out how to do that within the EvilDicom API.
Any suggestions?
(Following the basic code in "EvilDICOM in ESAPI" youtube video)
Take a look at the FileWriterSCP class. Just change the DIMSEService.CStorePayloadAction action which gives you the DICOM file in memory.
DIMSEService.CStorePayloadAction = (dcm, asc) =>
{
//DO STUFF WITH dcm variable HERE
}
The cleanest way is to not manipulate in memory because you rely on EvilDICOM's SCP to be robust, and since I made it, I can tell you its just "pretty good" ;) I would use a DICOM SCP like Varian's FileDaemon to catch and write files and then change them once they are on the hard-drive.

Can't read saved file from documents directory

I'm trying to save a downloaded file so I can open it in another session. I'm saving the mp3 data to the documents directory, and I'm saving the url to the file in a local datastore. When I check using
if ([[NSFileManager defaultManager] fileExistsAtPath:musicObject[#"localFile"]]){
NSLog(#"applicationDocumentsDir exists");
}
else {
NSLog(#"File doesn't exist");
}
it returns "File doesn't exist", but I know it does because I've printed out the documents directory which gives me
"file:///private/var/mobile/Containers/Data/Application/94552DFC-022B-4962-9CB7-CCD87CB43E57/Documents/xDDsCbXAFhwEqGIzJfJRByEr1.mp3",
and I'm trying to access it with the same path but the first is private. How do I make the file not private (I have saved it earlier in the app)
file:///var/mobile/Containers/Data/Application/AE27BD8F-5EEB-48FC-A8D4-E228F99CECE3/Documents/xDDsCbXAFhwEqGIzJfJRByEr1.mp3
I suggest the following steps:
Take the last path component (that's just your mp3 filename)
Get the current Documents directory
Build a new path with the current Documents directory and the extracted mp3 filename
If I remember correctly, /var is a symlink to /private/var. So depending on how the path is built, one may end up with one or the other.
I inherited a project which was struck by the same problem, only with an extra randomly named directory in between. Eventually I removed the leading /private component, constructed an array of path components and checked, whether replacing non-existent elements with the current value leads to an existing file. You case should be easier to handle.
I don't remember when, but at some point the application directory (the hex numbers path component) began to change with almost each run in the simulator. Beginning with this behaviour such problems became much more visible. Although one should not save full paths, I suspect a lot of projects didn't care in the past. On one hand because things just worked, and on the other hand because a lot of people just don't know it.

Resources