The Artima Developer Community
Sponsored Link

Java Answers Forum
Nobody can solve it...

4 replies on 1 page. Most recent reply: May 11, 2010 1:05 PM by James Watson

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Jeffrie Joshua Lazarus George

Posts: 7
Nickname: jeffriejos
Registered: Jan, 2010

Nobody can solve it... Posted: May 3, 2010 12:17 AM
Reply to this message Reply
Advertisement
I have a .class file. i can never decompile it.I tried all the decompilers available in this earth. Can anyone help me?


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: Nobody can solve it... Posted: May 3, 2010 1:57 AM
Reply to this message Reply
> I have a .class file. i can never decompile it.I tried all
> the decompilers available in this earth.

Lmao... Have you really?

> Can anyone help
> me?

I use JAD:

jad.exe MyClass.class

Obviously it will yield errors for InnerClasses as they will be in a separate $1.class type file. But it will translate whatever byte code is in that particular .class file.

I haven't come across a .class file that it has failed on yet.

Jeffrie Joshua Lazarus George

Posts: 7
Nickname: jeffriejos
Registered: Jan, 2010

Re: Nobody can solve it... Posted: May 3, 2010 2:05 AM
Reply to this message Reply
I was not able to upload the class file. So im giving the byte code....if u need the class file...tell me a way to provide it.
Compiled from "b.java"
public class b extends java.lang.Object{
public static boolean i;

public b();
Code:
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>":()V
4: aload_0
5: sipush 256
8: newarray int
10: putfield #2; //Field c:[I
13: aload_0
14: sipush 256
17: newarray byte
19: putfield #3; //Field d:[B
22: aload_0
23: sipush 256
26: newarray int
28: putfield #4; //Field f:[I
31: return

public byte[] b(int, byte[]);
Code:
0: aload_0
1: iload_1
2: aload_2
3: invokespecial #9; //Method a:(I[B)[B
6: areturn

public int c(int, byte[]);
Code:
0: getstatic #37; //Field a.e:I
3: istore 4
5: iconst_0
6: istore_3
7: iload 4
9: ifeq 22
12: aload_0
13: getfield #2; //Field c:[I
16: iload_3
17: iload_3
18: iastore
19: iinc 3, 1
22: iload_3
23: sipush 256
26: if_icmplt 12
29: aload_0
30: aload_0
31: iconst_0
32: dup_x1
33: putfield #6; //Field b:I
36: putfield #7; //Field a:I
39: aload_0
40: aload_0
41: iconst_0
42: dup_x1
43: putfield #10; //Field h:I
46: putfield #11; //Field g:I
49: aload_0
50: iload 4
52: ifne 13
55: iload_1
56: iload 4
58: ifne 70
61: sipush 255
64: if_icmple 73
67: sipush 255
70: goto 74
73: iload_1
74: putfield #12; //Field e:I
77: iconst_0
78: istore_3
79: iload 4
81: ifeq 96
84: aload_0
85: getfield #3; //Field d:[B
88: iload_3
89: aload_2
90: iload_3
91: baload
92: bastore
93: iinc 3, 1
96: iload_3
97: aload_0
98: getfield #12; //Field e:I
101: if_icmplt 84
104: aload_0
105: getfield #3; //Field d:[B
108: aload_0
109: getfield #12; //Field e:I
112: iconst_0
113: bastore
114: iconst_0
115: istore_3
116: iload 4
118: ifeq 160
121: iload 4
123: ifne 93
126: goto 160
129: aload_0
130: iload_3
131: iconst_0
132: iadd
133: invokespecial #13; //Method a:(I)V
136: aload_0
137: iload_3
138: iconst_1
139: iadd
140: invokespecial #13; //Method a:(I)V
143: aload_0
144: iload_3
145: iconst_2
146: iadd
147: invokespecial #13; //Method a:(I)V
150: aload_0
151: iload_3
152: iconst_3
153: iadd
154: invokespecial #13; //Method a:(I)V
157: iinc 3, 4
160: iload_3
161: sipush 256
164: if_icmplt 129
167: iload 4
169: ifne 157
172: iconst_0
173: getstatic #40; //Field i:Z
176: ifeq 187
179: iinc 4, 1
182: iload 4
184: putstatic #37; //Field a.e:I
187: ireturn

public void b(int);
Code:
0: iinc 1, 1
3: return

}

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: Nobody can solve it... Posted: May 3, 2010 4:16 AM
Reply to this message Reply
> I was not able to upload the class file. So im giving the
> byte code....

This is not the byte code, this is the step in between (Java's Assembler). I don't think this is used anymore in any case - I could be wrong though.

I do need the .class file which has the byte code.

E-mail it to kondwani _At_ gmail.com

<obviously replace _At_ >

if u need the class file...tell me a way to
> provide it.
> Compiled from "b.java"
> public class b extends java.lang.Object{
> public static boolean i;
>
> public b();
> Code:
> 0: aload_0
> 1: invokespecial #1; //Method
> hod java/lang/Object."<init>":()V
> 4: aload_0
> 5: sipush 256
> 8: newarray int
> 10: putfield #2; //Field c:[I
> 13: aload_0
> 14: sipush 256
> 17: newarray byte
> 19: putfield #3; //Field d:[B
> 22: aload_0
> 23: sipush 256
> 26: newarray int
> 28: putfield #4; //Field f:[I
> 31: return
>
> public byte[] b(int, byte[]);
> Code:
> 0: aload_0
> 1: iload_1
> 2: aload_2
> 3: invokespecial #9; //Method a:(I[B)[B
> 6: areturn
>
> public int c(int, byte[]);
> Code:
> 0: getstatic #37; //Field a.e:I
> 3: istore 4
> 5: iconst_0
> 6: istore_3
> 7: iload 4
> 9: ifeq 22
> 12: aload_0
> 13: getfield #2; //Field c:[I
> 16: iload_3
> 17: iload_3
> 18: iastore
> 19: iinc 3, 1
> 22: iload_3
> 23: sipush 256
> 26: if_icmplt 12
> 29: aload_0
> 30: aload_0
> 31: iconst_0
> 32: dup_x1
> 33: putfield #6; //Field b:I
> 36: putfield #7; //Field a:I
> 39: aload_0
> 40: aload_0
> 41: iconst_0
> 42: dup_x1
> 43: putfield #10; //Field h:I
> 46: putfield #11; //Field g:I
> 49: aload_0
> 50: iload 4
> 52: ifne 13
> 55: iload_1
> 56: iload 4
> 58: ifne 70
> 61: sipush 255
> 64: if_icmple 73
> 67: sipush 255
> 70: goto 74
> 73: iload_1
> 74: putfield #12; //Field e:I
> 77: iconst_0
> 78: istore_3
> 79: iload 4
> 81: ifeq 96
> 84: aload_0
> 85: getfield #3; //Field d:[B
> 88: iload_3
> 89: aload_2
> 90: iload_3
> 91: baload
> 92: bastore
> 93: iinc 3, 1
> 96: iload_3
> 97: aload_0
> 98: getfield #12; //Field e:I
> 101: if_icmplt 84
> 104: aload_0
> 105: getfield #3; //Field d:[B
> 108: aload_0
> 109: getfield #12; //Field e:I
> 112: iconst_0
> 113: bastore
> 114: iconst_0
> 115: istore_3
> 116: iload 4
> 118: ifeq 160
> 121: iload 4
> 123: ifne 93
> 126: goto 160
> 129: aload_0
> 130: iload_3
> 131: iconst_0
> 132: iadd
> 133: invokespecial #13; //Method a:(I)V
> 136: aload_0
> 137: iload_3
> 138: iconst_1
> 139: iadd
> 140: invokespecial #13; //Method a:(I)V
> 143: aload_0
> 144: iload_3
> 145: iconst_2
> 146: iadd
> 147: invokespecial #13; //Method a:(I)V
> 150: aload_0
> 151: iload_3
> 152: iconst_3
> 153: iadd
> 154: invokespecial #13; //Method a:(I)V
> 157: iinc 3, 4
> 160: iload_3
> 161: sipush 256
> 164: if_icmplt 129
> 167: iload 4
> 169: ifne 157
> 172: iconst_0
> 173: getstatic #40; //Field i:Z
> 176: ifeq 187
> 179: iinc 4, 1
> 182: iload 4
> 184: putstatic #37; //Field a.e:I
> 187: ireturn
>
> public void b(int);
> Code:
> 0: iinc 1, 1
> 3: return
>
> }

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Nobody can solve it... Posted: May 11, 2010 1:05 PM
Reply to this message Reply
> > I was not able to upload the class file. So im giving
> the
> > byte code....
>
> This is not the byte code, this is the step in between
> (Java's Assembler). I don't think this is used anymore in
> any case - I could be wrong though.

That's the output of javap for the class file. You could build figure out the class file that it was generated from if you had the inclination.

Flat View: This topic has 4 replies on 1 page
Topic: Anonymous class Previous Topic   Next Topic Topic: Migration To Linux

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use