PDA

View Full Version : Anyone know java?



Vampmaster
20th Apr 2003, 11:28
I'm working on a new code encryptor (It will do multiple lines so it will make SR2/BO2 codes come faster.) but there's one last error I need to fix before I can really get going on it. Can anyone help me?

Cheat2.java:21: cannot resolve symbol
symbol : method addTextListener (Cheat2)
location: class javax.swing.JTextArea
ar2.addTextListener(this);
^
1 error


import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;


class Cheat2 extends JFrame implements ActionListener, TextListener {


protected final int NOOFBUTTONS = 3;
protected JTextArea ar2;
protected JButton[] button = new JButton[NOOFBUTTONS];
static String[] buttons = {"OK","Another","Yet Another"};


public Cheat2(String text) {

super(text);
Container container = getContentPane();
Toolkit theKit = container.getToolkit();
Dimension wndSize = theKit.getScreenSize();
ar2 = new JTextArea("");
ar2.addTextListener(this);
JScrollPane ar2scroll = new JScrollPane(ar2);
container.add(ar2scroll);
ar2scroll.setBounds(200, 200, 200, 200);

for (int index = 0; index != NOOFBUTTONS; index++) {
button[index] = new JButton(buttons[index]);
button[index].setBorder(BorderFactory.createRaisedBevelBorder());
button[index].addActionListener(this);
container.add(button[index]);
}

button[0].setBounds(50, 50, 100, 20);
button[1].setBounds(100, 100, 100, 20);
button[2].setBounds(150, 150, 100, 20);

JPanel backPanel = new JPanel(); // Need new one for card layout.
container.add(backPanel);
backPanel.setBounds(0, 0, wndSize.width, wndSize.height);
}


static void doAction(int buttonID) {

switch(buttonID) {
case 0:
System.out.println("OK");
break;
case 1:
System.out.println("Another");
break;
case 2:
System.out.println("Yet Another");
break;
}
}


public void actionPerformed(ActionEvent event) {


Object source = event.getSource();

for (int index = 0; index != NOOFBUTTONS;) {
if (source == button[index])
doAction(index);
index++;
}
}


public void textValueChanged(TextEvent event) {


String data = ar2.getText();
if (event.getSource() == ar2) System.out.println(data);
}

}


class Cheat2App {


public static void main (String[] args) {


Cheat2 mainWindow = new Cheat2("Code Maker for AR2 & GS2");
Toolkit theKit = mainWindow.getToolkit();
Dimension wndSize = theKit.getScreenSize();
mainWindow.setBounds(wndSize.width/4, wndSize.height/4,
wndSize.width/2, wndSize.height/2);
mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWindow.setVisible(true);
}
}

blincoln
21st Apr 2003, 03:39
Sounds like a cool plan. I was thinking of making something along those lines, but I just haven't had time. I hope it works out for you =).

As for the error, it's been years since I've worked in Java, but it looks to me like it isn't liking your use of addTextListener from ar2. Are you sure that's a valid function of the JTextArea class?

Vampmaster
21st Apr 2003, 23:33
You're right, that was the problem. I tried to find another way of doing that, but I found out I don't need it to get the getText and setText methods to work. That part's working great now. I've got it so it can turn hex bytes into integers but it won't let me put them anywhere. I tried having an array of bytes to store them in at the beginning of the class, but it gives me a lot of errors when I try to put stuff in it. I think it wants me to specify a length.

Another thing I want to add is some dialog boxes where instead of knowing the command you just choose an option from a list and it asks for addresses, values, numbers of lines to skip etc. That shouldn't be too hard once I get it so it can understand the hex.

Umah Bloodomen
22nd Apr 2003, 02:02
How'd I miss this topic? I just got through with a JAVA class. :p**shrugs**

Ah well, good luck with your encryptor, Vamp. :)

Vampmaster
23rd Apr 2003, 20:06
It's working now! (I think) If I stick some radio buttons in it and have something to decide which encryption to use, then I can start working on the more advanced features. I'm hoping to include input forms for the more compicated commands, binary and integer converters and possibly an analyser that can scan through the whole code and explain what every line does. I havn't decided how it will deal with spaces and carrage returns yet, 'cause a lot of the program depends on the array length. I'll post what I have so far in case anyone wants a look.

import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;



class Cheat3 extends JFrame implements ActionListener {


protected JTextArea ar2;
protected static final String[] buttons = {"Encrypted","Encrypt","Unencrpted"};
protected static final int lineLength = 8;
protected final int NOOFBUTTONS = buttons.length;
protected JButton[] button = new JButton[NOOFBUTTONS];
protected String ar2input;
protected char[] ar2inputC = {31};
protected char[] outputC = {31};
protected int[] byteArray;
protected static char[] hexValues =
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};


public Cheat3(String text) {


super(text);
Container container = getContentPane();
Toolkit theKit = container.getToolkit();
Dimension wndSize = theKit.getScreenSize();
ar2 = new JTextArea("");
ar2.setLineWrap(true);
JScrollPane ar2scroll = new JScrollPane(ar2);
container.add(ar2scroll);
ar2scroll.setVerticalScrollBarPolicy(
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
ar2scroll.setBounds(40, 80, 170, 200);

for (int index = 0; index != NOOFBUTTONS; index++) {
button[index] = new JButton(buttons[index]);
button[index].setBorder(BorderFactory.createRaisedBevelBorder());
button[index].addActionListener(this);
container.add(button[index]);
}

button[0].setBounds(0, 0, 100, 20);
button[1].setBounds(0, 20, 100, 20);
button[2].setBounds(0, 40, 100, 20);

JPanel backPanel = new JPanel(); // Need new one for card layout.
container.add(backPanel);
backPanel.setBounds(0, 0, wndSize.width, wndSize.height);
}



public void doAction(int buttonID) {


switch(buttonID) {
case 0:
ar2input = ar2.getText();
ar2inputC = ar2input.toCharArray();
hexByte();
encryption();
System.out.println("");
break;
case 1:
// Read text from text area.
ar2input = ar2.getText();
// Turn text into array of characters.
ar2inputC = ar2input.toCharArray();
// Turn chatacters into array of bytes stored as ints.
hexByte();
// Encrypt the bytes.
encryption();
// Turn bytes into an array of characters.
byteHex();
// Turn characters into a string.
ar2input = String.copyValueOf(outputC);
// Put string in text area.
ar2.setText(ar2input);
break;
case 2:
ar2input = ar2.getText();
ar2inputC = ar2input.toCharArray();
hexByte();
temp();
System.out.println("");
break;
}
}


public void actionPerformed(ActionEvent event) {


Object source = event.getSource();

for (int index = 0; index != NOOFBUTTONS;) {
if (source == button[index])
doAction(index);
index++;
}
}


public void hexByte() {

int currentByte = 0;
byteArray = new int[(int)(8 * Math.ceil((double)(ar2inputC.length) / 16))];
for (int index = 0; index < (ar2inputC.length - 1);) {

if ((ar2inputC[index] >= 97) & (ar2inputC[index] <= 102)) {
currentByte = (int) (16 * (ar2inputC[index] - 87));
}
else if ((ar2inputC[index] >= 65) & (ar2inputC[index] <= 70)) {
currentByte = (int) (16 * (ar2inputC[index] - 55));
}
else if ((ar2inputC[index] >= 48) & (ar2inputC[index] <= 57)) {
currentByte = (int) (16 * (ar2inputC[index] - 48));
}
else {
currentByte = 0;
}
if ((ar2inputC[index + 1] >= 97) & (ar2inputC[index + 1] <= 102)) {
currentByte += (int) (ar2inputC[index + 1] - 87);
}
else if ((ar2inputC[index + 1] >= 65) & (ar2inputC[index + 1] <= 70)) {
currentByte += (int) (ar2inputC[index + 1] - 55);
}
else if ((ar2inputC[index + 1] >= 48) & (ar2inputC[index + 1] <= 57)) {
currentByte += (int) (ar2inputC[index + 1] - 48);
}
else {
currentByte += 0;
}
byteArray[index / 2] = currentByte;
index += 2;
}
}


public void byteHex() {

outputC = new char[(2 * byteArray.length)];
int char0 = 0;
int char1 = 0;
int char2 = 0;
int index2 = 0;
for (int index = 0; index < byteArray.length; index++) {
char0 = byteArray[index];
for(;char0 < 0;) {
char0 += 256;
}
for(;char0 > 255;) {
char0 -= 256;
}
char1 = char0;
char1 &= 0x0000000F;
char2 = char0>>>4;
char2 &= 0x0000000F;
// System.out.println(byteArray[index] + " " + char0 + " " + char2 + " " + char2);
outputC[index2] = hexValues[char2];
index2++;
outputC[index2] = hexValues[char1];
index2++;
}
/*for (int index3 = 0; index3 < outputC.length; index3++) {
System.out.print("");
System.out.print(outputC[index3]);
}*/
}


public void temp() {

for (int index = 0; index < byteArray.length; index++) {
System.out.print(byteArray[index] + ", ");
}
}


public void encryption() {

for (int index = 0; index < byteArray.length;) {
for (int byteNo = 0; byteNo < lineLength;) {

switch(byteNo) {
case 0:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x000000A6) - 0x0000006A;
break;
case 1:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000096) - 0x000000FF;
break;
case 2:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000001) - 0x0000007E;
break;
case 3:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000082) - 0x0000005A;
break;
case 4:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x000000D9) - 0x000000C5;
break;
case 5:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x0000003B) - 0x000000E5;
break;
case 6:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x0000001B) - 0x00000034;
break;
case 7:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x000000CC) - 0x00000027;
break;
}
byteNo++;
}
index += lineLength;
}
}
}


class Cheat3App {



public static void main (String[] args) {


Cheat3 mainWindow = new Cheat3("Code Maker for AR2 & GS2");
Toolkit theKit = mainWindow.getToolkit();
Dimension wndSize = theKit.getScreenSize();
mainWindow.setBounds(wndSize.width/4, wndSize.height/4,
wndSize.width/2, wndSize.height/2);
mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWindow.setVisible(true);
}
}

Vampmaster
26th Apr 2003, 13:27
The java to exe thing was a crock. It only works if you have jdk and both all the classes. I thought I might as well have just posted the code again. I've found something a bit better. It doesn't need me to send the classes with the exe, but it might need the jdk.

import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;



class Cheat3 extends JFrame implements ActionListener {


protected JTextArea ar2;
protected JTextArea ar2Mcode;
protected static final String[] buttons = {"Decrypt","Encrypt","Unused"};
protected static final String[] encryptionModes = {"1456E7A5","F8FCFEFE","BCA99B83"};
protected static final int lineLength = 8;
protected static final int lineLengthC = 16;
protected final int NOOFBUTTONS = buttons.length;
protected JButton[] button = new JButton[NOOFBUTTONS];
protected JRadioButton ar2encrypt;
protected JRadioButton ar2decrypt;
protected JComboBox encryptType;
protected int ar2mode = 1;
protected boolean ar2encrypted = (false);
protected String ar2input;
protected char[] inputC = {31};
protected char[] outputC = {31};
protected String output;
protected int withoutNulls;
protected int[] byteArray;
protected static char[] hexValues =
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};


public Cheat3(String text) {


super(text);
Container container = getContentPane();
Toolkit theKit = container.getToolkit();
Dimension wndSize = theKit.getScreenSize();
ar2 = new JTextArea("");
ar2.setLineWrap(true);
JScrollPane ar2scroll = new JScrollPane(ar2);
container.add(ar2scroll);
ar2scroll.setVerticalScrollBarPolicy(
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
ar2scroll.setBounds(20, 80, 170, 200);

ar2Mcode = new JTextArea("", 2, 16);
ar2Mcode.setLineWrap(true);
ar2Mcode.setBounds(210, 40, 170, 40);
ar2Mcode.setBorder(BorderFactory.createLineBorder(Color.gray));
container.add(ar2Mcode);

for (int index = 0; index != NOOFBUTTONS; index++) {
button[index] = new JButton(buttons[index]);
button[index].setBorder(BorderFactory.createRaisedBevelBorder());
button[index].addActionListener(this);
// container.add(button[index]);
}

button[0].setBounds(0, 0, 100, 20);
button[1].setBounds(0, 20, 100, 20);
button[2].setBounds(0, 40, 100, 20);

ar2encrypt = new JRadioButton(" AR2");
ar2encrypt.addActionListener(this);
ar2encrypt.setBounds(20, 20, 85, 20);
container.add(ar2encrypt);

ar2decrypt = new JRadioButton(" Hex");
ar2decrypt.setSelected(true);
ar2decrypt.addActionListener(this);
ar2decrypt.setBounds(105, 20, 85, 20);
container.add(ar2decrypt);
/*ButtonGroup group = new ButtonGroup();
group.add(ar2encrypt);
group.add(ar2decrypt);*/

encryptType = new JComboBox(encryptionModes);
encryptType.setSelectedIndex(0);
encryptType.addActionListener(this);
encryptType.setBounds(20, 40, 170, 20);
container.add(encryptType);

JPanel backPanel = new JPanel(); // Need new one for card layout.
container.add(backPanel);
backPanel.setBounds(0, 0, wndSize.width, wndSize.height);
}



public void doAction(int buttonID) {


switch(buttonID) {
case 0:
ar2decrypt.setSelected(true);
ar2encrypt.setSelected(false);
ar2encrypted = (false);
ar2input = ar2.getText();
inputC = ar2input.toCharArray();
hexByte();
ar2decryption(ar2mode);
byteHex();
output = String.copyValueOf(outputC);
ar2.setText(output);
break;
case 1:
ar2encrypt.setSelected(true);
ar2decrypt.setSelected(false);
ar2encrypted = (true);
ar2input = ar2.getText();
inputC = ar2input.toCharArray();
hexByte();
ar2encryption(ar2mode);
byteHex();
output = String.copyValueOf(outputC);
ar2.setText(output);
break;
case 2:
ar2input = ar2.getText();
inputC = ar2input.toCharArray();
hexByte();
temp();
System.out.println("");
break;
case 3:
if (ar2encrypted) {
ar2input = ar2.getText();
inputC = ar2input.toCharArray();
hexByte();
ar2decryption(ar2mode); // Given current encryption
}
if(encryptType.getSelectedItem() == "1456E7A5")
{ar2mode = 1;}
if(encryptType.getSelectedItem() == "F8FCFEFE")
{ar2mode = 2;}
if(encryptType.getSelectedItem() == "BCA99B83")
{ar2mode = 3;}
if (ar2encrypted) {
ar2encryption(ar2mode); // Given new encryption
byteHex();
output = String.copyValueOf(outputC);
ar2.setText(output);
}
break;
}
}


public void actionPerformed(ActionEvent event) {


Object source = event.getSource();

if (source == ar2decrypt)
doAction(0);
if (source == ar2encrypt)
doAction(1);
if (source == encryptType) {
doAction(3);
// System.out.println(ar2mode);
}

for (int index = 0; index != NOOFBUTTONS;) {
if (source == button[index])
doAction(index);
index++;
}
}


public void hexByte() {

int currentByte = 0;
int whiteSpaces = 0;
int index;
// Counts whiteSpaces beforehand.
for (index = 0; index < inputC.length; index++) {
if (Character.isWhitespace(inputC[index])) {
whiteSpaces++;
}
}
withoutNulls = inputC.length - whiteSpaces;
whiteSpaces = 0;
byteArray = new int[(int)(8 * Math.ceil((double)(withoutNulls) / 16))];
for (index = 0; index < (inputC.length - 1);) {
if (Character.isWhitespace(inputC[index])) {
index++;
whiteSpaces++;
}
else {
if ((inputC[index] >= 97) & (inputC[index] <= 102)) {
currentByte = (int) (16 * (inputC[index] - 87));
}
else if ((inputC[index] >= 65) & (inputC[index] <= 70)) {
currentByte = (int) (16 * (inputC[index] - 55));
}
else if ((inputC[index] >= 48) & (inputC[index] <= 57)) {
currentByte = (int) (16 * (inputC[index] - 48));
}
else {
currentByte = 0;
}
if ((inputC[index + 1] >= 97) & (inputC[index + 1] <= 102)) {
currentByte += (int) (inputC[index + 1] - 87);
}
else if ((inputC[index + 1] >= 65) & (inputC[index + 1] <= 70)) {
currentByte += (int) (inputC[index + 1] - 55);
}
else if ((inputC[index + 1] >= 48) & (inputC[index + 1] <= 57)) {
currentByte += (int) (inputC[index + 1] - 48);
}
else {
currentByte += 0;
}
byteArray[(index - whiteSpaces)/ 2] = currentByte;
index += 2;
}
}
}


public void byteHex() {

// 9/4 Adds 2 chars for every line. Was * 2 to start with.
outputC = new char[(9 * byteArray.length / 4)];
int char0 = 0;
int char1 = 0;
int char2 = 0;
int index2 = 0;
// Change index += lineLengthC to
for (int index = 0; index < byteArray.length; index += lineLength) {
// Remove for statement and closing bracket and both if blocks.
// Also third if statement and closing bracked but not it's contents.
for (int charNo = 0; charNo < lineLength; charNo++) {
char0 = byteArray[(index + charNo)]; // Remove charNo.
for(;char0 < 0;) {
char0 += 256;
}
for(;char0 > 255;) {
char0 -= 256;
}
char1 = char0;
char1 &= 0x0000000F;
char2 = char0>>>4;
char2 &= 0x0000000F;
// System.out.println(byteArray[index] + " " + char0 + " " + char2 + " " + char2);
outputC[index2] = hexValues[char2];
index2++;
outputC[index2] = hexValues[char1];
index2++;
if (charNo == 3) {
outputC[index2] = ' ';
index2++;
}
if (charNo == 7) {
outputC[index2] = '\n';
index2++;
}
}
}
/*for (int index3 = 0; index3 < outputC.length; index3++) {
System.out.print("");
System.out.print(outputC[index3]);
}*/
}


public void temp() {

for (int index = 0; index < byteArray.length; index++) {
System.out.print(byteArray[index] + ", ");
}
}


public void ar2encryption(int mode) {

switch(mode) {
case 1:
encryption1();
break;
case 2:
encryption2();
break;
case 3:
encryption3();
break;
}
}


public void ar2decryption(int mode) {


switch(mode) {
case 1:
decryption1();
break;
case 2:
decryption2();
break;
case 3:
decryption3();
break;
}
}



public void encryption1() {

for (int index = 0; index < byteArray.length;) {
for (int byteNo = 0; byteNo < lineLength;) {

switch(byteNo) {
case 0:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x000000A6) - 0x0000006A;
break;
case 1:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000096) - 0x000000FF;
break;
case 2:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000001) - 0x0000007E;
break;
case 3:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000082) - 0x0000005A;
break;
case 4:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x000000D9) - 0x000000C5;
break;
case 5:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x0000003B) - 0x000000E5;
break;
case 6:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x0000001B) - 0x00000034;
break;
case 7:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x000000CC) - 0x00000027;
break;
}
byteNo++;
}
index += lineLength;
}
}


public void encryption2() {


for (int index = 0; index < byteArray.length;) {
for (int byteNo = 0; byteNo < lineLength;) {

switch(byteNo) {
case 0:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x0000001C) ^ 0x00000000;
break;
case 1:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x000000F7) ^ 0x00000000;
break;
case 2:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x0000004E) ^ 0x00000000;
break;
case 3:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x000000CF) ^ 0x00000000;
break;
case 4:
byteArray[byteNo + index] = (byteArray[byteNo + index] - 0x00000044) ^ 0x00000044;
break;
case 5:
byteArray[byteNo + index] = (byteArray[byteNo + index] - 0x00000042) ^ 0x00000042;
break;
case 6:
byteArray[byteNo + index] = (byteArray[byteNo + index] - 0x00000027) ^ 0x00000027;
break;
case 7:
byteArray[byteNo + index] = (byteArray[byteNo + index] - 0x00000009) ^ 0x00000009;
break;
}
byteNo++;
}
index += lineLength;
}
}


public void encryption3() {



for (int index = 0; index < byteArray.length;) {
for (int byteNo = 0; byteNo < lineLength;) {

switch(byteNo) {
case 0:
byteArray[byteNo + index] = (byteArray[byteNo + index] - 0x00000069) ^ 0x00000069;
break;
case 1:
byteArray[byteNo + index] = (byteArray[byteNo + index] - 0x0000004F) ^ 0x0000004F;
break;
case 2:
byteArray[byteNo + index] = (byteArray[byteNo + index] - 0x0000007B) ^ 0x0000007B;
break;
case 3:
byteArray[byteNo + index] = (byteArray[byteNo + index] - 0x00000047) ^ 0x00000047;
break;
case 4:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x000000BC) ^ 0x00000000;
break;
case 5:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x000000A9) ^ 0x00000000;
break;
case 6:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x0000009B) ^ 0x00000000;
break;
case 7:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x00000083) ^ 0x00000000;
break;
}
byteNo++;
}
index += lineLength;
}
}


public void decryption1() {


for (int index = 0; index < byteArray.length;) {
for (int byteNo = 0; byteNo < lineLength;) {

switch(byteNo) {
case 0:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x0000006A) ^ 0x000000A6;
break;
case 1:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x000000FF) ^ 0x00000096;
break;
case 2:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x0000007E) ^ 0x00000001;
break;
case 3:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x0000005A) ^ 0x00000082;
break;
case 4:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x000000C5) ^ 0x000000D9;
break;
case 5:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x000000E5) ^ 0x0000003B;
break;
case 6:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x00000034) ^ 0x0000001B;
break;
case 7:
byteArray[byteNo + index] = (byteArray[byteNo + index] + 0x00000027) ^ 0x000000CC;
break;
}
byteNo++;
}
index += lineLength;
}
}


public void decryption2() {



for (int index = 0; index < byteArray.length;) {
for (int byteNo = 0; byteNo < lineLength;) {

switch(byteNo) {
case 0:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000000) - 0x0000001C;
break;
case 1:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000000) - 0x000000F7;
break;
case 2:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000000) - 0x0000004E;
break;
case 3:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000000) - 0x000000CF;
break;
case 4:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000044) + 0x00000044;
break;
case 5:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000042) + 0x00000042;
break;
case 6:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000027) + 0x00000027;
break;
case 7:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000009) + 0x00000009;
break;
}
byteNo++;
}
index += lineLength;
}
}


public void decryption3() {



for (int index = 0; index < byteArray.length;) {
for (int byteNo = 0; byteNo < lineLength;) {

switch(byteNo) {
case 0:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000069) + 0x00000069;
break;
case 1:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x0000004F) + 0x0000004F;
break;
case 2:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x0000007B) + 0x0000007B;
break;
case 3:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000047) + 0x00000047;
break;
case 4:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000000) - 0x000000BC;
break;
case 5:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000000) - 0x000000A9;
break;
case 6:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000000) - 0x0000009B;
break;
case 7:
byteArray[byteNo + index] = (byteArray[byteNo + index] ^ 0x00000000) - 0x00000083;
break;
}
byteNo++;
}
index += lineLength;
}
}

}


class Cheat3App {



public static void main (String[] args) {


Cheat3 mainWindow = new Cheat3("Code Maker for AR2 & GS2");
Toolkit theKit = mainWindow.getToolkit();
Dimension wndSize = theKit.getScreenSize();
mainWindow.setBounds(wndSize.width/4, wndSize.height/4,
wndSize.width/2, wndSize.height/2);
mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWindow.setVisible(true);
}
}

Umah Bloodomen
26th Apr 2003, 19:57
I also use JDK. (and Real J). Both are really cool for JAVA.

Vampmaster
26th Apr 2003, 22:39
So at least you'll be able to try the encryptor if you compile the code from my last post. The exe file I sent you is probably useless.

Umah Bloodomen
26th Apr 2003, 22:41
I haven't tried yet, but I will keep you posted. :)