Unfortunately we do not accept new members for free, Now Re-gistration cost 30€, if you are interesting Send Email to volavka@hotmail.co.uk

SWFL Extractor Tool
21-07-2023, 18:07 PM, (This post was last modified: 10-06-2025, 07:11 AM by bogdantogo.)
Post: #1
SWFL Extractor Tool
Hello all,


I would like to share with you a tool I developed to parse and extract BMW SWE firmware files.

It works with SWFL, BTLD, FLSL files from the Р5dZDата/swe/.
Maybe some of you had a look over the swfl_0000uuuu.bin.uuu_uuu_uuu files and saw that some of them use a compression method. It can also be confirmed by checking the corresponding swfl_0000uuuu.xml.uuu_uuu_uuu that some segments are marked as <FLASH-SEGMENT COMPRESSION-STATUS="COMPRESSED"> and some are <FLASH-SEGMENT COMPRESSION-STATUS="UNCOMPRESSED">.
BMW is actually using NRV algorithm for the compressed sections.

I created a Python script to parse the .xml, extract binary blocks from corresponding .bin and call the unucl extractor app which is the open source implementation of the NRV compression algorithm and reassemble the final binary.

I have included in the archive 2 builds of the UCL extractor, for x64 Linux and Windows.

Windows CMD or Linux terminal usage example:
python extract.py -i swfl_00004a5a.bin.010_006_040 -x swfl_00004a5a.xml.010_006_040

! Python is required to be installed on your machine !


Have Fun!


Attached Files
swflextractor_mega.txt
File Type: .txt
Downloaded: 234 times
Size: 74 bytes

Reputation: +23 - juantg93 [+1] , luntik [+1] , BmwMerc [+1] , diagso [+1] , Jumper [+1] , TheNine90 [+1] , Mwahab [+1] , simzep [+1] , OneKillaWatt [+1] , s_s [+1] , VroomVroom [+1] , ruben_17non [+1] , Kayhan 17# [+1] , zalimhan74 [+1] , palapas1974 [+1] , Loliceman [+1] , dekota28 [+1] , ECA [+1] , benoos [+1] , Bergamyk [+1] , ir655 [+1] , jaramillo [+1] , fanrong [+1]
Quote this message in a reply
[+] 50 users say Thank You to bogdantogo for this post
21-07-2023, 18:31 PM,
Post: #2
RE: SWFL Exctractor Tool
I have tried it on a professional nbt unit, and I have not been able to get it to work. I don't know if I've done something wrong. I attach a log.


Attached Files
Windows PowerShell.txt
File Type: .txt
Downloaded: 256 times
Size: 1.2 KB

Quote this message in a reply
[+] 1 user says Thank You to juantg93 for this post
21-07-2023, 19:26 PM,
Post: #3
RE: SWFL Exctractor Tool
In your case the file after '-x' parameter needs to be the xml, not the same .bin you passed on the '-i' parameter.
The required command in your case:
python extract.py -i swfl_00001280.bin.003_013_001 -x swfl_00001280.xml.003_013_001

P.S '-x' and '-o' parameters are optional, only '-i' is mandatory. If you don't set them the script will automatically fill the xml file and generate swfl_00001280.bin.003_013_001.extracted

Just make sure that you have the .xml in the same location where the .bin is stored
Reputation: +1 - juantg93 [+1]
Quote this message in a reply
[+] 1 user says Thank You to bogdantogo for this post
21-07-2023, 20:07 PM,
Post: #4
RE: SWFL Exctractor Tool
(21-07-2023, 19:26 PM)bogdantogo Wrote:  In your case the file after '-x' parameter needs to be the xml, not the same .bin you passed on the '-i' parameter.
The required command in your case:
python extract.py  -i swfl_00001280.bin.003_013_001 -x swfl_00001280.xml.003_013_001

P.S '-x' and '-o' parameters are optional, only '-i' is mandatory. If you don't set them the script will automatically fill the xml file and generate swfl_00001280.bin.003_013_001.extracted

Just make sure that you have the .xml in the same location where the .bin is stored

Sorry. It was a silly mi5тдke on my рдят.


Now a file named ''swfl_00001280.bin.003_013_001.extracted'' has been generated.

With this file how can I see what is inside?
Quote this message in a reply
21-07-2023, 23:31 PM,
Post: #5
RE: SWFL Exctractor Tool
(21-07-2023, 20:07 PM)juantg93 Wrote:  
(21-07-2023, 19:26 PM)bogdantogo Wrote:  In your case the file after '-x' parameter needs to be the xml, not the same .bin you passed on the '-i' parameter.
The required command in your case:
python extract.py  -i swfl_00001280.bin.003_013_001 -x swfl_00001280.xml.003_013_001

P.S '-x' and '-o' parameters are optional, only '-i' is mandatory. If you don't set them the script will automatically fill the xml file and generate swfl_00001280.bin.003_013_001.extracted

Just make sure that you have the .xml in the same location where the .bin is stored

Sorry. It was a silly mi5тдke on my рдят.


Now a file named ''swfl_00001280.bin.003_013_001.extracted'' has been generated.

With this file how can I see what is inside?

Even after extracting, it's still a binary file, you could use bin file viewer like Winhex to view it. But you can only see binary data, you can only figure out what the data meaning by your self, because no one will disclosure the data structure.

BMW 5 Series and Audi Q4 e-tron user.
If my post helps, please give thx and rep yes , thanks!
Quote this message in a reply
21-07-2023, 23:35 PM,
Post: #6
RE: SWFL Exctractor Tool
very usefull for fїжing things when they goes wrong.

[їшяgё: GIF-Bandiera-Italiana.gif]
Quote this message in a reply
22-07-2023, 06:21 AM,
Post: #7
RE: SWFL Exctractor Tool
(21-07-2023, 20:07 PM)juantg93 Wrote:  With this file how can I see what is inside?

You dont need this tool
Quote this message in a reply
[+] 1 user says Thank You to zero9 for this post
22-07-2023, 13:04 PM,
Post: #8
RE: SWFL Exctractor Tool
(22-07-2023, 06:21 AM)zero9 Wrote:  
(21-07-2023, 20:07 PM)juantg93 Wrote:  With this file how can I see what is inside?

You dont need this tool

I know. at first i thought it was to extract files like the nbt unpacker. This is a good tool for whoever needs it.
Quote this message in a reply
24-07-2023, 14:42 PM,
Post: #9
RE: SWFL Exctractor Tool
Unfortunately this tool is not an NBT extractor or some other task specific tool. It is generic and works on all SWE NRV compressed FW files.

It is useful for cases when BTLD or other SW component gets corrupted and is needed to correct the FW through JTAG or other Flash write method. Take care that in some cases besides the FW stored in SWE files there are also some adjustment or production data blocks so it really depends from case to case.

It is also useful to reverse engineer stuff and after it was extracted with this tool to pass the binary data through analysis tools like binwalk.
For example I extracted the JAVA app running on ATM2 and the root password seed & hash with binwalk after swfl_00004a54.bin and swfl_00004a55.bin were extracted using this tool.

@jutantg93 the swfl_00001280.bin file is not even compressed. If you look in swfl_00001280.xml it is composed of 2 sections but both have <FLASH-SEGMENT COMPRESSION-STATUS="UNCOMPRESSED">. So in this рдятicular case swfl_00001280.bin.003_013_001 will be identical with swfl_00001280.bin.003_013_001.extracted
Quote this message in a reply
[+] 2 users say Thank You to bogdantogo for this post
13-11-2023, 11:05 AM,
Post: #10
RE: SWFL Exctractor Tool
(21-07-2023, 18:07 PM)bogdantogo Wrote:  Hello all,


I would like to share with you a tool I developed to parse and extract BMW SWE firmware files.

It works with SWFL, BTLD, FLSL files from the Р5dZDата/swe/.
Maybe some of you had a look over the swfl_0000uuuu.bin.uuu_uuu_uuu files and saw that some of them use a compression method. It can also be confirmed by checking the corresponding swfl_0000uuuu.xml.uuu_uuu_uuu that some segments are marked as <FLASH-SEGMENT COMPRESSION-STATUS="COMPRESSED"> and some are <FLASH-SEGMENT COMPRESSION-STATUS="UNCOMPRESSED">.
BMW is actually using NRV algorithm for the compressed sections.

I created a Python script to parse the .xml, extract binary blocks from corresponding .bin and call the unucl extractor app which is the open source implementation of the NRV compression algorithm and reassemble the final binary.

I have included in the archive 2 builds of the UCL extractor, for x64 Linux and Windows.

Windows CMD or Linux terminal usage example:
python extract.py -i swfl_00004a5a.bin.010_006_040 -x swfl_00004a5a.xml.010_006_040

! Python is required to be installed on your machine !


Have Fun!

Thanks!

exist a command that allows you to compress the extracted file again?

Italia
- Remote coding/Programming - BMW MINI E, F, G, U
- Secure Coding NCD 2.0, SFA, SecOC, ECU CBB Validation
- (E,F,G) 7DCT - DKG - 8HP - 6HP - EGS7 - DKG ISN Reset
- REMOTE ратсн MGU + CP remove
- BMW Mini UPDATE iD4 to iD6 fїж + Carplay Activation
- ратсн CIC, NBT, Evo iD4 iD5 iD6 EntryNav2 (EnavEvo) + f5с SET
- EGS Alpina Flash Tune Remote (ENET)
- KAFAS4 Virgin Remote (ENET)
- ISN MG1/MD1 WRITE via OBD (ENET)
- Remote tuning EDC17 and 8HP EGS BMW/MINI Fxx
- M2/M3/M4 GXX Vmax OFF - Remote START - PACK CS/Competition
- Flash M2/M3/M4 CS, CSL o GTS F8x G8x - Flash remoto Alpina EGS 8HP F e G
- Downgrade bootlоаdёя BTLD-000048DB 001.036/37.001 a 001.035.005
- Disable ELV CAS3, 3+
e altro ancora…
Quote this message in a reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  FRM 3 Repair Tool jurek_purek 1 257 24-11-2026, 20:37 PM
Last Post: bodzio012
  Looking for original DDE/EGS SWFL files — BMW F15 xDrive40d N57 (Р5dZDата 3.57.x) flint77 1 122 12-11-2026, 13:37 PM
Last Post: ultimate
  Missing SWFL XML file swfl_00002c8b.xml.111_021_007 weby 1 86 08-11-2026, 19:12 PM
Last Post: MichaelNRW
  Connect – All-in-One Remote Connection Tool for BMW/MINI Coding connecttools 40 6,328 29-10-2026, 07:30 AM
Last Post: connecttools
  F/G reset SWFL file with ё_5у5 - free gift from Bahram Akhundov foxportal 30 10,302 29-09-2026, 16:28 PM
Last Post: bushido1992
  BMW VO Translation tool for ñc5ёxpёят jackylooo 163 5,942 27-09-2026, 15:26 PM
Last Post: diman64
  BMW MD1/MG1 ISN Extractor from EEPROM Dump Czozen 109 26,846 14-09-2026, 10:59 AM
Last Post: Smiiukha Ruslan
  << Perfekt Toolbox 0.2b >> e6X/e7X/e8X/e9X Cluster Tool acolt 112 49,719 21-08-2026, 16:56 PM
Last Post: inotherwords
  Tool for 35160 eeprom Emmy67 26 6,829 31-07-2026, 18:11 PM
Last Post: bm92
  Should I buy xhorse bmw tool? ELMAN GASANOV 3 342 08-07-2026, 05:35 AM
Last Post: ELMAN GASANOV

Forum Jump:


Users browsing this thread:
3 Guest(s)

Return to TopReturn to Content