[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1523
  • Last Modified:

Error compile in java

I have a file jar use build chart .I extract and then decompile from .class to .java.
Then i compile file java to file class but error .

private static String z(char ac[])
    {
        ac;
        ac.length;
        JVM INSTR swap ;
        int l = 0;
          goto _L1
_L3:
        JVM INSTR dup ;
        l;
        JVM INSTR dup2 ;
        JVM INSTR caload ;
        byte byte0;
        switch(l % 5)
        {
        case 0: // '\0'
            byte0 = 0x53;
            break;

        case 1: // '\001'
            byte0 = 66;
            break;

        case 2: // '\002'
            byte0 = 12;
            break;

        case 3: // '\003'
            byte0 = 86;
            break;

        default:
            byte0 = 7;
            break;
        }
        byte0;
        JVM INSTR ixor ;
        (char);
        JVM INSTR castore ;
        l++;
_L1:
        JVM INSTR swap ;
        JVM INSTR dup_x1 ;
        l;
        JVM INSTR icmpgt 9;
           goto _L2 _L3
_L2:
        JVM INSTR new #340 <Class String>;
        JVM INSTR dup_x1 ;
        JVM INSTR swap ;
        String();
        intern();
        return;
    }

Statement error:

ac;
ac.length;
JVM INSTR swap ;

goto _L1
_L3:
        JVM INSTR dup ;
        l;
        JVM INSTR dup2 ;
        JVM INSTR caload ;

byte0;
        JVM INSTR ixor ;
        (char);
        JVM INSTR castore ;
_L1:
        JVM INSTR swap ;
        JVM INSTR dup_x1 ;
        l;
        JVM INSTR icmpgt 9;
           goto _L2 _L3
_L2:
        JVM INSTR new #340 <Class String>;
        JVM INSTR dup_x1 ;
        JVM INSTR swap ;
        String();
        intern();

I don't know solution to compile .Can you help me ?
Thank you very much.
0
quangnv2005
Asked:
quangnv2005
1 Solution
 
zzynxSoftware engineerCommented:
>> Then i compile file java to file class but error
What error? Please post the errors
0
 
girionisCommented:
> I have a file jar use build chart .I extract and then decompile from
> .class to .java.

That's a weird format in there. I see isntructions that I do not understand. What decompiler did you use?
0
 
zzynxSoftware engineerCommented:
private static String z(char ac[])
    {
        ac;                                 // <<< variable "ac" doesn't have a type (int, String, char,...)
        ac.length;
        JVM INSTR swap ;           // <<<<< that's no java code
        int l = 0;
          goto _L1
_L3:
        JVM INSTR dup ;          // <<<<< that's no java code
        l;

I think you should get a better decompiler or maybe better read the instructions how to decompile...
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
zzynxSoftware engineerCommented:
Read this: http://www.bitarts.com/titanium_java.htm

I quote:
Java programs can be decompiled into their source code structure and then studied, modified and recompiled.
This makes the intellectual content of Java programs very vulnerable.
Titanium for Java makes decompiled programs not only incredibly complex to read but also prevents them from being recompiled without significant modifications to the source code. Titanium for Java is one of the few security products that creates applications that output raw Java byte code when they are decompiled.

Looks like you have class files protected by this one. :)
0
 
petmagdyCommented:
>>ac;
>>ac.length;

those lines r uncomplete expressions comment them or complete the expression
also what is INSTR?
I think u need to provide the whole class
0
 
girionisCommented:
There is probably bytecode embeded into the source java file.
0
 
zzynxSoftware engineerCommented:
>> I don't know solution to compile .Can you help me ?
I'm afraid we can't

0
 
zzynxSoftware engineerCommented:
The example given in that link looks exactly like your output, so...
0
 
TimYatesCommented:
zelix klassmaster produces classes which decompile to this too...

The only way that I know of to decompile this sort of class, is by hand, as automated decompilers don't do a very good job...

I *think* knowledge of the bytecode specification, and javap should help here...  With maybe a printout of the code as well...

I do have to ask though...  Why don't you have the source code?

Are you trying to hack something?  If so, we cannot help you...
0
 
quangnv2005Author Commented:
Thank all .

Very much zzynx , I think you say right .
0
 
zzynxSoftware engineerCommented:
Then please close this Q by accepting my (and maybe other) comment(s)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now