Giter Club home page Giter Club logo

scs-extract's Introduction

scs-extract

scs-extract is a CLI tool to list / extract files from SCS archives used in Euro Truck Simulator 2 / American Truck Simulator.

For some SCS, the root may be missing or intentionally prevent others to extract. When you use the official SCS extractor, you may encounter

[hashfs] xxx.scs: Mounted ok, 12345 entries
*** ERROR *** : Root directory not found, can not extract this archive

This utility will try the best to extract the rootless hashfs files.

Usage

scs-extract [options] <scs_file> [dest_folder]

# scs-extract ets2/accessory.scs .
# scs-extract --help

NAME:
scs-extract - Extract SCS file to a folder

USAGE:
scs-extract [-options] scs_file dest_path [args...]

VERSION:
1.0.0

DESCRIPTION:
Try the best to extract SCS file, especially useful for some odd SCS missing roots

COMMANDS:
help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
--dump, -d                      dump raw hashfs files
--aditional-hashfs-paths, -p    additional hashfs paths
--help, -h                      show help
--version, -v                   print the version

Other workaround

This utility should be able to extract most of the files in the headless SCS. But if anything missing, you can use ConverterPIX to convert the model (.pmg/.pmd), and it should give you some warnings to indicate which files are missing. Then you can add the file paths to -p which can help the utility to extract the missing files.

Here is an example

converter_pix.exe -m /vehicle/upgrade/xx_yyy -b d:/ets2/mode/base

 ******************************************
 **        Converter PMX to PIX          **
 **       Copyright (C) 2017 mwl4        **
 ******************************************

<warning> [material] /automat/31/31d0e65efaab21fa.mat: Unable to open material!
<warning> [material] /automat/31/31d0e65efaab21fa.mat: Unable to open material!
<warning> [material] /automat/31/31d0e65efaab21fa.mat: Unable to open material!
[model] gps_tmp: pim:yes pit:yes pis:no pic:no pip:no vertices:93 indices:84 materials:3

/vehicle/truck/upgrade/xx_yyy is the hashfs path pointing to /vehicle/truck/upgrade/xx_yyy.pmg and/or /vehicle/truck/upgrade/xx_yyy.pmd

From the warning, I know /automat/31/31d0e65efaab21fa.mat is missing. So I add it to the additional paths

scs-extract.exe -d -p /automat/31/31d0e65efaab21fa.mat odd.scs e:/dest

Once it is done, you can run converter_pix.exe again, it should succeed

scs-extract's People

Contributors

chaoyangnz avatar dependabot[bot] avatar

Watchers

 avatar  avatar

scs-extract's Issues

Is there something wrong with my usage?

E:\Games\ETS\locale
locale.scs(1.50)

I launch it using cmd.
E:\Games\ETS\locale>scs-extract E:\Games\ETS\locale\locale.scs E:\Games\ETS\locale
E:\Games\ETS\locale>scs-extract locale.scs E:\Games\ETS\locale

`E:\Games\ETS\locale>scs-extract E:\Games\ETS\locale\locale.scs E:\Games\ETS\locale
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x10aa959]

goroutine 1 [running]:
io.ReadAll({0x0, 0x0})
C:/Program Files/Go/src/io/io.go:701 +0xd9
github.com/chaoyangnz/scs-extract/scs.NewHashfs({0xc000010140, 0x1e})
E:/ets2/scs-extract-master/scs/hashfs.go:65 +0x307
main.newImpl({0xc000010140, 0x1e}, {0xc000012180, 0x13}, 0x0, {0x13e3870, 0x0, 0x0})
E:/ets2/scs-extract-master/main.go:59 +0xbc
main.main.func1(0x1?)
E:/ets2/scs-extract-master/main.go:48 +0x6a
github.com/urfave/cli.HandleAction({0x11bb960?, 0xc0000080d8?}, 0xc00016c000?)
C:/Users/chao.yang/go/pkg/mod/github.com/urfave/[email protected]/app.go:524 +0x50
github.com/urfave/cli.(*App).Run(0xc00016c000, {0xc000024080, 0x3, 0x4})
C:/Users/chao.yang/go/pkg/mod/github.com/urfave/[email protected]/app.go:286 +0x7db
main.main()
E:/ets2/scs-extract-master/main.go:52 +0x408

E:\Games\ETS\locale>`

`E:\Games\ETS\locale>scs-extract locale.scs E:\Games\ETS\locale
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x10aa959]

goroutine 1 [running]:
io.ReadAll({0x0, 0x0})
C:/Program Files/Go/src/io/io.go:701 +0xd9
github.com/chaoyangnz/scs-extract/scs.NewHashfs({0xc00000e100, 0xa})
E:/ets2/scs-extract-master/scs/hashfs.go:65 +0x307
main.newImpl({0xc00000e100, 0xa}, {0xc000012180, 0x13}, 0x0, {0x13e3870, 0x0, 0x0})
E:/ets2/scs-extract-master/main.go:59 +0xbc
main.main.func1(0x1?)
E:/ets2/scs-extract-master/main.go:48 +0x6a
github.com/urfave/cli.HandleAction({0x11bb960?, 0xc0000080d8?}, 0xc00016a000?)
C:/Users/chao.yang/go/pkg/mod/github.com/urfave/[email protected]/app.go:524 +0x50
github.com/urfave/cli.(*App).Run(0xc00016a000, {0xc000024080, 0x3, 0x4})
C:/Users/chao.yang/go/pkg/mod/github.com/urfave/[email protected]/app.go:286 +0x7db
main.main()
E:/ets2/scs-extract-master/main.go:52 +0x408

E:\Games\ETS\locale>`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.