View Full Version : Corrupt FL file? No problem! (ONLY FOR DAMAGED HEADERS)
Legion303
01-30-2006, 01:05 PM
READ THIS FIRST:
If you came here from a google search on corrupt FL files and couldn't be bothered to read the entire thread, at least read this part: I WILL NOT FIX YOUR FILE FOR YOU. STOP ASKING. YOU MORON.
Now back to our regularly scheduled post.
EDIT: Steve Laboy has come up with a more elegant and (more importantly) easier way to fix corrupted files here: http://www.ocremix.org/forums/showpost.php?p=245629&postcount=32
If that doesn't work for you and you don't mind getting your hands dirty, continue:
After working on a remix for about 30 hours, I tried to load a VST effect which crashed FL Studio right after a save. I hit save again (FL was still running, it just stopped making sound) to be sure everything would be OK, and closed the program. When I restarted and tried to load my song I got this:
"An error occured while reading the FLP file. It may be corrupted, or some plugin caused an error while opening."
Long story short, it was a corrupt file (verified by trying to open the FLP on another computer). A google search found nothing other than forum messages like "you're fucked. Start over."
But it turns out every FLP file has this in the first 32 bytes of its header:
46 4C 68 64 06 00 00 00 00 00 04 00 60 00 46 4C
64 74 B1 77 00 00 C7 06 35 2E 30 2E 31 00 C8 10
The text side looks like this:
FLhd........`.FL
dt±w..Ç.5.0.1.È.
The first line is exactly the same in every FLP I looked at. The second line is similar, but the last half contains the FL Studio version number (5.01 in my case, as seen on the second text line above). Additionally, the first two bytes of the second line (64 74; bytes 17 and 18 of the header) are exactly the same in all files, but the third and fourth (B1 77 above) are not consistent even in files saved from the same version of FL. My corrupt file had nulls in the 19th and 20th bytes of its header, so I overwrote them with data from another FLP header.
Edit: it turns out those two bytes are a pointer to an address 22 bytes from the end of the file, consistent among all files I looked at. I believe this is due to the really sloppy way FL handles files...instead of putting a pointer to various sections (i.e., "go to this address for instrument data; this one for pattern info; etc.), FL just crams information in and the program has to scan for headers to find various sections. With such small files it works, I guess, it's just weird. So what happened in my case was that the pointer to the "end" of the file was really pointing to the very first byte, before the start of data. I imagine that confused FL. :)
Edit 2: to get the correct pointer address (see Edit 1), look at the end of the file. There should be several repetitions of "1\" with other characters (if not, the end of your file is hosed and this probably won't work). Look at the last byte of your file. That's byte #1 for our purposes. Let's say the end of your file looks like this:
0000a150h: 00 00 81 1F 00 31 5C 44 00 00 00 00 00 00 82 1F ; ..?..1\D......‚.
0000a160h: 00 31 5C 44 00 00 85 04 01 00 00 ; .1\D..…....
Starting with the last byte and counting backwards, find byte #22 from the end of the file. In the example, that's the "31" in the first line. This is where you need to point. Now look at the address of that line: 0000a150h (the "h" stands for Hexadecimal). The byte "31" occurs in the fifth position of that line (counting bytes from the left, like so):
0 1 2 3 4 5
00 00 81 1F 00 31
Note that there are 16 bytes per line, and this is in hex, so if the byte you're interested in happens to be the last one on a line, its "number" is F.
OK. "31" is byte 5 on that line. Add that to the line's address to get 0000a155. The last four characters (representing two bytes) are the address we want: A1 55. I don't remember my assembly programming enough to recall why, but these need to be reversed for pointer purposes (EDIT 3: it's because Little-endian systems (e.g. microcomputers) store the least-significant byte of addresses first in memory). So now we have the byte string "55 A1". Go back to the top of the file. The second line (which is always address 00000010h) Must begin with "64 74" on the left (corresponding to "dt" on the text side). The next two bytes are the address pointer you just got. Overwrite whatever two bytes come after "64 74" to get "64 74 55 A1" as the first four bytes of the second line in the file. Congratulations. If it still doesn't work, you're fucked. Start over. :)
BEFORE:
46 4C 68 64 06 00 00 00 00 00 04 00 60 00 46 4C ; FLhd........`.FL
64 74 00 00 00 00 C7 06 35 2E 30 2E 31 00 C8 10 ; dt....Ç.5.0.1.È.
AFTER:
46 4C 68 64 06 00 00 00 00 00 04 00 60 00 46 4C ; FLhd........`.FL
64 74 B1 77 00 00 C7 06 35 2E 30 2E 31 00 C8 10 ; dt±w..Ç.5.0.1.È.
This brought back all of my instruments with intact settings, and all of the patterns I had written. Unfortunately, the Playlist pattern data (how you build different patterns together--don't know the right terminology) was lost, but all the parts are there and all my pattern labels were still on the playlist. In any event I'm happy it will only take me a few hours to rebuild the playlist data instead of having to start from scratch.
So if you have a corrupt FLP that has data in it (i.e., you don't have a 0-byte file), this will at least let you open the damn thing. I don't know if it will work on FL 6.
I'll keep comparing FLPs and post anything else I learn about the format, but at this point I'm just happy I got my shit working again. So I'll probably get lazy.
EDIT: Amazing file structure analysis here: http://www.ocremix.org/forums/showpost.php?p=258055&postcount=34. You people are way too brilliant for me. Bah!
-steve
Rellik
01-30-2006, 03:44 PM
Wow - this is pretty major work you're doing! A lot of people will want to know about this - we have to make sure the word gets out! Thanks for taking the time to sleuth around and not just letting the corruption slide.
tgfoo
01-30-2006, 04:50 PM
Still, I wouldn't rely on this as a method of protecting your FL project files. Back up regularly....
RoeTaKa
01-30-2006, 04:54 PM
Back up regularly
QFE, sometimes I save flp's in two locations, not just the project folder, just in case, it has helped me once I believe. Backing up is what needs to be done.
But nice work on the indepth correcting, I'm sure it'll help me out in the future. Though I still use FLS4, I'm sure it'll come in handy.
zircon
01-30-2006, 05:15 PM
I save about every 10 minutes while I work. Also, whenever I do anything major, I save, then I save a new version. My new CT sewer mix has about 14 backups because of this method.
I dont just save in multiple places. If your HD totally crashes often (as does mine), either upload your project files to a secure server, or just use a CD to back up your files at the end of every week. Trust me, it's saved my work a countless amount of times.
Legion303
02-14-2006, 11:03 AM
So far I've gotten about 4 personal requests to fix other peoples' songs (some of these requests look like people who found this post through google and didn't try the work themselves). Please don't do that. I'm happy to do it for the people I've already said "sure, I'll look at it" to, but note that everything I can possibly do to fix a file has been outlined in the first post of this thread, and anything I can do, you can do yourself using the same methods I did.
I will add to this post if I discover anything else about the file format, but when a file's too corrupted to recover you've just got to rely on backups.
-steve
Uproot
02-26-2006, 06:16 PM
Hey people. I had exactly the same problem, theres a few people mensioning backing up files, but really, who backs up files in two places in the process of writing and producing, back up is usually a process after you have finished a session. I save after every edit i do, but i still lost my work.
Anyway, ive had a read of the first post and i dont really understand how to fix the problem, i can only program in vb. is there any chance i could share email with someone who knows so they can do it for me? I've been working on my final piece for quite a while now, and to put it bluntly, im fucked!
Please help save my arse!
Chavous
02-26-2006, 07:44 PM
but really, who backs up files in two places in the process of writing and producing, back up is usually a process after you have finished a session.
People who don't want to lose their work.
Nineko
02-27-2006, 12:19 AM
Anyway, ive had a read of the first post and i dont really understand how to fix the problemyou need an hex editor. the ms-dos EDIT is fine.
Start -> Run -> Cmd.exe
then something like "C:\Windows\Your Mom>" appears.
type "EDIT" and press enter
File -> Open
browse to find your file, and open it. make sure you check the "Binary" checkbox (I don't know its actual name since I'm running the italian version).
do what is explained in the first post.
File -> Save
File -> Exit
Have a nice day
Xelebes
02-27-2006, 03:55 AM
THANK YOU!
Edit - Shit, I don't know squat about coding.
tgfoo
02-27-2006, 05:29 AM
but really, who backs up files in two places in the process of writing and producing, back up is usually a process after you have finished a session.
People who don't want to lose their work.
That sounds about right... Every time I close my sequencer I make sure to copy whatever I was working on to a seperate hard drive. Also, I recently I've been saving different versions of the same song backed up just incase I make a major change and then the next day I decide "What the hell was I thinking when I did this yesterday?" (It's happened a few times...)
Uproot
02-27-2006, 02:49 PM
Yeh, good points people, maybe im depending on my laptop to be as good as it is too much. Think i shall be purchasing some cdrw's.
On the note of usin the hex editor to editor the fl file. Mine seems to be in a different format, i made sure the binary box was checked and reopend it, but it was completly different. Anyone know what the problem could be.
For good forums on nearly all styles of electronica, check out www.itstooloud.com and get involved.
Legion303
02-27-2006, 02:55 PM
Windows edit will open binary files, but not in a hex-edit format, unless I missed something.
Free Windows hex editor:
http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm
-steve
suzumebachi
02-27-2006, 07:46 PM
I dont just save in multiple places. If your HD totally crashes often (as does mine), either upload your project files to a secure server, or just use a CD to back up your files at the end of every week. Trust me, it's saved my work a countless amount of times.
i generally save every couple of minutes, and i save a new version after every major edit. and if you ever DO get a weird ass error, save your project to a NEW FILE so you don't corrupt your current work by accident. even if the new file turns out to be corrupt, you still have the old one to work off of.
also as far as backup goes, that would be quite cumbersome as i go through probably 2-3 DVD's worth in a week's time. needless to say uploading that on dialup would be ridiculous.
Xelebes
03-01-2006, 08:36 AM
It works! It really really works!
that goes so well with your sig.
illusivemind
03-16-2006, 10:27 AM
I found this site from google, searching for "corrupt flp file" in the desperate hope that there may have been some way of rescuing a song I had spent hours and hours on.
The same old story, a plugin crashed as I was saving the file. I tried to look at the code and find the markers and what not, but this was just beyond me.
However, I was running Norton System Works 2006, including Norton Go Back. With File & Version rescue you can restore files from a number of different times on drives you have protected.
Now unfortunately I don't save my flp files to C drive, which is the only drive I have enabled protection on. Luckily though I was able to find a number of versions of C:\Program Files\FLStudio 5\Trash bin\Backup.flp file which included a save of my song 8 minutes before it crashed.
Thank God for Go Back.
Just thought I'd post this to in the hope that it might save someone else's hard work. Of course by the time they search for this, it's probably too late. From now on I'll be using FL Studio 6 and the "Save New Version" function regularly.
suzumebachi
03-16-2006, 06:14 PM
shill much?
illusivemind
03-17-2006, 05:35 AM
Not at all. I think the software is prohibitively expensive, and so much of a memory hog that it is probably impractical to run it on your DAW.
I'm just happy I got my file back.
If there is an easier way to access previous copies of the Backup.flp file, I'd love to hear what they are.
zircon
03-17-2006, 05:37 AM
Wait, what? FL is one of the cheapest and lowest CPU/RAM using programs there is.
illusivemind
03-17-2006, 08:11 AM
No I think 'Norton Systemworks' is prohibitively expensive, and so much of a memory hog that it is probably impractical to run it on your DAW.
mu-sick
04-06-2006, 03:23 PM
Hey everybody I got the same problem, FL got stuk and now I got a damaged file of a song I worked weeks on. I tried the solution but I'm to n00b to understand it. Could somebody help me?
I upload the file @ http://two.fsphost.com/zortox/help/LDMFmix.flp if somebody could fix it, that would be great! cause I spend alot of time @ this song and now its all gone :(
(yes I know I should have made back-ups :))
so please help me :)
thanx in forward.
Legion303
04-07-2006, 09:09 AM
Hey everybody I got the same problem
If the fix didn't work for you, send your song to ImageLine support and see if they can help.
-steve
mu-sick
04-07-2006, 06:33 PM
If the fix didn't work for you, send your song to ImageLine support and see if they can help.
-steve
I can't find a email adres on the FLstudio site, anybody knows a email adres where I can contact ImageLine support ?
READ THIS FIRST:
If you came here from a google search on corrupt FL files and couldn't be bothered to read the entire thread, at least read this part: I WILL NOT FIX YOUR FILE FOR YOU. STOP ASKING. YOU MORON.
Now back to our regularly scheduled post.
I've read the whole topic OVER and OVER but I don't udnerstand it I can't work with Hexeditors so please help me
Legion303
06-25-2006, 07:04 AM
I can't find a email adres on the FLstudio site, anybody knows a email adres where I can contact ImageLine support ?
Ask on the IL forums?
-steve
suzumebachi
08-29-2006, 09:42 PM
oy. one of my FLPs managed to get corrupted. kind of an important one too (it's for a site project). when i open it, the first VSTi it loads (EWQLSOSE) fails for some reason, which is followed by a dozen or so run-time errors. EWQLSOSE works fine on its own outside of this one particular project..
so, i opened up the FLP in XVI32, found the address for the 22nd from the end (which also happens to be a 31). 448E6. so i find the 64 74 and the following 3 bits are already E6 48 04 :(
it must be corrupted somewhere else :(
in the mean time i do have a backup, but it's a bit old (it doesn't have the ending, any of the recordings i've done, or any of the mastering).
Hi I tried to do what is explained in the post but after I open the file in CMD.EXE a lot of weird simbols appear very diferent from what is in the post. Am I doing something wrong? any help would be apreciated
thanks
kitizz
11-21-2006, 06:17 AM
hey guys,
I keep recieving the same message, except everytime I save a project, its 0kb in size, thus giving me the error message.
Does anybody know what could be causing this?
Thank you, Kit
PSTUBb
11-25-2006, 04:04 AM
Wow thanks. K, so it appears my file has been pretty badly corrupted.
I'm no reverse engineering genious but using Hex Workshop I compared several flp files to see what I could find out, since I'm using FL6 and I wanted to make sure this method still worked.
So in all files the two bytes after "dt" still point to the 22nd last byte. I also found that the 22nd last byte was always 31h. (h stands for hex of course).
In my corrupted file, the 22nd last byte was not 31, but DC. Also, the first two lines were not
00000000 464C 6864 0600 0000 0000 0900 6000 464C FLhd........`.FL
00000010 6474 D282 0100 C706 362E 302E 3800 C811 dt......6.0.8...
As they should be but
00000000 464C 6864 0600 0000 0000 1000 6000 D4F9 FLhd........`...
00000010 1200 5946 D000 C706 362E 302E 3800 C811 ..YF....6.0.8...
So I decided to replace the first two lines with good ones, and replace the pointer bytes with ones pointing to the 22nd last byte. Then I tried to open my file. It started opening instruments and plugins, then told me the file was corrupt, then the alert disapeared and I was left with a frozen screen of FLStudio, all my patterns and channels were there, one of my mixer channels was now purple and some characters in the playlist (not pattern labels) had turned to squares.
I'm getting close! I'll keep you guys posted. In the meantime if anyone has suggestions or would like to see the file, say something. I'll subscribe to the thread.
PS It seemed to me that the plugin causing the problem was "mda degrade" which I actually didn't need in the file at all. Just a warning. If you want to mess around with a plugin to see how it sounds, backup your file!! no wait. ALWAYS BACKUP YOUR FILES. in the music biz, extra HD = good investment.
EDIT: I tried to open the file again. Now everything seems fine till it tries to open mda degrade. Then it just hangs. I've tried renaming the plugin but it still doesn't work.
PSTUBb
11-25-2006, 04:32 AM
hey guys,
I keep recieving the same message, except everytime I save a project, its 0kb in size, thus giving me the error message.
Does anybody know what could be causing this?
Thank you, Kit
I hate to say this, but I'm pretty sure you're screwed. Open the file in a hexeditor. If it's empty/almost empty, theres nothing there :(
stevelaboy
03-14-2007, 06:18 PM
I really hope this isnt too late for you guys---
I FIGURED IT OUT! YOU CAN SAVE CORRUPT FRUITY LOOP FILES.
(and theres no rhyme or reason why, who cares?!)
Steve Laboy's Fix:
1) Load up your corrupt FLP file into fruity loops
The corruption error will show, fruity loops will be crippled,
and your song doesnt show up. First time i saw this i s*** a brick.
2) Click the "FILE" menu (up in the left hand corner) then goto "EXPORT" and on the submenu for "Export" that appears, click "Zipped loop package..."
3) Save this package to your FL Studio Projects folder (it should point you there automatically). Save it anywhere if you want, this will just make it easier.
4) Browse to the folder where you put this zip file, and extract the contents into a folder there.
YOUR WORKING PROJECT IS IN THERE! Thank Steve!
have a nice day, and end the war in iraq.
~~~~
Steve Laboy, TX
Its hot here...
i dont understand.
if you open the corrupt FLP, the song info doesnt load up? how can you send a zip off when there is no song data...i've tried this like a dozen times, and the zip is the same "untitled" wavs and flp.
i have the xvi hex editor, and i don't see anything at all that resembles what the original poster is talking about.
there has to be some way to fix this...somebody has to have a method...
PLEASE...
d
Tricklozen
04-13-2007, 02:23 AM
Adding to the information about the file format (had some hours to kill :P).
It is inspired by the standard MIDI file format. The files I have looked at have two chunks; a header chunk (FLhd), and a data chunk (FLdt). The header chunk appears to use the structure of the MThd chunk in a standard MIDI file.
Using the data from the original file in question:
46 4C 68 64 06 00 00 00 00 00 04 00 60 00 46 4C
64 74 B1 77 00 00 C7 06 35 2E 30 2E 31 00 C8 10Structurally:
The header chunk "FLhd" (464C6864H):
Offset Type Data Description
00000000H D32B 464C6864H Chunk identifier (FLhd)
00000004H D32L 06000000H Chunk size (6 bytes)
00000008H D16L? 0000H Type?
0000000AH D16L? 0400H Count?
0000000CH D16L? 6000H PPQN? (Propbably, 96 PPQN.)
The data chunk "FLdt" (464C6474H):
Offset Type Data Description
0000000EH D32B 464C6474H Chunk identifier (FLdt)
00000012H D32L B1770000H Chunk size (30641 bytes)
00000016H D8 C7H Version string prefix.
00000017H VLQ8 06H String length
00000018H D8 35H 2EH 30H 2EH 31H 00H ("5.0.1\0")
0000001EH ...
Types
D32B 32-digit (binary), big-endian
D32L 32-digit (binary), little-endian
D16L 16-digit (binary), little-endian
D8 8-digit (binary), endian-neutral
VLQ8 variable-length quantity, 8-digit (binary) quantity.
There is a general string format; prefix, length, data, as already seen with the version string prefix at the beginning of the FLdt data chunk.
If the chunk size value is zero, it could be calculated by taking the file size and subtract the offset to the FLdt contents.
In this file the FLdt chunk data offset begins at 16H:
FLdt chunk size = File size - FLdt chunk data offset
File size = 30663
FLdt chunk data offset = 22
FLdt chunk size = 30663 - 22 (16H)
FLdt chunk size = 30641
FLdt chunk size = 77B1H (base 16/hexadecimal)
FLdt chunk size = 000077B1H (32-bit, base 16/hexadecimal)
FLdt chunk size = B1770000H (little-endian byte-order)
..but who knows what really needs correction in a damaged file (except the people/person at Image-Line). Either FL Studio tolerates errors to a certain degree, since it was able to load the original file, or it lacks integrity checks on the chunk size with regards to the file size (meaning holes can be added at the end, since the original file was set to 22 bytes less than the file size).
I think our file might be totally hosed. I tried to fix it but didn't get anywhere.
Here's the corrupted file:
---
..if anyone has the know-how / willingness to fix it if salvageable.
We just spent a good 8 hours updating it (and saving it every now and again), but it suddenly got corrupted.. and it's the only copy of the file.
Also it's one of the tracks on the CD we were mere hours/days before releasing.
;_;
EDIT: Nevermind. The most recent .wav export is perfect except for its lack of a crazy bassline I added in at the end before the flp was corrupted. I'm using the entire export as an audio clip for a makeshift brand new noncorrupted flp file, and remaking the bass line.
trakstor
03-22-2008, 07:05 PM
Hi, I tried to follow the explanation that you gave but I did not understand how they open the corrupt flp file to correct the error .. but to me the file is not me saying it opens "An error occurred while reading the FLP file. It may be corrupted, or some plug caused an error while opening. " As we opened I was working on a mixer vst effect and they are locked in FL and was closed after which I will not open the project and I see this error message also file somewhere kb came to 203 mb.I tried to reopen the project on the same version of FL no vst used in the project (other than those who have inside). you can help in some way ..? Is a very important project for me .. and if I lose even one week to correct the error do..please replace here..
Legion303
05-25-2008, 12:00 PM
I Dunno LOL!
SprinterBot
08-04-2008, 09:10 AM
Here is online corrupted flp fixing tool (http://dj-wing.pp.ru/flp_recovery_tool/) (for damaged headers), forget about HEX editor.:wink:
Thanks Legion303!
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.