Giter Club home page Giter Club logo

libautoit's Introduction

libautoit

libautoit is a library for extracting and cleaning AutoItv3+ encoded scripts.

  • It supports a3x, exe, and even upx packed files.
  • Cross Platform
  • Has a builtin script beautifier
  • Doesn't execute the target executable like Exe2Aut

Installation

Assuming you have set up your Go environment according to the docs, just:

go get -u github.com/x0r19x91/libautoit

To start writing code:

func TestGetScripts(t *testing.T) {
    file := `C:\Users\x0r19x91\Desktop\libautoit\tests\Build.exe`
    data, err := ioutil.ReadFile(file)
    if err != nil {
        t.Error(err)
    }
    res, err := libautoit.GetScripts(data)
    if err != nil || len(res.Resources) == 0 {
        t.Error(err)
    }
    os.Mkdir("dump", 0666)
    for _, r := range res.Resources {
        t.Log(r)
        if !r.Decompress() {
            t.Errorf("Decompessor Failed.")
        }
        if r.IsAutoItScript(500) {
            r.Data = bytes.ReplaceAll(r.Data, []byte{13, 10}, []byte{10})
            lex := r.CreateTokenizer()
            tidyInfo := tidy.NewTidyInfo(lex)
            tidyInfo.SetFuncComments(true)
            tidyInfo.SetIdentifierCase(tidy.AutoDetect)
            tidyInfo.SetIndentSpaces(4)
            tidyInfo.SetMaxStringLiteralSize(160)
            tidyInfo.SetUseExtraNewline(true)
            tidyInfo.SetUseTabs(false)
            cleaned := tidyInfo.Tidy()
            r.Data = []byte(cleaned)
            t.Log("Cleaned")
        }
        ioutil.WriteFile("dump/"+clean(r.Path), r.Data, 0666)
        t.Logf("Writing %d bytes to %s\n", len(r.Data), filepath.Base(r.Path))
    }
}

License

GNU GPLv3

libautoit's People

Watchers

 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.