项目作者: roccomuso

项目描述 :
Node.js cross-platform wrapper for UPX - the ultimate packer for eXecutables.
高级语言: JavaScript
项目地址: git://github.com/roccomuso/upx.git
创建时间: 2017-08-01T17:59:55Z
项目社区:https://github.com/roccomuso/upx

开源协议:

下载


upx

NPM Version
Dependency Status
JavaScript Style Guide

Node cross-platform wrapper for UPX

Install

  1. $ npm install --save upx

Usage

  1. const UPX = require('upx')(opts) // see options below
  2. UPX('Hello.exe')
  3. .output('Compressed.exe')
  4. .start().then(function(stats){
  5. /* stats:
  6. { cmd: 'compress',
  7. name: 'Compressed.exe',
  8. fileSize: { before: '1859072', after: '408064' },
  9. ratio: '21.95%',
  10. format: 'win32/pe',
  11. affected: 1 }
  12. */
  13. }).catch(function (err) {
  14. // ...
  15. })

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)

Debug

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

Author

Rocco Musolino (@roccomuso)

License

MIT