Xevin Posted June 10, 2010 Report Share Posted June 10, 2010 (edited) After a ton of research, I have completely figured out how to extract the audio files from Battlefield: Bad Company 2(BFBC2). I'm just going to post what I've figured out so far by reading the forums here and over at a few other places (xentax.com, aluigi.freeforums.org). This is my first post here, so please don't hurt me. Also apparently you can only extract one type of sound: WaveDataSns. DISCLAIMER: I DID NOT create any of these tools, or discover anything new! I'm just posting this here for other people looking to do the same thing I did! Programs You Will Need: 1.Xbox 360 ISO Extract (mirror) (created by somski) 2.ea_multi_xma (created by HCS) (http://hcs64.com/vgm_ripping.html) 3.xma_parse (created by HCS) (http://hcs64.com/vgm_ripping.html) 4.quickbms (created by Luigi Auriemma) (http://aluigi.org/papers.htm#quickbms) 5.ToWAV (created by Xplorer) (http://www.ctpax-x.ru/index.php?goto=files&show=24) Prerequisites: Average Computer Skills Battlefield Bad Company 2 XBOX360 ISO 15-20GB free HD space Step 1: Extract ISO Run XBOX360ISOExtract.exe Click "choose ISO-Folder" Find folder with your BFBC2 ISO file Click "choose destination" Make New Folder "ExtractedISO" Choose destination folder "ExtractedISO" Click "Scan" Click "Go" Wait Step 2: Program Prep Extract all the remaining programs. Put the following files into a new folder called "ExtractOmatic": ea_multi_xma.exe quickbms.exe towav.exe xma_test.exe Step 3: Make .bms Files Make a new text file named "fbrb.txt" in your "ExtractOmatic" folder Paste the following text into it: # Battlefield: Bad Company (script 0.1.3) # script for QuickBMS http://aluigi.org/papers.htm#quickbms endian big comtype deflate idstring "FbRB" get SIZE long savepos OFFSET set MEM_FILE long 1 callfunction gzip_fbrb_sux math OFFSET += SIZE get SIZE asize math SIZE -= OFFSET goto OFFSET set MEM_FILE long 2 callfunction gzip_fbrb_sux get VER long MEMORY_FILE get INFO_OFF long MEMORY_FILE savepos NAME_BASE MEMORY_FILE math INFO_OFF += NAME_BASE goto INFO_OFF MEMORY_FILE get FILES long MEMORY_FILE for i = 0 < FILES get NAMEOFF long MEMORY_FILE get DUMMY long MEMORY_FILE get OFFSET long MEMORY_FILE get SIZE long MEMORY_FILE get XSIZE long MEMORY_FILE get NAMESZ long MEMORY_FILE savepos TMP MEMORY_FILE math NAMEOFF += NAME_BASE goto NAMEOFF MEMORY_FILE #getdstring NAME NAMESZ MEMORY_FILE get NAME string MEMORY_FILE goto TMP MEMORY_FILE log NAME OFFSET SIZE MEMORY_FILE2 next i # fbrb sux, it specifies a wrong size for the gzip file in some archives (like ondemand_awards-00.fbrb) # so when QuickBMS goes at its end to find the uncompressed size field it finds a zero... bad startfunction gzip_fbrb_sux savepos TMP_OFF endian little get GZIP_SIGN short if GZIP_SIGN == 0x8b1f get CM byte get FLAGS byte get MTIME long get XFL byte get OS byte if FLAGS & 4 get TMP short getdstring TMP TMP endif if FLAGS & 8 get TMP string endif if FLAGS & 16 get TMP string endif if FLAGS & 2 get TMP short endif savepos TMP math SIZE += OFFSET math SIZE -= 4 # uncompressed size goto SIZE get XSIZE long math SIZE -= TMP if XSIZE < SIZE # so also if it's 0 math XSIZE = SIZE math XSIZE *= 12 # enough? endif if MEM_FILE == 1 clog MEMORY_FILE TMP SIZE XSIZE else clog MEMORY_FILE2 TMP SIZE XSIZE endif else if MEM_FILE == 1 log MEMORY_FILE OFFSET SIZE else log MEMORY_FILE2 OFFSET SIZE endif endif goto TMP_OFF endian big endfunction Save it Close it Rename to "fbrb.bms" (fbrb.bms created by Luigi Auriemma) Make a new text file named "addheader_stereo.txt" in your "ExtractOmatic" folder Paste the following text into it: set MEMORY_FILE binary "\x52\x49\x46\x46\xb8\x59\xa7\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x20\x00\x00\x00\x65\x01\x10\x00\xd6\x10\x00\x00\x01\x00\x00\x03\xe3\x9a\x00\x00\x80\xbb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x02\x00\x64\x61\x74\x61\xff\xff\xff\x70" get NAME basename get SIZE asize string NAME += ".xma" append log MEMORY_FILE 0 SIZE append math SIZE += 60 log NAME 0 SIZE MEMORY_FILE Save it Close it Rename to "addheader_stereo.bms" (created by AlphaTwentyThree) Make a new text file named "addheader_mono.txt" in your "ExtractOmatic" folder Paste the following text into it: set MEMORY_FILE binary "\x52\x49\x46\x46\xb8\x59\xa7\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x20\x00\x00\x00\x65\x01\x10\x00\xd6\x10\x00\x00\x01\x00\x00\x03\xe3\x9a\x00\x00\x80\xbb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x00\x64\x61\x74\x61\xff\xff\xff\x70" get NAME basename get SIZE asize string NAME += ".xma" append log MEMORY_FILE 0 SIZE append math SIZE += 60 log NAME 0 SIZE MEMORY_FILE Save it Close it Rename to "addheader_mono.bms" (created by AlphaTwentyThree) Step 4: Extract FBRB Files Run quickbms.exe Browse to your "ExtractOmatic" folder and load "fbrb.bms" Browse to "ExtractedISO\dist\xenon\streaming_sounds-00.fbrb" Make new folder "ExtractedFBRB" Select folder "ExtractedFBRB" Let it Rip! NOTE: Rinse and Repeat for other .fbrb files as needed. NOTE: Not all .fbrb files contain sound files. NOTE: Extracting all .fbrb into the "ExtractedFBRB" folder will result in a nice and tidy folder tree. Step 5: Make Duplicates Copy (CTRL-C) the "ExtractedFBRB\Sound" folder. Make a new folder called "ExtractedSound" Open the "ExtractedSound" folder Paste (CTRL-V) Paste again (CTRL-V) (Trust me damnit!) Rename one of the "Sound" folders "Sound-stereo" Rename the other "Sound" folder "Sound-mono" NOTE: The reason for the duplicate "Sound" folders is that there is no way to determine if a .res file is stereo or mono. If a stereo file is extracted as mono it will 1) emit static, or 2) play nothing at all. This also applies to the inverse. To solve this we are going to processes the whole "Sound" file twice; once as Stereo and then again as Mono. Then we can delete the static files on the Mono folder and overwrite the static files in the Stereo folder using the Mono files. Step 6: Make Batch Files Make a new text file named "RUN - Stereo.txt" in your "ExtractOmatic" folder Paste the following text into it: for /r %%i in (*.res) do "%CD%\ea_multi_xma.exe" "%%i" -o 0x00 for /r %%i in (*.res_stream1) do ren "%%i" *.str for /r %%i in (*.str) do "%CD%\xma_test.exe" "%%i" -2 -r "%%i.xm" del /s *.str for /r %%i in (*.xm) DO "%CD%\quickbms.exe" -o "%CD%\addheader_stereo.bms" "%%i" "%%~dpi\" del /s *.xm for /r %%i in (*.xma) do ( "%CD%\towav.exe" "%%i" move *.wav "%%~dpi/" ) del /s *.xma del /s *.res Save it Close it Rename to "RUN - Stereo.bat" (created by AlphaTwentyThree, modified by Xevin) Make a new text file named "RUN - Mono.txt" in your "ExtractOmatic" folder Paste the following text into it: for /r %%i in (*.res) do "%CD%\ea_multi_xma.exe" "%%i" -o 0x00 for /r %%i in (*.res_stream1) do ren "%%i" *.str for /r %%i in (*.str) do "%CD%\xma_test.exe" "%%i" -2 -r "%%i.xm" del /s *.str for /r %%i in (*.xm) DO "%CD%\quickbms.exe" -o "%CD%\addheader_mono.bms" "%%i" "%%~dpi\" del /s *.xm for /r %%i in (*.xma) do ( "%CD%\towav.exe" "%%i" move *.wav "%%~dpi/" ) del /s *.xma del /s *.res Save it Close it Rename to "RUN - Mono.bat" (created by AlphaTwentyThree, modified by Xevin) Step 7: The Final Fontier Cut (CTRL-X) your "Sound-stereo" folder Paste (CTRL-V) into your "ExtractOmatic" folder Run "RUN - Stereo.bat" Wait... Cut (CTRL-X) your "Sound-stereo" folder Paste (CTRL-V) back to where it was Cut (CTRL-X) your "Sound-mono" folder Paste (CTRL-V) into your "ExtractOmatic" folder Run "RUN - Mono.bat" Wait... Cut (CTRL-X) your "Sound-mono" folder Paste (CTRL-V) back to where it was Begin deleting the static files out of the "Sounds-mono" folder NOTE: There are many more Mono files then Stereo files. Thus less things to delete in the Mono Folder. Cut (CTRL-X) the folders INSIDE "Sounds-mono" Paste (CTRL-V) the folders INTO "Sounds-stereo" Click Overwrite ALL Rename the "Sounds-stereo" folder to "Sounds - Extracted" Enjoy! If you have any questions I probably can't answer them, but I'll try. Credits: Luigi Auriemma HCS AlphaTwentyThree Xplorer somski Edited June 10, 2010 by Xevin Quote Link to comment Share on other sites More sharing options...
Xevin Posted June 10, 2010 Author Report Share Posted June 10, 2010 (edited) Hmm. OK so I only found out how to convert the "WaveDataSns" files with the above technique. So I started trying to figure out how to do the "Wave" files too. I appears you have to cut off the first 32bytes in each file when processing with ea_multi_xma.exe by using 0x20 in the batch file. I'm testing this now to make sure it works for all the "Wave" files... [edit]I found some that need the first 30 cut off. (0x1C)[/edit] [edit]Ok. It's random. From what I can tell there are actually multiple audio files inside each "Wave.res" file. For instance in \Sound\Vehicles\Land\T90\T90_Start_Idle_Stop_Wave.res it contains 3 sound files. Obviously it's the engine start, idle and stop sound. The first offset cut is at 0x1C, the second at 0x4934 and the third is at 0xB414. I don't think the ea_multi_xma.exe program can search for hex strings so, ripping the "Wave.res" files remains a manual thing unless someone knows something I don't (pleasepleasepleaseplease...). AFAIK the hex string that denotes the start of a new audio file is: 48 00 00 0C 13 00 bb 80 40 01 Anyone know a command line program that can search a file for a string then output the location of the start of the string to a variable that I can use in the batch file?[/edit] Edited June 10, 2010 by Xevin Quote Link to comment Share on other sites More sharing options...
Adam243 Posted June 11, 2010 Report Share Posted June 11, 2010 For some odd reason, when i start ea_multi_xma.exe. It just sits there doing nothing. This happens when i have the correct offset. I know it is the correct offset because any other offset produces errors. Does it take a long time for ea_multi_xma.exe to work on the file? Quote Link to comment Share on other sites More sharing options...
Xevin Posted June 11, 2010 Author Report Share Posted June 11, 2010 (edited) Hmm. I've had ea_multi_xma refuse to load a file, but it would normally error out. It would only lock for me if I chose an offset that contained "00". OR I tried to extract a .res that was not an audio file. There are a few of those in the "Sound" folder. They are mostly less then 3kb. The only standard offsets I found for .res sound files were 0x00 0x20 0x1C and 0x60 (in order of most common to least common). If the offset is 0x1C it a multi-stream file. To extract the other streams from a 0x1C offset file you have to use a Hex editor and search for this string: 48 00 00 0C Every time you find this string use the offset for "48" (H). There are typically 3 streams in a multi-stream file. Also any .res can have either stereo or mono audio files. So I ended up using 8 different .bat files and 1 random .bat that I would edit on the fly with offsets and stereo/mono headers for the multi-stream (0x1C) files. There are a few .res audio files that CANNOT be extracted. They are in a different format or something. I could find the "48 00 00 0C" string (mostly at 0x20) but they would just extract to a garbled mess. At first I thought it was because they were stereo and I was extracting mono, but after changing that, they still would extract garbled, or not at all. After all was said and done, I extracted about 94% of the sound files. I got the sound files I needed. And I learned a lot along the way. I hope my experiences help other people. [edit]Oh and for those who want it: BFBC2 - End Credits Music[/edit] Edited June 11, 2010 by Xevin Quote Link to comment Share on other sites More sharing options...
UberWazuSoldier Posted June 11, 2010 Report Share Posted June 11, 2010 That's pretty cool, any news about the PC version? Quote Link to comment Share on other sites More sharing options...
Xevin Posted June 11, 2010 Author Report Share Posted June 11, 2010 Sadly, no. =( Quote Link to comment Share on other sites More sharing options...
UberWazuSoldier Posted June 11, 2010 Report Share Posted June 11, 2010 (edited) Oh well. Ooh hey, I wonder if this could help clarify whether that WW2 Sarge says "Okay, you watch ahead Wyatt" as DICE's subtitler thinks, or "Okay, you watch ya head Wyatt" as I think he says (which makes sense because a guard tower nearly flattens the car immediately after he says this). Edited June 11, 2010 by UberWazuSoldier Quote Link to comment Share on other sites More sharing options...
Xevin Posted June 11, 2010 Author Report Share Posted June 11, 2010 (edited) Oh well. Ooh hey, I wonder if this could help clarify whether that WW2 Sarge says "Okay, you watch ahead Wyatt" as DICE's subtitler thinks, or "Okay, you watch your head Wyatt" as I think he says (which makes sense because a guard tower nearly flattens the car immediately after he says this). Here ya go man. Edited June 11, 2010 by Xevin Quote Link to comment Share on other sites More sharing options...
UberWazuSoldier Posted June 11, 2010 Report Share Posted June 11, 2010 By gum, he actually DOES say ahead! Quote Link to comment Share on other sites More sharing options...
Sfinks Posted June 12, 2010 Report Share Posted June 12, 2010 (edited) to Xevin What do I do not so? I have made archive under your scheme and I try to recode remarks from game. But at me a problem. Sounds turn out accelerated why I do not know. I think that in all my system is guilty, but is not assured. ExtractOmatic.exe Sounds Edited June 12, 2010 by Sfinks Quote Link to comment Share on other sites More sharing options...
Xevin Posted June 13, 2010 Author Report Share Posted June 13, 2010 to Xevin What do I do not so? I have made archive under your scheme and I try to recode remarks from game. But at me a problem. Sounds turn out accelerated why I do not know. I think that in all my system is guilty, but is not assured. ExtractOmatic.exe Sounds Yeah... I'm not going to download an .exe from someone I don't know. Especially if he does not speak proper English. Also the extractOmatic is a folder containing the programs not an .exe, so that really makes me think you have a nice little virus and you want to give it away. Quote Link to comment Share on other sites More sharing options...
Sfinks Posted June 13, 2010 Report Share Posted June 13, 2010 Yeah... I'm not going to download an .exe from someone I don't know. Especially if he does not speak proper English. Also the extractOmatic is a folder containing the programs not an .exe, so that really makes me think you have a nice little virus and you want to give it away. This is only one SFX packages from the WinRar to unpack deletes everything you do not need and there is only sound Folder. dude, if I need help I'm so not a shit. Here, then normal Quote Link to comment Share on other sites More sharing options...
Xevin Posted June 14, 2010 Author Report Share Posted June 14, 2010 This is only one SFX packages from the WinRar to unpack deletes everything you do not need and there is only sound Folder. dude, if I need help I'm so not a shit. Here, then normal These .res files are NOT from the XBOX 360 VERSION. Quote Link to comment Share on other sites More sharing options...
Sfinks Posted June 14, 2010 Report Share Posted June 14, 2010 (edited) These .res files are NOT from the XBOX 360 VERSION. Clearly, the das. I have of Allstars. Then laid his times think that this is not correct. If possible then to wav. Thx Edited June 14, 2010 by Sfinks Quote Link to comment Share on other sites More sharing options...
UberWazuSoldier Posted June 14, 2010 Report Share Posted June 14, 2010 Only the Xbox 360 sounds can be converted to .wav - PC and PS3 use a different format, so it will not work to use those. Quote Link to comment Share on other sites More sharing options...
Sfinks Posted June 14, 2010 Report Share Posted June 14, 2010 (edited) Only the Xbox 360 sounds can be converted to .wav - PC and PS3 use a different format, so it will not work to use those. I know it myself. What I have here is Battlefield.Bad.Company.2.PAL.X360-Allstars. and do not tell me did it wrong. Why this now somehow not right, I do not know, I beg to correct WAVs and if it works. Edited June 14, 2010 by Sfinks Quote Link to comment Share on other sites More sharing options...
Xevin Posted June 14, 2010 Author Report Share Posted June 14, 2010 I know it myself. What I have here is Battlefield.Bad.Company.2.PAL.X360-Allstars. and do not tell me did it wrong. Why this now somehow not right, I do not know, I beg to correct WAVs and if it works. Maybe the PAL version has a different audio format? All I know is the .res files you uploaded do not have the "48 00 00 0C" string in the hex. It's a miracle they extract to the super speed audio files at all. I used an NTSC copy of the game to extract from and it works. As far as I can tell you did everything right. The only thing you are doing wrong is the .res files you are using. If you don't mind my asking, what is your native language? Quote Link to comment Share on other sites More sharing options...
Sfinks Posted June 14, 2010 Report Share Posted June 14, 2010 Hmm. It's an idea. I must try. I speak German and Russian. Quote Link to comment Share on other sites More sharing options...
UberWazuSoldier Posted June 17, 2010 Report Share Posted June 17, 2010 48 00 00 0C? The PC one has that as well. Quote Link to comment Share on other sites More sharing options...
Sfinks Posted June 17, 2010 Report Share Posted June 17, 2010 I have all figured out. happened thanks. Now began studying MOH Beta. Surprisingly there is also a system that in BFBC. Unpack happened, but encode with ea_multi_xma no Quote Link to comment Share on other sites More sharing options...
loosebruce Posted June 18, 2010 Report Share Posted June 18, 2010 (edited) Any Idea where I can get the: -Gun firing sounds -Sounds for Impacts, Ear Buzzing/High Pitched Noise, -Environmental Sounds like Trees, Birds etc Thanks Edited June 18, 2010 by loosebruce Quote Link to comment Share on other sites More sharing options...
red99 Posted June 21, 2010 Report Share Posted June 21, 2010 Any Idea where I can get the: -Gun firing sounds -Sounds for Impacts, Ear Buzzing/High Pitched Noise, -Environmental Sounds like Trees, Birds etc Thanks Look in \Sound\Ambients As for gun fire/explosion I believe these are dynamically rendered to account for echos etc. I haven'nt seen any files relating to them so far. I would be interested to know more. Quote Link to comment Share on other sites More sharing options...
-=anders=- Posted June 27, 2010 Report Share Posted June 27, 2010 Hi guys! Nice find, I hope! I've got some errors pretty early in the process. (Call me stupid or anything) But the "fbrb.txt" paste I did doesnt look the same as in the topic at all. It's all mixed in notepad. Any ideas on how to get it correctly as it's supposed to be? I tried to manually stack the code up as shown in the topic, but that didnt help either... After pressing "Save" in QuickBMS in my "\dist\xenon\ExtractedFBRB" -directory I get this error message: "Error: Invalid datatype at line 7" Need help! This is the same with the other codes you're supposed to paste into Notepad and then rename to *.BMS. Dont u use notepad for pasting? /Anders Quote Link to comment Share on other sites More sharing options...
Xevin Posted June 30, 2010 Author Report Share Posted June 30, 2010 loosebruce, Impact sounds - Sound\MAOISM\ Ear ring - not sure (might be rendered in game) Guns firing - Sounds\Weapons\ -=ander=-, Not sure what the problem is. Make sure you are using NOTEpad and not WORDpad. Still having issues? Try Notepad++. Quote Link to comment Share on other sites More sharing options...
-=anders=- Posted June 30, 2010 Report Share Posted June 30, 2010 (edited) loosebruce, Impact sounds - Sound\MAOISM\ Ear ring - not sure (might be rendered in game) Guns firing - Sounds\Weapons\ -=ander=-, Not sure what the problem is. Make sure you are using NOTEpad and not WORDpad. Still having issues? Try Notepad++. Hey, it worked now!!! yey! Tried firefox instead, then it worked to paste correctly. Ok, so now I've extracted all sounds-res files (I think), but there're no firing sounds except some in the weapons folder. Only 3p reload sounds.... How come??? Where're the firing sounds? [EDIT] So, now i've completed the whole procedure! But, almost ALL files are static... Any ways to fix them??? And the weapon fire sounds again.. Where the heck are they? Edited June 30, 2010 by -=anders=- Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.