I have decompiled a JAVA .class file with the creater permission. its
a little game i'm playing but i can't figur out how to get pass
variable can any body help
here is the .java file
***---------------------------------------------------***
// Decompiled by DJ v3.5.5.77 Copyright 2003 Atanas Neshkov Date:
3/17/2004 11:58:32 PM
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check
often for new version!
// Decompiler options: packimports(3)
// Source File Name: PasswdLevel4.java
import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.EventObject;
public class PasswdLevel4 extends Applet
implements ActionListener
{
public PasswdLevel4()
{
inuser = new String[22];
totno = 0;
countConn = null;
countData = null;
inURL = null;
txtlogin = new TextField();
label1 = new Label();
label2 = new Label();
label3 = new Label();
txtpass = new TextField();
lblstatus = new Label();
ButOk = new Button();
ButReset = new Button();
lbltitle = new Label();
}
void ButOk_ActionPerformed(ActionEvent actionevent)
{
boolean flag = false;
for(int i = 1; i <= totno / 2; i++)
if(txtlogin.getText().trim().toUpperCase().intern() ==
inuser[2 * (i - 1) + 2].trim().toUpperCase().intern() &&
txtpass.getText().trim().toUpperCase().intern() == inuser[2 * (i - 1)
+ 3].trim().toUpperCase().intern())
{
lblstatus.setText("Login Success, Loading..");
flag = true;
String s = inuser[1].trim().intern();
String s1 = getParameter("targetframe");
if(s1 == null)
s1 = "_self";
try
{
finalurl = new URL(getCodeBase(), s);
}
catch(MalformedURLException _ex)
{
lblstatus.setText("Bad URL");
}
getAppletContext().showDocument(finalurl, s1);
}
if(!flag)
lblstatus.setText("Invaild Login or Password");
}
void ButReset_ActionPerformed(ActionEvent actionevent)
{
txtlogin.setText("");
txtpass.setText("");
}
public void actionPerformed(ActionEvent actionevent)
{
Object obj = actionevent.getSource();
if(obj == ButOk)
{
ButOk_ActionPerformed(actionevent);
return;
}
if(obj == ButReset)
ButReset_ActionPerformed(actionevent);
}
public void destroy()
{
ButOk.setEnabled(false);
ButReset.setEnabled(false);
txtlogin.setVisible(false);
txtpass.setVisible(false);
}
public void inFile()
{
new StringBuffer();
try
{
countConn = inURL.openStream();
countData = new BufferedReader(new
InputStreamReader(countConn));
String s;
while((s = countData.readLine()) != null)
if(totno < 21)
{
totno = totno + 1;
inuser[totno] = s;
s = "";
} else
{
lblstatus.setText("Cannot Exceed 10 users, Applet
fail start!");
destroy();
}
}
catch(IOException ioexception)
{
getAppletContext().showStatus("IO Error:" +
ioexception.getMessage());
}
try
{
countConn.close();
countData.close();
return;
}
catch(IOException ioexception1)
{
getAppletContext().showStatus("IO Error:" +
ioexception1.getMessage());
}
}
public void init()
{
setLayout(null);
setSize(361, 191);
add(txtlogin);
txtlogin.setBounds(156, 72, 132, 24);
label1.setText("Please Enter Login Name & Password");
label1.setAlignment(1);
add(label1);
label1.setFont(new Font("Dialog", 1, 12));
label1.setBounds(41, 36, 280, 24);
label2.setText("Login");
add(label2);
label2.setFont(new Font("Dialog", 1, 12));
label2.setBounds(75, 72, 36, 24);
label3.setText("Password");
add(label3);
add(txtpass);
txtpass.setEchoChar('*');
txtpass.setBounds(156, 108, 132, 24);
lblstatus.setAlignment(1);
label3.setFont(new Font("Dialog", 1, 12));
label3.setBounds(75, 108, 57, 21);
add(lblstatus);
lblstatus.setFont(new Font("Dialog", 1, 12));
lblstatus.setBounds(14, 132, 344, 24);
ButOk.setLabel("OK");
add(ButOk);
ButOk.setFont(new Font("Dialog", 1, 12));
ButOk.setBounds(105, 156, 59, 23);
ButReset.setLabel("Reset");
add(ButReset);
ButReset.setFont(new Font("Dialog", 1, 12));
ButReset.setBounds(204, 156, 59, 23);
lbltitle.setAlignment(1);
add(lbltitle);
lbltitle.setFont(new Font("Dialog", 1, 12));
lbltitle.setBounds(12, 14, 336, 24);
String s = getParameter("title");
lbltitle.setText(s);
ButOk.addActionListener(this);
ButReset.addActionListener(this);
infile = new String("level4");
try
{
inURL = new URL(getCodeBase(), infile);
}
catch(MalformedURLException _ex)
{
getAppletContext().showStatus("Bad Counter URL:" + inURL);
}
inFile();
}
private URL finalurl;
String infile;
String inuser[];
int totno;
InputStream countConn;
BufferedReader countData;
URL inURL;
TextField txtlogin;
Label label1;
Label label2;
Label label3;
TextField txtpass;
Label lblstatus;
Button ButOk;
Button ButReset;
Label lbltitle;
}
***---------------------------------------------------***
if any body knows what the vars would be please repely
Andrew Thompson - 17 Mar 2004 17:16 GMT
> I have decompiled a JAVA .class file with the creater permission.
Sure, I accept that without question..
Who is the author?
> if any body knows what the vars would be please repely
Oh that is easy. These are.
> private URL finalurl;
> String infile;
[quoted text clipped - 12 lines]
> Button ButReset;
> Label lbltitle;
HTH

Signature
Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology
Alex Hunsley - 17 Mar 2004 18:09 GMT
>>I have decompiled a JAVA .class file with the creater permission.
>
> Sure, I accept that without question..
>
> Who is the author?
Actually, this one appears to be legit, he's doing the try2hack
contest, read more here:
http://su2.info/doc/try2hack.php
(I found out by googling for PasswdLevel4.class)
alex
Andrew Thompson - 17 Mar 2004 18:30 GMT
>>>I have decompiled a JAVA .class file with the creater permission.
>>
[quoted text clipped - 8 lines]
>
> (I found out by googling for PasswdLevel4.class)
Google.. riiight, that's that archive ..engine
thing isn't it? What's it do again?
(slaps forehead) ;-)

Signature
Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology
Mark Haase - 18 Mar 2004 05:58 GMT
> I have decompiled a JAVA .class file with the creater permission. its
> a little game i'm playing but i can't figur out how to get pass
> variable can any body help
hey zv
after reading this thread i started playing the game as well..it is kind
of fun
anyways, the pass variable isn't easily found in the source code...
<big hint>
.
.
.
.
.
.
its loaded from an external file
|\/| /| |2 |<
mehaase(at)sas(dot)upenn(dot)edu
Roedy Green - 20 Mar 2004 06:58 GMT
: .) wrote or quoted :
>if any body knows what the vars would be please repely
I think you are asking "what were the true names of the local
variables in the original Java source?"
You can't answer that just from the class file since they are not
included. The decompiler just makes up some plausible names based the
types. As you figure out what the program does, you rename to better
names.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Tony Morris - 20 Mar 2004 09:13 GMT
*cough*
*choke*
*spew*
It means you have to start again, and write it properly.

Signature
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)