All notable changes to this project will be documented in this file. This project does its best to adhere to Semantic Versioning.
0.6.0 - 2022-10-22
Add loop and if-statements detection to decompilation, also handle basic try-catch and synchronized blocks.
StringBuilderIndent
provides the same API asStringBuilder
(unfortunately we can't extend StringBuilder because it is final) and implementsIndent
so that this class can be used to easily build source code stringssrc/twg2/jbcm/toSource/structures
with state handlers for inserting more complex structures such as loops and try-catch statements into source code during opcode iteration
twg2.jbcm.classFormat.attributes.Code
toClassString()
renamedtoClassCodeString()
CpIndexChanger
is now stateful and contains the old and new index and uses a proper visitor pattern to handle changing indexesIndent
changed from a class to an interface with a public staticImpl
subclassIterateCode
renamedCodeIterator
RuntimeReloadMain
refactored, more complex threaded loading and invocation of methods from updated class files, some code moved to new classestwg2.jbcm.runtime.ClassLoaders
andFileUtility
twg2.jbcm.runtimeLoading
package renamedtwg2.jbcm.runtime
CodeFlow
contains algorithms for detecting loops and if-statements in byte codeDataCountingInputStream
added and used inClassFile
when parsing a class to improve debug and error message with exact byte index locations- Several new unit/integration tests added,
CompileTest
renamedCompileJava
- Fixed compiling code during runtime to support class names with arbitrary package paths, required extensive changes to
CompileSource
JumpConditionInfo
rewritten to support representing loop and nested if-statement conditionsTypeUtility.classNameFieldDescriptor()
renamedtoBinaryClassName()
0.5.1 - 2020-12-05
Fix switch
statements to decompile much more accurately based on code flow analysis. Start work on if
statements.
- new
Indent
class to handleSourceWriter
indentation Switch
to handle switch code flow initialization and info
- Add code flow analysis initialization and info to
JumpConditionInfo
- Assume that a forward goto right before a condition is an
else
statement
0.5.0 - 2020-12-05
Decompilation to source code in-progress and first round trip compile/decompile unit tests
- A new
twg2.jbcm.ir
package with helper classes for tracking state and data related to decompilation CodeOffsetGetter
interface implemented byChangeCpIndex
CodeFlow
for helping analyze potential code flow paths through a method- Unit tests with tests which perform compilation of source code and check decompilation back to intermediate view
CodeToSource
is in-progress, simple code can be converted, loops, switch statements, and interface/dynamic method calls are still TODO- Split
IoUtility
into newCodeUtility
class and moved static no-opCpIndexChanger
andCodeOffsetChanger
into their respective interfaces - Renamed
ByteCodeConsumer
->BytcodeConsumer
- Moved
MethodStack
to newtwg2.jbcm.ir
package - Lots of new functionality in
Opcodes
to support to source decompilation - Extensive
CompileSource
changes/improvements to support simple use cases like compiling in-memory (although a physical temp file still gets written under the hood) - Moved
LookupswitchOffsetModifier
andTableswitchOffsetModifier
out ofIoUtility
and into their own classes
CpIndexChanger.shiftIndex()
interface method since it was unused andCodeOffsetChanger
is equivalent- Unused classes:
Offset
,OffsetOpcode
,Opcode
,OpcodeObject
0.4.0 - 2020-06-29
ClassFileToSource
andCodeToSource
work-in-progress to convert class file back into Java source codeCONSTANT_CP_Info.toShortString()
added interface method and to implementations
- Clean up
Settings
mega-utility class. Move methods intoConstantPoolExtensions
,ClassFile
, andClassFileAttributes
- Cleaned up
Opcodes
- Unused
ConstantPoolIndexArray
andConstantPoolTag
annotations
0.3.0 - 2017-12-22
- Upgrade to Java 9
- Java 9 ClassFile format support:
- New Attributes:
Module
,ModuleMainClass
,ModulePackages
- New constant pool types:
CONSTANT_Module
,CONSTANT_Package
- New Attributes:
- Renamed/changed the
public static final int CONSTANT_*_info
field topublic static final byte TAG
and removed the instancedtag
field from all constantPool classes - Renamed
Target_Info_Type
->Target_Info_Union
- Consolidated
twg2.jbcm.classFormat.attributes
, nested classes that are only used by one class inside the class - Added/fixed several attributes'
toString()
methods - Cleaned up some attributes field documentation
- Renamed
UnitTest
->UsageCliMain
and added support for printing dependencies and loading multiple classes, printing multiple classes, and clearing loaded classes
0.2.1 - 2017-08-14
- Forgot to update jar file
0.2.0 - 2017-08-14
- Cleaned up unnecessary twg2.jbcm.opcode package classes
- Renamed twg2.jbcm.modify.IndexChange -> IndexChanger
- Renamed twg2.jbcm.modify.OpcodeChangeCpIndex -> CpIndexChanger
- Renamed twg2.jbcm.modify.OpcodeChangeOffset -> CodeOffsetChanger
0.1.0 - 2017-01-11
- Initial versioning of existing code, including classfile loading/parsing, dynamic classfile modification, and runtime class loading.