Krakatau | Java decompiler, assembler, and disassembler

 by   Storyyeller Rust Version: Current License: GPL-3.0

kandi X-RAY | Krakatau Summary

kandi X-RAY | Krakatau Summary

Krakatau is a Rust library typically used in Hardware applications. Krakatau has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has medium support. You can download it from GitHub.

Krakatau provides an assembler and disassembler for Java bytecode, which allows you to convert binary classfiles to a human readable text format, make changes, and convert it back to a classfile, even for obfuscated code. You can also create your own classfiles from scratch by writing bytecode manually, and can examine and compare low level details of Java binaries. Unlike javap, the Krakatau disassembler can handle even highly obfuscated code, and the disassembled output can be reassembled into a classfile. Krakatau's assembler syntax is mostly a superset of Jasmin syntax with some minor incompatibilities, but unlike Jasmin, Krakatau has full support for all Java 14 features and even supports some undocumented features found in old versions of the JVM. Krakatau also provides a decompiler for converting Java binaries to readable source code. Unlike other decompilers, the Krakatau decompiler was specifically designed for working with obfuscated code and can easily handle tricks that break other decompilers. However, the Krakatau decompiler does not support some Java 8+ features such as lambdas, so it works best on older code.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Krakatau has a medium active ecosystem.
              It has 1754 star(s) with 213 fork(s). There are 88 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 21 open issues and 149 have been closed. On average issues are closed in 482 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of Krakatau is current.

            kandi-Quality Quality

              Krakatau has no bugs reported.

            kandi-Security Security

              Krakatau has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              Krakatau is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              Krakatau releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed Krakatau and discovered the below as its top functions. This is intended to give you an instant insight into Krakatau implemented functionality, and help decide if they suit your requirements.
            • Create a SSA graph from the given code
            • Parse a method descriptor
            • Returns the root of the tree
            • Parse unbound MethodDescriptor
            • Parse a fmimref
            • Log an error
            • Format a list
            • Check that all of the expected types match
            • Reference target
            • Creates the Ternary of the given item
            • Parse target info
            • Prints the method definition
            • Handle constant data
            • Print this block
            • Parse an XML element
            • Start a new block
            • Assemble a NoCP packet
            • Update the node s successor state
            • Decompile a Java class
            • Return a dictionary of used local variables
            • Precompute the values for each instruction
            • Append an instruction
            • Handle the constant pool
            • Disassembles target files
            • Propagate constraints
            • Writes the contents of the module to disk
            Get all kandi verified functions for this library.

            Krakatau Key Features

            No Key Features are available at this moment for Krakatau.

            Krakatau Examples and Code Snippets

            Welcome to Krakatau,Value store
            C++dot img1Lines of Code : 26dot img1License : Permissive (Apache-2.0)
            copy iconCopy
            value compute block slots $a,$b,$c {
              loadslot $a
              loadslot $b
              add
              loadslot $c
              mul
            }
            
            value main block {
              push number 5
              dup
              push number 4
              load compute
              exec
            }
            
            #include 
            #include 
            
            uint64_t compute(uint64_t a, uint64_t b, uint64_t c)   
            Welcome to Krakatau,How to get started
            C++dot img2Lines of Code : 12dot img2License : Permissive (Apache-2.0)
            copy iconCopy
            build$ cmake ..
            [...]
            -- Build files have been written to: /home/egranata/krakatau/build
            $ make -j
            [...]
            build$ ls
            assembler  CMakeCache.txt  cmake_install.cmake  googletest-download  lexer.cpp  libstuff.so  runner
            bin        CMakeFiles      googlete  

            Community Discussions

            QUESTION

            Automatically filling StackMapTable with Krakatau
            Asked 2017-Nov-12 at 15:49

            I'm using Krakatau to generate bytecodes from Jasmin syntax. My Jasmin code is created from a direct translation of a intermediate code in the form of Three Address Code(TAC). My problem is that I can't tell for sure, only looking at the TAC, where I should position my stack directives when translating jump statements.

            Krakatau documentation on its assembler says the following:

            The content of a StackMapTable attribute is automatically filled in based on the stack directives in the enclosing code attribute. If this attribute’s contents are nonempty and the attribute isn’t specified explicitly, one will be added implicitly.

            But it also says:

            Krakatau will not calculate a new stack map for you from bytecode that does not have any stack information. If you want to do this, you should try using ASM.

            I'm confused about which kind of directives, and where should I add them to my translation so the assembler knows how to add the attributes implicitly. Any help on this would be appreciated.

            For instance, I have this code written in a syntax similar to Java(but not the same, so I need to use another compiler for it):

            What I get from the front end of my compiler is the TAC on the left and my translator generate the Jasmin code on the right(I'm removing the headers and footers and only leaving the bytecode itself, missing the return instruction):

            When I try to run it, I get something like:

            ...

            ANSWER

            Answered 2017-Nov-12 at 15:49

            The easiest approach is to avoid the need for stack maps entirely. Stack maps are only required if you want to use version 51.0+ features (i.e. invokedynamic). If you aren't using invokedynamic, you can just set the classfile version to 50 or lower, and you don't need a stack map at all. In fact, Krakatau defaults the version to 49.0 if you don't explicitly specify one, so you don't need to do anything there.

            If you are using invokedynamic, things get much tricker, because you have to generate stack maps. The basic rule is that you need a stack map entry whenever an instruction is reachable from anywhere other than the preceding instruction. (I think you also need entries for dead code, but I haven't checked).

            As for actually generating the entries, there are several different types of stack frames, but you don't have to worry about that. The easiest approach is to just use a full frame every time. This involves listing out the current type for every live value in the local variable ("register") slots and on the operand stack, so you'll have to track those.

            Yes, it is a pain to calculate and generate all that type information, but you'll have to blame Oracle for that, not me. Alternatively, you could try to use ASM to generate the stack maps for you, as suggested in the documentation.

            Source https://stackoverflow.com/questions/47245539

            QUESTION

            Error reassembling Java bytecode into .class file using Krakatau
            Asked 2017-Nov-11 at 07:35

            I'm trying to use Krakatau to assemble a native Java bytecode, acquired with javap -c, but I'm getting a weird error:

            ...

            ANSWER

            Answered 2017-Nov-11 at 07:35

            Nothing in the Krakatau documentation says that it is designed to convert the output of javap -c.

            If you want to use Krakatau to convert bytecode files, you should use Krakatau for the disassembly step not javap -c.

            The Krakatua README.txt file explains how to do that.

            Source https://stackoverflow.com/questions/47234101

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Krakatau

            Krakatau is pure python, so assuming you have Python already installed, all you need to do is checkout this repository.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/Storyyeller/Krakatau.git

          • CLI

            gh repo clone Storyyeller/Krakatau

          • sshUrl

            git@github.com:Storyyeller/Krakatau.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Rust Libraries

            996.ICU

            by 996icu

            deno

            by denoland

            rust

            by rust-lang

            alacritty

            by alacritty

            tauri

            by tauri-apps

            Try Top Libraries by Storyyeller

            cubiml-demo

            by StoryyellerRust

            easy_strings

            by StoryyellerRust

            stable_deref_trait

            by StoryyellerRust

            jrt-extractor

            by StoryyellerJava

            cryptominisat-rs

            by StoryyellerRust