I created a small program with a button and a Msgbox "Hai" in Jabaco,
Ok, I have now doing the same:
|
Jabaco Source
|
1
2
3
|
Public Sub Command1_Click()
MsgBox "Hai"
End Sub
|
created a jar file from the same (using File->Make Project) and then decompiled the jar using jd-gui. But I couldn't locate "Hai" anywhere, eventhough I could find a Form1.class and a Command1_Click() among the decompiled files. Where should I look for it?
You are already there. If you decompile it with JD-GUI, then this is the output:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
import VB.Form;
public class Form1
extends Form
{
private Form1.CommandButton Command1;
/* Error */
public void Command1_Click()
{
// Byte code:
// 0: aconst_null
// 1: astore_1
// 2: ldc 221
// 4: invokestatic 227 VBA/Interaction:MsgBox (Ljava/lang/String;)LVBA/VBMsgBoxResult;
// 7: pop
// 8: nop
// 9: return
// 10: nop
// 11: aload_1
// 12: checkcast 229 java/lang/Throwable
// 15: invokestatic 232 VBA/Interaction:MsgBox (Ljava/lang/Throwable;)V
// 18: goto -10 -> 8
// 21: astore_2
// 22: astore_1
// 23: ret 2
// 25: jsr -4 -> 21
// 28: goto -18 -> 10
// Line number table:
// Java source line #3 -> byte code offset #0
// Java source line #4 -> byte code offset #2
// Java source line #5 -> byte code offset #8
// Local variable table:
// start length slot name signature
// 0 31 0 Me Form1
// 0 12 1 Err java.lang.Throwable
// 21 1 2 localObject java.lang.Object
// Exception table:
// from to target type
// 2 8 25 finally
}
private void initVars() {}
}
|
The error says, that JD-GUI can't decompile it, so it disassembles the part. To find your string, you can use javap of the JavaJDK. That gives out following, when you use it with the option "-c":
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
Compiled from "Form1.jsrc"
public class Form1 extends VB.Form {
public void Command1_Click();
Code:
0: aconst_null
1: astore_1
2: ldc #221 // String Hai
4: invokestatic #227 // Method VBA/Interaction.MsgBox:(Ljava/lang/String;)LVBA/VBMsgBoxResult;
7: pop
8: nop
9: return
10: nop
11: aload_1
12: checkcast #229 // class java/lang/Throwable
15: invokestatic #232 // Method VBA/Interaction.MsgBox:(Ljava/lang/Throwable;)V
18: goto 8
21: astore_2
22: astore_1
23: ret 2
25: jsr 21
28: goto 10
Exception table:
from to target type
2 8 25 any
public Form1();
Code:
0: aload_0
1: invokespecial #12 // Method VB/Form."<init>":()V
4: aload_0
5: invokevirtual #15 // Method initVars:()V
8: nop
9: return
}
|
This means, behind the address #221 is your string "Hai". And it is called with ldc.
But again: I sayd, you will have been better results, if you decompile the classes created in "Project" -> "Open Working Directory".
In this case, JD-GUI can decompile the program:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import VB.Form;
import VBA.Interaction;
public class Form1 extends Form
{
private Form1.CommandButton Command1;
public void Command1_Click()
{
Throwable Err = null;
Interaction.MsgBox("Hai");
}
private void initVars()
{
}
}
|
It is also not really correct, because the method "initVars()" isn't really empty. But it shows enough of the code.
To have a better overview, you have to use different decompilers:
Additional to JD-GUI for example
JAD: [
http://varaneckas.com/jad/ ]
FernFlower: [
http://forum.xda-developers.com/showthread.php?t=2029842 ]
etc.
Greatings
theuserbl