Coder Social home page Coder Social logo

upx's Introduction

upx

NPM Version Dependency Status JavaScript Style Guide

Node cross-platform wrapper for UPX

Install

$ npm install --save upx

Usage

const UPX = require('upx')(opts) // see options below

UPX('Hello.exe')
.output('Compressed.exe')
.start().then(function(stats){
  /* stats:
  { cmd: 'compress',
    name: 'Compressed.exe',
    fileSize: { before: '1859072', after: '408064' },
    ratio: '21.95%',
    format: 'win32/pe',
    affected: 1 }
  */
}).catch(function (err) {
  // ...
})

Methods

upx(<path>) : path is the absolute path to the file to compress/decompress.

.output(<output>) : path to the output file.

.start() : Start the compress/decompress process.

Options

The options below can be true or false.

Option Description
faster compress faster
better compress better
best compress best (can be slow for big files)
decompress decompress
list list compressed files
force force compression of suspicious files
brute try all available compression methods & filters (slow)
ultraBrute try even more compression variants (very slow)
overlayCopy copy any extra data attached to the file (default)
overlayStrip strip any extra data attached to the file (dangerous)
overlaySkip don't compress a file with an overlay
8086 make compressed sys work on any 8086 (for dos)
noReloc put no relocations in to the exe header (for dos)
8bit uses 8 bit size compression (default: 32 bit)
8mibRam 8 megabyte memory limit (default 2MiB)
noCompressIcons Disable icon compression

Debug

set the env DEBUG: DEBUG=upx node myScript.js

Author

Rocco Musolino (@roccomuso)

License

MIT

upx's People

Contributors

roccomuso avatar sbeyemhp avatar hypfer avatar

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.