Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/amaanq/sc-compression.go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/amaanq/sc-compression.go

  • v0.0.0-20220326210801-13b121db4dda
  • Source
  • Go
  • Socket score

Version published
Created
Source

A Go package to decompress Supercell game asset files

Installation

go get -u github.com/amaanq/sc-compression

Usage

Let's say you have a Supercell game file called "missions.csv" located in the project directory and you'd like to decompress it, here's how to do it:

package main

import (
    "ioutil"
    "os"

    "github.com/amaanq/sc-compression"
)

func main() {
    fd, err := os.Open("missions.csv")
	if err != nil {
		panic(err)
	}
	defer fd.Close()

    decompressor := ScCompression.NewDecompressor(fd)
    data, err := decompressor.Decompress()
    if err != nil {
        panic(err)
    }

    data_bytes, err := ioutil.ReadAll(data)
    fmt.Println(string(data_bytes))

    decompFile, err := os.Create("missions_decompressed.csv")
    if err != nil {
        panic(err)
    }
    defer decompFile.Close()
    decompFile.Write(data_bytes)
}

Want to Contribute?

Submit a pull request or reach out to me (check my profile)


TODO

- [x] Use readers instead of byte arrays to prevent out of memory panics

- [ ] Implement LZHAM for the SCLZ signature

- [ ] Add compressor capability



Special Credits to @jeanbmar as his tool in Javascript was most helpful in making this myself: sc-compression

FAQs

Package last updated on 26 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc