SXC exTRACTOR BECAUSE SEXY DOESN'T HAVE TO BE big
### Prologue The SCS Extractor has been introduced years ago, widely used by most modders to extend the functionality and gameplay experiences on both SCS popular games Euro Truck Simulator 2 and American Truck Simulator. Even though it's handy and useful, SCS Extractor has a big disadvantage: lack ability of selective file extraction. Came from that limitation, the SXC Extractor was written. SXC Extractor (can be pronounced as Sexy Extractor) is another level compared to the predecessor. It has list mode, able to selectively extract or list contents based on certain criteria, and also support extracting mod zipped files even with the "encrypted" ones. SXC Extractor however does not provide ability to compress or recompress. As its name says it just an extractor tool. Visit SXC discussion thread at SCS Forum and drop a comment there if you have problem, find bug, or just want to say hi.
Basic Usage | Extended Usage
About the Program | Mod File with No Base Root
Working with Files | Working with Missing Items
List Mode & Extraction | Name Resolver List
Base Path & Wildcard Filtering | File Size Filtering
Advanced Filtering | File Type Scanning
Output Suppression |
List Mode & Page Pausing |
List Mode Display |
Force Mode |
Quit Prompt Message |
# Basic Usage ### About the Program SXC Extractor is a console program runs under Microsoft Windows. Like the predecessor, it is a simple text based application. No fancy GUI and no bullsh*t. It comes without installer. Extract the SXC Extractor package using any ZIP Archiver program onto a destination folder of your choice. From Windows Explorer, press Shift + Right Click on the extracted destination folder then choose a menu item labeled as "Open Command Prompt from here" or "Open Power Shell from here" depending on your Windows version. Running SXC Extractor can be done by typing: sxc Or under Power Shell console: .\sxc.exe After typing, press the Enter key on the keyboard to actually execute the application. Running extractor without any parameter will just display a usage tips of parameter description, which will have described more details here. ### Working with Files SXC Extractor requires at least one parameter in order to function. You need an input file to be processed, either SCS native game data/DLC files (with .scs extension) or mod zipped files (with .scs or .zip extension). It can be typing like this: sxc thefile.scs Or: .\sxc.exe thefile.zip Note the argument is preceding with a space character. Each argument must be separated with at least one space character. If an argument contains spaces, you should enclose it with double-quotes. Take a look at this example for input file that containing long path and spaces: sxc "C:\Program files (x86)\Steam\steamapps\common\Euro Truck Simulator 2\def.scs" Typing long argument can be a painful task especially if you don't know how to copy a fully qualified path with file name and pasting it into Windows console. SXC Extractor allow you to select a file in an easy way through Open File dialog. Use an -i switch (lowercase letter 'I') as replacement of input file into the argument as follow: sxc -i It will bring you a popup dialog window to select a file. Pressing Cancel button on the dialog will abort the operation, and display usage tips as if you run the program without argument. Another trick is by creating a Windows shortcut and store it in the same folder of SXC Extractor. For example, if you create a shortcut that pointing to actual "base.scs" file on Steam folder with the shortcut file name it as "base.scs" and store it in SXC Extractor folder, you can supply this shortcut as the input file argument: sxc base.scs Or: sxc base.scs.lnk When working with SCS native game data/DLC input file, SXC Extractor will create an associate index file (with .idx extension) and store it at the same folder where SXC Extractor stored. The index file will be created when opening input file at the first time, or re-created when the input file gets update. Index file is required in the purpose of speed up process to work with the same input file later. Note that there'll be no index file being generated when working with mod zipped file. By default, all index files (*.idx) always stored and accessed from the same folder where SXC Extractor located. Starting from version 1.19.10.15, you can specify different folder location to store and access all index files by putting the -Li switch (uppercase letter 'l' and lowercase letter 'I') then followed by the designated path. For example: sxc base.scs -Li "C:\sxc\index files" This will causing the tool to generate or load all those index files located on "C:\sxc\index files" folder. Make sure the folder path you specify does exists, otherwise SXC Extractor will revert back by looking them onto the default location (which is the tool's folder itself). Using the -Li switch has a little disadvantage because you have to declare it each time running the tool's commands. For semi-permanent solution, you can define the path through Windows console environment variable. From the above example, type this command on Windows console: set SXC_IDX_PATH=C:\sxc\index files There is not necessary to enclose the path with double-quotes when defining through environment variable. By defining it once, you can launch the tool multiple times without having to put the -Li switch every time. As mentioned before, defining the path through environment variable is a "semi-permanent" solution because it will gone when you close the console window. Make it as permanent is highly not recommended unless you know what you're doing. Also it is advisable to always specify full qualified path and stay away from using relative path to prevent problems later. ### List Mode & Extraction If supplying with only input file, SXC Extractor works under list mode. List mode is where you are able to see the list of items (files and folder paths) within the input file without actually extracting them. By default, only files with their own path are listed. To extract these items, you have to supply the output path argument as target extraction folder. Output path argument must be pointing to an existing folder with write access permission. Avoid supplying path to system folders as they might have special access permission that may not granted to Windows user currently logged in. Output path is specified by an -o switch (lowercase letter 'O') followed by the target folder path like this: sxc myfile.scs -o C:\Temp If the target folder path containing spaces, as usual you must enclose it with double-quotes, like this: sxc myfile.scs -o "C:\My projects\ets2 mod" In older version of SXC Extractor, any files stored in output folder specified with -o switch will be overwriten. Starting with version 1.19.11.30, any existing file will be preserved. This is allow you to extract additional files into your project folder without accidentally overwrite the existing working files. If you want to overwrite the existing files anyway (like the old behavior ones), use -ov instead of -o switch. SXC Extractor allow you to select target folder path by selecting it from a folder selection dialog. Instead of using an -o switch, replace it with an -od switch like this: sxc myfile.scs -od On execution, it will ask for target folder location through a dialog window. Pressing the Cancel button on the dialog will abort target folder path selection and automatically fallback into the list mode. For security reason, SXC Extractor does not natively support folder shortcut or logical folder like a ZIP file. ### Base Path & Wildcard Filtering The main feature of SXC Extractor is the ability to list or extract selective files. This is done through the -d and -f switches (lowercase letter 'D' and 'F' respectively). The -d switch is used to specify the base path as working root path. Any items on input file where outside this path will be ignored and excluded from the process. Specify this base path as second argument after the -d switch, as shown in this example: sxc base.scs -d unit/hookup/ This will list all items under "unit/hookup/" path on the "base.scs" input file. Just take a look at another example: sxc def.scs -o C:\Temp -d \def\world This will extract all files under "def\world\" path in input file "def.scs" and store those files into "C:\Temp" folder. Even though you specify a base path, the results of extracted files still maintain the original directory structures. From the above example, those files (and subfolders if any) can be found in "C:\Temp\def\world" folder. It works that way to allow modders working with their mods and keep directory structures in place. Note that you can specify slash or backslash character as delimiter in the base path, with or without leading and trailing path delimiter. The -f switch allow you to filter items in input file based on '*' (asterisk) and '?' (question mark) pattern characters. The text pattern follows after the switch. Asterisk character means "anything else" while the question mark means "any one character". These pattern characters can be placed anywhere, single or multiple times. For example, a pattern "*side" will match any text trailing with "side", so these text will match: from the inside beyond the outside but these text won't: for the insider both the sideways A pattern "the*" will match any text leading with "the", so these text will match: the brown fox there'll be only one but these text won't: other than him mother nature A pattern "*ing*" will match any text contains "ing", so all these text will match: ingredients of soup made for anything the ingenious winglets A pattern "*mo*th*" will match any text contains "mo" followed any text contains "th", so these text will match: monthly income up to his mother The pattern with question mark will find any matches fit into single character. For example, a pattern "ab?de" would match a word like "abcde", "ab1de", "ab de", etc. A pattern "some?????" will match word "something", somewhere", or "somewhat." (notice the trailing period character). You may combine both asterisks and question marks on the pattern. For example, a pattern "*h??self" will match "himself" or "ask to herself". The -f switch if used alone without the -d switch will find any matches pattern to the entire item names (file and path) in the input file. If the -d switch takes place, matches pattern affect only to all items under the base path specified in -d switch. Let's have a look for few usage examples of -f switch as follows: sxc base.scs -f unit/hookup/* This will list all items under "unit/hookup/" path. The usage actually has similar result when using the -d switch like this: sxc base.scs -d unit/hookup/ The difference is the -d switch is much faster than the -f switch. Consider this when working with input file containing lots of items. Let's have a look another example. This will try to find any file and path containing word "adviser" and display matching results as the list of files. sxc base.scs -f *adviser* This will extract any files containing "adviser" under path "ui/" and store the extracted files into "C:\Temp" folder. Actually this is will extract all Route Advisor layout definition files. sxc base.scs -f *adviser* -d ui -o C:\Temp ### Advanced Filtering SXC Extractor support multiple set of filtering criteria. This is allow you to perform multiple filtering in a single pass. Just create a pure text file containing several filtering criteria, where each line represent one set of both base path and wildcard filtering. This example defines three filtering criteria to filter only items related to Route Advisor: material/ui/adviser sound/ui/adviser/&&*adviser* ui/&&adviser* Each line may define either base path, wildcard filtering, or both. Base path and wildcard filtering are separated by two ampersand characters (&&). If you define only wildcard filtering, prepend ampersands separator before wildcard pattern like this: &&*adviser* To let them easy to read, you can put spaces or tabs between ampersands separator. The above example can be defined like this: material/ui/adviser sound/ui/adviser/ && *adviser* ui/ && adviser* Save these filtering definitions as a text file and put the text file name prepend with an '@' (at) character after the -d switch. For example: sxc base.scs -d @adviser_filter.txt -o C:\Temp If you save the multiple filtering definition file with a name containing spaces, don't forget to enclose it with double-quotes: sxc base.scs -d "@C:\My Filters\Adviser Definition.txt" -o C:\Temp Please note when you define advanced filtering this way, the -f switch will be ignored. Advanced filtering may be handy when you working with a mod that contains asset's complexity involving many files. For security reason, SXC Extractor will reject filtering definition file which is larger than 512 Kb in size, containing non-standard ASCII text. In short, it accept only pure 7-bit ASCII text file with size less than or equal 524,288 bytes. ### Output Suppression By default, SXC Extractor will be displaying all messages and errors. You can hide unnecessary messages by supplying the -q switch (lowercase letter 'Q'). To hide error messages as well, use -qe switch instead. Message suppression will be handy when launching SXC Extractor through a batch script, interfacing with third-party application, or redirecting output to other device. The following example will be saving all list of files in "base.scs" into a text file called "list_base.txt": sxc base.scs -qe > list_base.txt ### List Mode & Page Pausing When displaying files under List Mode, it will scroll to the last line. If working with lots of items, you can use -p switch to allow a pause message appears every 24 lines (default). For example: sxc base.scs -p To allow pause message appears every n lines, use -p:n switch. This example will show pause message every 50 lines: sxc base.scs -p:50 It is accepting minimum 3 lines and maximum 99 lines. Please note the -p switch doesn't affect when working with message suppression through -q or -qe switch. ### List Mode Display SXC Extractor by default will list files under List Mode. This behavior is similar to when supplying the -l1 switch (lowercase letter 'L') into the argument. To list both files and path, you can use the -l0 switch. The -l2 switch is used to display only paths. This switch mainly intended in the purpose of interfacing with third-party application. Please note SXC Extractor does not provide ability to "extract" paths only. Extract operation always applies to files. ### Force Mode This function only applies to SCS game data/DLC file format. You must supply the -X switch (uppercase letter 'x') in order this mode to works. It will list or extract all files stored in input file into a single level folder hierarchy. This mode will be useful when working with game data/DLC files that has no root directory or their directory structures has been stripped off. Please note since there is no directory information, the path and file names are unknown. All files being listed or extracted will be named to their associated hash code followed by the .DAT extension. For example: sxc core.scs -o C:\Temp -X Please note when working with Force Mode, the -d (base path), -f (wildcard filter), and -l (list display) switches are ignored since they are no longer relevant under this mode. ### Quit Prompt Message When working with batch script or running through a shortcut, you may consider to put a confirmation message before SXC Extractor quit and closing console window. This can be done by putting the -c switch (lowercase letter 'C') into the argument. This let SXC Extractor showing a confirmation message asking to press a key before quit. You can specify a countdown delay with -c:n switch to allow application quit by itself after n seconds. For example, this will prompt user to press a key and quit automatically after 10 seconds: sxc -c:10 The countdown delays are ranged from 3 to 60 seconds. Please note the -c switch doesn't affect when working with message suppression through -q or -qe switch. # Extended Usage ### Mod File with "No Base Root" Starting with SXC Extractor version 1.19.10.4, it has additional functionalities to handle mod file giving "No Base Root" error message. There are additional steps when working with such kind of mod files, which will describe in details below. Before proceed, it is advisable that you have a little knowledge on binary file and hex editing. At any particular case, you may need to view binary file to recognize their type. For the start, you need to build a hash database file. In order to do that, it assumed you already accessing (with SXC Extractor) at least 5 default game data files which is consist of (in alphabetical order): base.scs core.scs def.scs effect.scs locale.scs Accessing these game data files for the first time will create an associate index file (*.idx) which is always stored at the same folder where you put/install SXC Extractor. These index files are required to build the hash database. To create these index file, by assuming you were install the Steam Client software in the C: drive with default install folder during installation, you can execute SXC Extractor by supplying each game data file with their fully qualified path this way: sxc "C:\Program Files (x86)\Steam\steamapps\common\Euro Truck Simulator 2\base.scs" sxc "C:\Program Files (x86)\Steam\steamapps\common\Euro Truck Simulator 2\core.scs" -137243 sxc "C:\Program Files (x86)\Steam\steamapps\common\Euro Truck Simulator 2\def.scs" sxc "C:\Program Files (x86)\Steam\steamapps\common\Euro Truck Simulator 2\effect.scs" sxc "C:\Program Files (x86)\Steam\steamapps\common\Euro Truck Simulator 2\locale.scs" -137243 If you are using SXC Extractor version 1.19.10.19 or later, there's no longer needed to supply the -137243 switch as shown above. Execute each line one by one from Windows console. Change the path if the above example differ than yours. After all lines executed without errors, you should see 5 associated index file at SXC Extractor folder: C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Base.idx C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Core.idx C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Def.idx C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Effect.idx C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Locale.idx Please note the name of index file always reflect to the folder location of the game data file. Yours may differ than they've shown in this example. If that the case, please change them accordingly to this instruction. These 5 index files are not mandatory. You may access other *.scs files to create their associate index file as much as you like. Once our index files are available, now to proceed with hash database creation procedure. To build hash database file, you have to create a text file containing the list of index file names. By assuming your SXC Extractor is located at C:\sxc folder, Open Windows Explorer program then expand My Computer or My PC and select sxc folder. From within the folder container panel, right-click to open context menu then select New and choose Text Document. In this example, give a name to this new text file as dblist.txt. Double-click (or use Open with through context menu) to open the newly text file with Windows Notepad (default) or any pure text editing software. Fill the content of the text file with the full qualified path of all index files, one line each. With SXC Extractor stored in C:\sxc folder, the content may look like this: C:\sxc\C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Core.idx C:\sxc\C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Locale.idx C:\sxc\C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Effect.idx C:\sxc\C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Def.idx C:\sxc\C-Program-Files-(x86)_Steam_Steamapps_Common_Euro-Truck-Simulator-2_Base.idx Their order are not important. The above list use number of items ordering from the least to the most to speed up the build time. Save the file and exit the text editing software. With this dblist.txt has been created at SXC Extractor folder, run this command from Windows console to start building hash database file: sxc -b C:\sxc\dblist.txt If done successfully, a hash database file named as sxc.hdb will be created and stored at the SXC Extractor folder. Once build, now it's time to try accessing the mod file. Let say you have a mod file called stuff.scs located at C:\mod folder, run this command to show the file list of it's content: sxc C:\mod\stuff.scs -137243 If you are using SXC Extractor version 1.19.10.19 or later, there's no longer needed to supply the -137243 switch as shown above. If the mod file previously have associated index file (in this example, C:\sxc\C-Mod_Stuff.idx), be sure to delete it first prior executing the command to allow generating a new index file. When the tool done displaying the list of items, look at the last line about total info and check if you see a part says "x items missing". If you don't see any, congratulations, all items on the mod file are completely revealed. ### Working with Missing Items The "x items missing" part indicates remaining number of items that not yet recovered due of their missing file name. Missing file names may be occurs if they are already hardcoded in the game thus no need to redeclared, i.e. manifest.sii. Another possible cause is the file name was already defined from within another file, i.e. description.txt that declared in manifest.sii. If you facing this problem and want to try recovering most or all of those missing item's file names, you can try these two approaches. The first approach is by looking to the item's file content to examine it's type. As mentioned earlier, your knowledge to binary and hex editing will taking part here. You can start by extracting all the file of missing items by using the -x switch (lowercase letter 'X'). Based on previous example, assuming you already have a folder in C:\mod\extract for extracted mod files, run the following command: sxc C:\mod\stuff.scs -x -o C:\mod\extract All missing item's files will be extracted to C:\mod\extract with their own hash number as file name followed by .DAT extension. You need to examine these files one by one through hex editing to determine their types. If the file started with SiiNunit then it's definitely a .sii definition file. If started with material then it's definitely a .mat material file. If started with DDS then it's definitely a .dds texture file. If started with OggS then it's definitely a .ogg sound file. If the the first couple bytes has JFIF or Exif then it's definitely a .jpg image file. Et cetera. If a file can be identified, rename the .DAT extention to the appropriate type. Starting from SXC Extractor version 1.19.11.16, you can supply the -af switch to allow the tool to identidy known files for you. Read further under the "File Type Scanning" section below on how to work with this switch. Several files can be easily identified. For example, once you can identify a .sii file and it is definitely manifest.sii file since it is containing mod_package text, you can open it up with text editing software and find out the actual name of icon and description files. Other case may not that simple, so you need to try the second approach. The second approach is by extracting all possible known files (e.g. *.sii or *.mat) that may contains file name referring to missing items. For example, the .sii file may contains include file (usually referring as *.sui) or it's members with declaration referred to MAT, PMD, PMA, etc. The .mat material file also refer to .tobj file name that may not yet recovered. This approach may time consuming and need efforts. But if the results are fairly significant, then it's better than nothing. Collect those suspected file names and put them all into a text file, one name per line. For example, if you able to identify manifest.sii along with the related files mod_icon.jpg and mod_desc.txt, also additional file name called /def/vehicle/physics.mymod.sii and /ui/template/mytext.sii, put them together to a text file like this: manifest.sii mod_icon.jpg mod_desc.txt /def/vehicle/physics.mymod.sii /ui/template/mytext.sii Save the text file, e.g. namelist_stuff.txt into the SXC Extractor folder and execute this command: sxc C:\mod\stuff.scs -bl C:\sxc\namelist_stuff.txt The -bl switch will try to resolve the missing items by looking at the name list. If one or more names in the list are correct, the number of missing items should decreased or (when all items resolved) no longer displayed at all. Names that correctly resolved will be displayed at the end of listed items on screen. You may supply -bl switch multiple times to resolve the missing items, just make sure to edit and update the list in text file. ### Name Resolver List, The -bl Switch Usage Name resolver list is a collection of possible "missing" paths and file names where SXC Extractor unable to resolve during index generation. The list are defined and stored in a single pure text file, defined one entry per line. The older version of SXC Extractor only support file names (not paths) to be defined in the name resolver list. The fully support for paths was started since SXC Extractor version 1.19.10.27. File name entries may be defined with or without leading path delimiter, for example: /def/traffic_data.mod.sii \material\prefab\mud_road.dds model/sign/traffic/mod/no_smoking.tobj sound\environment\spooky_ambient.ogg Path name entries may be defined with or without leading path delimiter BUT must supply the trailing path delimiter, for example: /def/mod/ \material\prefab\mod\ model/sign/traffic/mod/ sound\environment\mod\ Although the name resolver list is commonly used to find missing items with the -bl switch, you can add the "known working" list to hash database (sxc.hdb). This way, no need to supply the list to resolve missing items when frequently working with certain *.scs files. For example, to add name resolver list stored in list.txt into hash database, the command is: sxc sxc.hdb -bl list.txt ### File Size Filtering Starting from SXC Extractor version 1.19.11.16, you can filter entries based on uncompressed file size range. The two new -fmin and -fmax switches are introduced for the purpose. Please note these switches only working with extract mode on normal operation, but fully working on raw operation through -x and -X switches. These switches need a second argument as number of specified size. The following examples will filter only files with size at least 12,345 bytes, up to 123,456 bytes, and between 12,345 and 123,456 bytes, respectively: sxc def.scs -o C:\temp -fmin 12345 sxc def.scs -o C:\temp -fmax 123456 sxc def.scs -o C:\temp -fmin 12345 -fmax 123456 sxc base.scs -x -fmin 12345 sxc base.scs -x -fmax 123456 sxc base.scs -x -fmin 12345 -fmax 123456 Instead of using number in bytes, you can also supply number in kilobytes and megabytes. Put an appropriate suffix after the number, which is is k or kb for kilobytes and m or mb for megabytes. See the following examples: sxc def.scs -o C:\temp -fmin 10kb sxc def.scs -o C:\temp -fmax 10m sxc def.scs -o C:\temp -fmin 10k -fmax 10mb ### File Type Scanning File type scanning introduced in SXC Extractor version 1.19.11.16, with the main goal to detect file type of missing items and eliminate improper files indicated as "fake entry". File type scanning work only with *.scs files formatted as HashFS (native game data format). File type scanning work only with *.scs file which has no digital signature. Mod files those build with HashFS format are usually not digitally signed. Because official game data files are mostly digitally signed, file type scanning will not work with them. File type scanning work during index generation, or index update through the -bl switch. To activate this feature, you can use -af switch. For examples: sxc somemods.scs -af sxc somemods.scs -bl list.txt -af The first example show operation during index generation, where the *.idx file that associated with input file is not available yet (if it does, delete the appropriate *.idx file). The second example show operation during index update with name resolver list supplied through -bl switch. The -af switch useful only if you encounter missing items. When you perform list operation of missing items with -x switch, each entry now will have their known file type associated with their file extension. Take a look at this example: sxc somemods.scs -x A1B2C2D4E5F678.sii 12.3 kb (comp: 50%, 6.1 kb) 13579BDF02468A.ogg 678.9 kb 12345678ABCDEF.dds 66.6 kb (comp: 97%, 60.2 kb) ABCDEF12345678.tobj 2.5 kb (comp: 95%, 2.2 kb) 123ACB456DEF90.DAT 4.2 Mb As you can see, instead of showing entries with all .DAT extension as usual, now by using -af switch each entry may have their associate file type in their file extension. However the scanner still can't detect 100% of file types so some entry may still have their .DAT extension in their name. ### Epilogue SXC Extractor has no relation to the original SCS Extractor and is not affiliated with SCS Software. SXC Extractor made by user for users. It offers similar functionality as the predecessor with additional features and improvements. Since it is useful and proven handy for me (the author), hope it is also useful and handy for you especially the modders. Have fun, keep trucking, and happy modding! ---ooOoo---