Thursday, December 10, 2009

Java Class unpacker v0.7.1 released

Java Class Unpacker v0.7.1 released.
Plugin for Total Commander

Changes:
  * fixed LDC_W opcode
  * fixed MULTIANEWARRAY opcode
  * fixed GOTO_W opcode
  * fixed NEWARRAY opcode
  - refactoring
  - implemented basic configuration
  - fixed char type in constant pool

Download: http://cid-511e6cc6d535b08d.skydrive.live.com/self.aspx/JavaClassUnpacker

Cheers,

Lula

Tuesday, December 1, 2009

Java Class Unpacker v0.7.0

Java Class Unpacker v0.7.0 released.
Plugin for Total Commander

Changes:
  - fixed NEW opcode
  - fixed error with classes containing many attribute types: SourceFile, ConstantValue, Exceptions, InnerClasses, Synthetic, LineNumberTable, LocalVariableTable, Deprecated,
  - fixed native methods
  + added header.txt in class unpack containing class header info
  - fixed locals and stack size in method unpack
  - fixed integer, long, float and double in constant pool

Download: http://cid-511e6cc6d535b08d.skydrive.live.com/self.aspx/JavaClassUnpacker

Cheers,

Lula

Friday, November 27, 2009

Java Class Unpacker v0.6.0

Java Class Unpacker v0.6.0 released.
Plugin for Total Commander

Changes:
 - fixed: abstract classes and methods
 - added constant pool
 - implemented decompilation of tableswitch and lookupswitch
 - file offsets and hexa bytes in code
 - renamed file to JavaClassUnpacker.wcx

Download: http://cid-511e6cc6d535b08d.skydrive.live.com/self.aspx/JavaClassUnpacker

Cheers,

Lula

Thursday, November 26, 2009

New Total Commander Plugin - Java Class Unpacker v0.5.0

I developed a new plugin for the amazing Total Commander. Using this plugin you can enter to class files as compressed files and see fields and methods as files.
Methods can be viewed using F3, the java bytecode is displayed as text.

I have no site so I uploaded to megaupload, you can download it from:

http://www.megaupload.com/?d=8BW30ZAD

Please feel free to send me bugs, comments or suggestions.

Enjoy!

Friday, November 13, 2009

J2ME: Fixing Cannot find class java/lang/NoClassDefFoundError at preverify

I had a strange error when preverifying a midlet.

     [exec] Error preverifying class temp.TestMidlet
     [exec]     VERIFIER ERROR temp/TestMidlet.()V:
     [exec] Cannot find class java/lang/NoClassDefFoundError


The midlet is ok, Eclipse doesn't display an error. Searching in all the library jars in WTK I found the class NoClassDefFoundError is inside cldcapi11.jar. I modified the cldc jar and nows compiles.

But is not enough for me, I'm not using float or doubles so I want to compile the midlet for CLDC10. So I continued playing and I found the reason: I'm using the field named "class" to obtain the name of a class.

E.g:

To obtain the Class object of class TestMidlet I'm using the following code:

Class clazz = TestMidlet.class;

this is ok for CLDC11 but for CLDC10 is wrong, I must use this.getClass or something similar.

I hope you can find this useful.

Cheers,

Lula

All mobile developer sites

Just for reference, I'm writing here all developer sites useful for mobile frikis:

Java Mobile
http://developers.sun.com/mobility

Sony
http://developer.sonyericsson.com

Motorola
http://developer.motorola.com

Nokia
http://www.nokia.com/developers

Samsung
http://innovator.samsungmobile.com

IPhone
http://developer.apple.com/iphone

Android
http://developer.android.com

Blackberry
http://na.blackberry.com/eng/developers

BREW
http://brew.qualcomm.com/brew/en/developer/overview.html

HTC
http://developer.htc.com

Windows Mobile
http://developer.windowsmobile.com
http://msdn.microsoft.com/en-us/windowsmobile/default.aspx

OpenGL ES
http://www.khronos.org/opengles

Let's go mobile!

Cheers,

Lula

Tuesday, November 10, 2009

Convert Android DEX to Java

I'm playing with a great Android to Java converter named UnDX. You can find it at

http://www.illegalaccess.org/undx

it uses BCEL to convert the files. It's in beta, has some errors.

So, I decided to create my own converter using ASM. The idea is simple:

- Create a DEX reader extending ClassReader. Here call all the Visitor events to generate the java code.
- Use ASM to manipulate the java bytecode.
- Create a DEX ClassWriter. It must be exactly the same for java, but after generating all the bytearrays it must use dx command to create de DEX file.

The idea is simple, I had some tests and it works! I'm generating the java code and I can manipulate it.

I'll tell you later what happens with some big DEX files.

Cheers,

Lula