Page 1 of 1

Problem with PB

Posted: Sun Mar 04, 2012 9:08 pm
by Nubcake
Hey

I left my computer on for about 20 mins and when I came back i think someone had slept it or it went to sleep anyway when i resumed it i noticed this weird graphical thing happenening with all programs so I closed all programs including PB then restarted my computer. The graphical error went away however something wrong happened with PureBasic : When I opened it up all my preferences were gone (Default PureBasic startup + Splash screen) and the file i'd been working on disappeared. So when I tried to open the file i was working on it came up in File Viewer with just a list of numbers:

00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

I really need that file back as it contained a lot of code i had been working on . Is there anything i can do to retrieve it ?

Nubcake

Re: Problem with PB

Posted: Mon Mar 05, 2012 1:14 am
by jassing
what you describe is a classic sign of shutting the system off rather than doing a full system shutdown...

If the file is filled with nulls, you're not going to get it back; unless you boot off a cd and look for traces of the old file.

If you've powered your machine on and used any programs, chances of recovering go download dramatically.

Re: Problem with PB

Posted: Mon Mar 05, 2012 6:11 pm
by Nubcake
so there's no chance of recovery?

Re: Problem with PB

Posted: Mon Mar 05, 2012 6:34 pm
by IdeasVacuum
Do you keep a backup? If not, now is the time to start. Concerning the issue on your PC, you need to try to find the cause since it is unlikely to be a one-off.

Re: Problem with PB

Posted: Mon Mar 05, 2012 7:37 pm
by Ramihyn_
There are plenty of file recovery tools. You could ask google for things like "undelete" or "recover files windows" and with a bit of luck, some time and the right tool, you can recover at least a previous version of your source.

For example the "tuneup utitilities" have a 30day trial and contain undelete tools. Maybe you want to try that as most dedicated recovery tool trials don't allow you to save the data during trial, but tuneup might.

If you are very serious about getting the file back, you would not ever start the installation again (risk of overwriting data you want to recover) and only work on a 1:1 image copy you create right after it happened. If it was a faulty suspend mode (incompatible/faulty drivers or hardware), you might find your source in the memory dump windows created on the hard disk. Make a copy, open it with a hex editor and search for a unique string in your source.

You might only get an older version back though, or 90% of your file.

ps: obviously if you install the recovery tools on the same partition/system where you want to undelete data from, you might overwrite the data with that installation ;)

Re: Problem with PB

Posted: Mon Mar 05, 2012 9:08 pm
by Nubcake
the only thing close enough to the file was a compiled exe that i still have but im guessing decompiling is out of the question right ?

Re: Problem with PB

Posted: Tue Mar 06, 2012 2:14 am
by kenmo
A similar thing happened to me when I was editing code under Linux, my laptop battery died, and later I rebooted to Windows XP. My code had become corrupt -- filled with nulls and garbage. I assume it had something to do with the OS, or the filesystem, from not saving and closing the file buffers. Luckily I had backups :?

I have had decent luck with the (free?) recovery program Recuva, although that was on flash/SD drives, and it is always best if you try to recover immediately running as little software as possible (so you don't overwrite that area of the hard drive unintentionally).

Re: Problem with PB

Posted: Tue Mar 06, 2012 7:27 am
by Ramihyn_
Nubcake wrote:the only thing close enough to the file was a compiled exe that i still have but im guessing decompiling is out of the question right ?
You can decompile it to assembler or C/C++, but you wont even be able to change and compile the resulting C/C++ code anymore.

I dont know how much trouble it would be worth to you or how many files we talk about. An easy way to check if there even is a point in trying to recover data, would be to use a linux life CD/DVD like knoppix and do a grep for a unique string on the raw filesystem. That would show you if (fragments) of your source still exist somewhere. A diskeditor and some hours of re-assembling parts from the raw disk, might be worth it for you - or not. Think carefully about the string you search for - the search usually takes hours - thats why professionals copy the images to a super-fast device before doing stuff like that (SSD-Raids).

A good IDE creates backup files or even a backup history for cases like this (i think japbe does it), but lack of backup was of cause your major mistake.

Re: Problem with PB

Posted: Tue Mar 06, 2012 9:06 pm
by kenmo
Doesn't PB create a temporary copy of your source when you compile/run? Or is that just for new, unsaved source code...

Maybe, if you haven't run PureBasic since then, there is still a good copy in you compiler folder or elsewhere?