Chamomile is a Java Virtual Machine class file assembler and disassembler.

Overview

project logo


Chamomile is a Java Virtual Machine class file assembler and disassembler.


Installation

Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.wdestroier</groupId>
        <artifactId>chamomile</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

Gradle

repositories {
  maven("https://jitpack.io")
}

dependencies {
  implementation("com.github.wdestroier:chamomile:1.0.0")
}

Demonstration

Assemble a list of instructions

var assembler = new SinglePassAssembler();

var bytecode = assembler.assemble(List.of(
		new Iconst1Instruction(),
		new I2lInstruction(),
		new AconstNullInstruction(),
		new PopInstruction(),
		new Fconst2Instruction(),
		new F2lInstruction(),
		new LaddInstruction(),
		new InvokestaticInstruction(InstructionFactory.instance.getOpcode(
	InvokestaticInstruction.class), 12)
		));

System.out.println(Arrays.toString(bytecode));

Output

[4, 133, 1, 87, 13, 140, 97, 184, 0, 12]

Disassemble an array of "unsigned bytes"

var disassembler = new LinearSweepDisassembler();

var bytecode = new short[] { 4, 133, 1, 87, 13, 140, 97, 184, 0, 12 };

var instructions = disassembler.disassemble(bytecode);

instructions.stream()
	.map(instruction -> InstructionFactory.instance.getMnemonic(instruction.getOpcode()))
	.forEach(System.out::println);

Output

iconst_1
i2l
aconst_null
pop
fconst_2
f2l
ladd
invokestatic

More examples can be found here

You might also like...

Build parsers in Java

jparsec Builds mini parsers in pure Java. Latest version: 3.0 (requires Java 8+) News 2016-12-05 Removed references to Codehaus in copyright and packa

Dec 31, 2022

Compiler of Java bytecode to JavaScript

TeaVM See documentation at the project web site. Useful links: Getting started Gallery Flavour source code repository Site source code repository Disc

Jan 3, 2023

Kodlama.io'da verilen ödev gereği Engin Demiroğ'un düzenlediği C# ile birlikte gerçek hayatta interface ve abstract konulu yayının Java uyarlaması yapılmıştır.

GercekHayattaInterfaceVeAbstract Kodlama.io'da verilen ödev gereği Engin Demiroğ'un düzenlediği C# ile birlikte gerçek hayatta interface ve abstract k

May 11, 2021

Assembler/disassembler for java bytecode

Raung raung - yet another assembler/disassembler for java bytecode. Similar to Krakatau and Smali, based on ASM library. ❗ Warning: this project at a

Oct 2, 2022

A Java Virtual Machine - running on a Java Virtual Machine - running on a (jk).

Javaception A Java Virtual Machine - running on a Java Virtual Machine - running on a (jk). Goals JVMS compliant Java Virtual Machine Somewhat fast Re

Oct 10, 2022

[INACTIVE] Avian is a lightweight virtual machine and class library designed to provide a useful subset of Java's features, suitable for building self-contained applications.

Avian - A lightweight Java Virtual Machine (JVM) PLEASE NOTE: This project is not currently being developed, maintained, or supported. Feel free to us

Dec 22, 2022

Classpy is a GUI tool for investigating Java class file, Lua binary chunk, Wasm binary code, and other binary file formats.

Classpy is a GUI tool for investigating Java class file, Lua binary chunk, Wasm binary code, and other binary file formats.

Classpy Classpy is a GUI tool for investigating Java class file, Lua binary chunk, Wasm binary code, and other binary file formats. Inspiration This t

Dec 17, 2022

BlackBox is a virtual engine, it can clone and run virtual application on Android

BlackBox is a virtual engine, it can clone and run virtual application on Android

BlackBox is a virtual engine, it can clone and run virtual application on Android, users don't have to install APK file to run the application on devices. BlackBox control all virtual applications, so you can do anything you want by using BlackBox.

Jan 3, 2023

JVM Explorer is a Java desktop application for browsing loaded class files inside locally running Java Virtual Machines.

JVM Explorer is a Java desktop application for browsing loaded class files inside locally running Java Virtual Machines.

JVM Explorer JVM Explorer is a Java desktop application for browsing loaded class files inside locally running Java Virtual Machines. Features Browse

Nov 30, 2022

Library for converting from one Java class to a dissimilar Java class with similar names based on the Bean convention

Library for converting from one Java class to a dissimilar Java class with similar names based on the Bean convention

Beanmapper Beanmapper is a Java library for mapping dissimilar Java classes with similar names. The use cases for Beanmapper are the following: mappin

Nov 15, 2022

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.

Welcome to the Eclipse OpenJ9 repository We're not sure which route you might have taken on your way here, but we're really pleased to see you! If you

Dec 31, 2022

A very bad and stupid Java MIPS disassembler

MIPSDisass A very bad and stupid Java MIPS disassembler. Note: this disassembler was (almost) entirely tested with the MARS assembler functionality, s

Apr 1, 2022

Reference implementation for MINAS (MultI-class learNing Algorithm for data Streams), an algorithm to address novelty detection in data streams multi-class problems.

Reference implementation for MINAS (MultI-class learNing Algorithm for data Streams), an algorithm to address novelty detection in data streams multi-class problems.

Sep 7, 2022

MIPS Assembler and Runtime Simulator

MIPS Assembler and Runtime Simulator

MIPS Assembler and Runtime Simulator MARS fork (?) cleaned up and gradleized so that I can hopefully build an .exe and install it properly. Also added

Sep 29, 2021

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput.

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.

Jan 3, 2023

Java virtual machine made in Java by HoverCatz#0060

Java virtual machine made in Java by HoverCatz#0060

Obzcure Virtual Machine Java virtual machine made in Java THIS IS NOT PRODUCTION SAFE - WORK IN PROGRESS! Use at your own risk. Requires Java 17 (with

Oct 18, 2022

Runtime code generation for the Java virtual machine.

Runtime code generation for the Java virtual machine.

Byte Buddy runtime code generation for the Java virtual machine Byte Buddy is a code generation and manipulation library for creating and modifying Ja

Dec 27, 2022
Releases(1.0.0)
  • 1.0.0(Jul 10, 2021)

Owner
null
Java 1-15 Parser and Abstract Syntax Tree for Java, including preview features to Java 13

JavaParser This project contains a set of libraries implementing a Java 1.0 - Java 14 Parser with advanced analysis functionalities. This includes pre

JavaParser 4.5k Jan 9, 2023
Java 8 annotation processor and framework for deriving algebraic data types constructors, pattern-matching, folds, optics and typeclasses.

Derive4J: Java 8 annotation processor for deriving algebraic data types constructors, pattern matching and more! tl;dr Show me how to write, say, the

null 543 Nov 23, 2022
Elegant parsing in Java and Scala - lightweight, easy-to-use, powerful.

Please see https://repo1.maven.org/maven2/org/parboiled/ for download access to the artifacts https://github.com/sirthias/parboiled/wiki for all docum

Mathias 1.2k Dec 21, 2022
A Java API for generating .java source files.

JavaPoet JavaPoet is a Java API for generating .java source files. Source file generation can be useful when doing things such as annotation processin

Square 10k Jan 5, 2023
Numerical-methods-using-java - Source Code for 'Numerical Methods Using Java' by Haksun Li

Apress Source Code This repository accompanies Numerical Methods Using Java by Haksun Li (Apress, 2022). Download the files as a zip using the green b

Apress 5 Nov 20, 2022
Testing tools for javac and annotation processors

Compile Testing A library for testing javac compilation with or without annotation processors. See the javadoc for usage examples. License Copyright 2

Google 639 Dec 14, 2022
An addon that is trying to recreate Tinker's Construct within Slimefun. Adds new customisable tools with leveling and modifiers.

SlimeTinker is a Slimefun4 addon that tries it's best to recreate the amazing Tinker's Construct Mod (link) in Vanilla Minecraft. Features include: Th

null 22 Nov 6, 2022
A collection of source code generators for Java.

Auto A collection of source code generators for Java. Auto‽ Java is full of code that is mechanical, repetitive, typically untested and sometimes the

Google 10k Jan 9, 2023
Catch common Java mistakes as compile-time errors

Error Prone Error Prone is a static analysis tool for Java that catches common programming mistakes at compile-time. public class ShortSet { public

Google 6.3k Dec 31, 2022
Write parsers for arbitrary text inputs, entirely in Java, with no preprocessing phase

Read me first The license of this project is Apache 2.0. Requires Java 7 or later. The latest versions are: development: 2.1.0-beta.3; requires Java 8

Francis Galiegue 62 Oct 13, 2022