baraklevy20/Supercell-Extractor

Getting error 'Error: ENOENT: no such file or directory, stat 'out' when running this tool.

Red1860 opened this issue ยท 20 comments

Hi, I am getting the following error when I try to use this.

(node:72102) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use node --trace-deprecation ... to show where the warning was created)
node:fs:1536
handleErrorFromBinding(ctx);
^

Error: ENOENT: no such file or directory, stat 'out'
at Object.statSync (node:fs:1536:3)
at _node_internal (node:internal/fs/utils:793:8)
at Object.rmdirSync (node:fs:1156:15)
at main (/Users/admin/Supercell-Viewer/index.js:27:6)
at Object. (/Users/admin/Supercell-Viewer/index.js:51:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
errno: -2,
syscall: 'stat',
code: 'ENOENT',
path: 'out'
}

Hi! I can't upload a fix right now (busy schedule) but just create an empty directory called 'out' and it should work.

Hi! I can't upload a fix right now (busy schedule) but just create an empty directory called 'out' and it should work.

Thanks this worked!

But I have another problem. It doesn't work for some files that I try. For eg, scenery_clashy_constructs_dl_opt.sc.
I get this error when trying to decrypt it.

node index.js --file scenery_clashy_constructs_dl_opt.sc
(node:84497) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use node --trace-deprecation ... to show where the warning was created)
[LZMA_FORMAT_ERROR: File format not recognized] {
code: 7,
desc: 'File format not recognized'
}
extract all time - 332ms

Can you share the game and version you're trying to extract?

I am trying Clash of Clans. Latest version, ie 14.211.9

Thanks! It seems like it uses a compressor the extractor doesn't support yet. I'll add an implementation in the next couple of days.

@Red1860 Hi, this should now be supported. Unfortunately, the new decompression library takes up a lot of memory so running an entire folder will make the extractor crash, so for now please only extract individual files, and I'll work on a fix soon, thanks.

@baraklevy20 Hi, I tried the updated version but it still doesn't seem to be working. I get this error when decrypting that file.

(node:12234) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: Unsupported compression algorithm: LZHAM
    at SmartBuffer.scDecompress (/Users/admin/Supercell-Viewer/src/sc/scBuffer.js:43:11)
    at getScBuffer (/Users/admin/Supercell-Viewer/src/sc/scFormat.js:19:43)
    at readScFile (/Users/admin/Supercell-Viewer/src/sc/scFormat.js:203:64)
    at /Users/admin/Supercell-Viewer/index.js:32:19
    at Array.forEach (<anonymous>)
    at main (/Users/admin/Supercell-Viewer/index.js:29:18)
    at Object.<anonymous> (/Users/admin/Supercell-Viewer/index.js:51:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
extract all time - 140ms

What file are you trying to extract? I can't find scenery_clashy_constructs_dl_opt.sc in the latest version.

It should be in the res folder where all the sc files are located. I can link the file here also.

scenery_clashy_constructs_dl_opt.sc.zip

Ah, this seems like an iOS only file as I couldn't find it in the latest APK version.
I've added support for the new compression, so the file should work now.

Thanks this works! Now one more thing, there is one more file that doesn't work with this.

I get this error when trying to extract this file

Error: Invalid compression algorithm. First 9 bytes: SCP!
    at SmartBuffer.scDecompress (/Users/admin/Supercell-Viewer/src/sc/scBuffer.js:52:9)
    at getScBuffer (/Users/admin/Supercell-Viewer/src/sc/scFormat.js:19:43)
    at readScFile (/Users/admin/Supercell-Viewer/src/sc/scFormat.js:203:64)
    at /Users/admin/Supercell-Viewer/index.js:37:19
    at Array.forEach (<anonymous>)
    at main (/Users/admin/Supercell-Viewer/index.js:34:18)
extract all time - 11ms

c86ed78b-5ad6-4fe1-9974-f9c0d1c77fab.sc.zip

Eh, interesting, I've never seen this compression before. Which game is it from and what version?

This is Clash of Clans again latest version.
This file is downloaded additionally directly from supercell's servers when downloading the game initially from the App Store.

From my understanding, they added this new SCP format into their files so that users won't be able to access them.

Uh still very odd, I still can't find any files with that compression. Do you mean the game downloads it from the server when you run the app, but it's not being included in the IPA when you download it?

Edit:
Nevermind, I found some files that use SCP compression. I'll take a look into it.

@Red1860 It seems like SCP (or osm) files are actually archive files that contain multiple files. Once unpacked, you can see the regular SC files and use this extractor to extract them. As it doesn't feel like the purpose of this app, I'm not sure if I'm going to support it at the moment.
For now, you can use this repo - https://github.com/Fred31-pavel-sokov/SCP to extract the files into sc files and then use this extractor normally.

For now, you can use this repo - https://github.com/Fred31-pavel-sokov/SCP to extract the files into sc files and then use this extractor normally.

Unfortunately its not working for me. I am getting some errors with it. Know any other tools similar to this. Btw I have opened an issues on it.

For now, you can use this repo - https://github.com/Fred31-pavel-sokov/SCP to extract the files into sc files and then use this extractor normally.

Unfortunately its not working for me. I am getting some errors with it. Know any other tools similar to this. Btw I have opened an issues on it.

Unfortunately not. I can write a tool to unpack these files but I'm a bit busy in the coming days, so it might take a while.

No worries take your time.

@Red1860 Had some time to kill - https://github.com/baraklevy20/SCP-Unpacker

If there are any issues please write them on the other repository, not this one. Thanks :)

Thanks! I will close this issue now. I'm getting some errors in the other one so will post it there.