Skip to content

rbrick/java-disassemble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-disassembler

disassemble Java classes with ease

Under Construction

A simple Java class and bytecode reader written in Go.

package main

import (
	"fmt"

	disassemble "github.com/rbrick/java-disassemble"
)

func main() {
	reader := disassemble.NewClassReader("TestClass.class")

	class, err := reader.ReadClass()

	if err != nil {
		panic(err)
	}

	fmt.Println("Is Java?:", class.Magic == disassemble.MagicNumber)
	fmt.Printf("major version: %d, minor version: %d\n", class.MajorVer, class.MinorVer)
	fmt.Println("Is at least Java8?:", class.MajorVer >= disassemble.JavaSE8)
	fmt.Println("Class Pool Size:", class.ConstantPoolSize)
}