Code:
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Insets;
import java.awt.Toolkit;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
public class GoogleReflect extends JFrame {
/**
*
*/
private static final long serialVersionUID = 154875411;
public static String frameTitle = "Google™ PSReflector";
private static client c = null;
private static Method[] methods = null;
private static Field[] fields = null;
private static Player player = null;
private static SpotGraphics Stream = null;
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
//super.paint()
try {
GoogleReflect frame = new GoogleReflect();
frame.setTitle(frameTitle);
Class<client> clientClass = (Class<client>) client.class;
//Class<Stream> StreamClass = (Class<Stream>) Stream.class;
//Class<Player> PlayerClass = (Class<Player>) Player.class;
methods = clientClass.getDeclaredMethods();
fields = clientClass.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
fields[i].setAccessible(true);
}
for (int i = 0; i < methods.length; i++) {
methods[i].setAccessible(true);
}
System.out.println("Found " + methods.length + " methods in client and " + fields.length + " fields");
//System.out.println("Found " + methods.length + " methods in Stream and " + fields.length + " fields");
//System.out.println("Found " + methods1.length + " methods in Player and " + fields1.length + " fields");
Applet loader = (Applet) clientClass.newInstance();
frame.getContentPane().add(loader);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
Dimension frameSize = frame.getSize();
frame.setLocation((screenSize.width - screenInsets.left - screenInsets.right - frameSize.width) / 2, (screenSize.height - screenInsets.top - screenInsets.bottom - frameSize.height) / 2);
frame.setVisible(true);
loader.init();
//System.out.println(getField("server"));
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public GoogleReflect() {
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(771, 554);
JMenuBar menuBar = new JMenuBar();
menuBar.setForeground(Color.BLACK);
menuBar.setBackground(Color.WHITE);
setJMenuBar(menuBar);
JMenu mnNewMenu = new JMenu("File");
menuBar.add(mnNewMenu);
JMenuItem mntmNewMenuItem = new JMenuItem("Close");
mntmNewMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
mnNewMenu.add(mntmNewMenuItem);
JMenu mnNewMenu_1 = new JMenu("Client");
menuBar.add(mnNewMenu_1);
JMenuItem mntmCustomCommand = new JMenuItem("Custom Command");
mntmCustomCommand.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
String input = JOptionPane.showInputDialog(this ,"Please enter the command you would like to execute");
try {
command(input);
} catch (IllegalArgumentException e) {
JOptionPane.showMessageDialog(null, "Invalid Command!", "Invalid Command!", JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
} catch (IllegalAccessException e) {
JOptionPane.showMessageDialog(null, "Invalid Command!", "Invalid Command!", JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
}
}
});
JMenuItem mntmUsername = new JMenuItem("Username");
mntmUsername.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try {
getField("server").set(c, "Google420");
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
mnNewMenu_1.add(mntmUsername);
mnNewMenu_1.add(mntmCustomCommand);
contentPane = new JPanel();
//contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
public static Field getField(String s) {
for (int i = 0; i < fields.length; i++) {
if (fields[i].getName().equals(s)) {
//System.out.println("FOUND FIELD: "+fields[i].toGenericString());
return fields[i];
}
}
return null;
}
public static Method getMethod(String s) {
for (int i = 0; i < methods.length; i++) {
if (methods[i].getName().equals(s)) {
//System.out.println("FOUND METHOD: "+methods[i].toGenericString());
return methods[i];
}
}
return null;
}
public static void command(String text) throws IllegalArgumentException, IllegalAccessException {
if (c == null) {
c = ObjectDef.clientInstance;
}
text = text.toLowerCase();
if (player == null) {
player = (Player) getField("myPlayer").get(c);
}
if (text == null) {
return;
}
try {
System.out.println("CMD: " + text + "");
if (text.toLowerCase().contains("bank")) {
sendFrame248(5292, 5063);
} else if (text.toLowerCase().contains("interface")) {
openInterface(Integer.parseInt(text.substring(10)));
} else if (text.contains("noclip")) {
noclip();
} else if (text.startsWith("object")) {
int x = getField("baseX").getInt(c) + (player.x - 6 >> 7);
int y = getField("baseY").getInt(c) + (player.y - 6 >> 7);
String stringToInt = JOptionPane.showInputDialog(null ,"Please enter the command you would like to execute");
int ID = Integer.parseInt(stringToInt);
addObject(x, y, ID, 0, 10, 0);
} else if (text.startsWith("admin")) {
getField("myPrivilege").set(c, 2);
} else if (text.equalsIgnoreCase("mod")) {
getField("myPrivilege").set(c, 1);
} else if (text.startsWith("donator")) {
getField("myPrivilege").set(c, 4);
} else if (text.startsWith("dev")) {
getField("myPrivilege").set(c, 3);
} else if (text.startsWith("ancients")) {
setSidebar(6, 12855);
} else if (text.startsWith("modern")) {
setSidebar(6, 1151);
} else if (text.startsWith("::woot")) {
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void sendFrame248(int interfaceID,int sideInterfaceID) throws IllegalArgumentException, IllegalAccessException {
client.openInterfaceID = interfaceID;
Object anchor = null;
getField("invOverlayInterfaceID").set(c, sideInterfaceID);
//client.needDrawTabArea = true;
getField("needDrawTabArea").set(c, true);
//c.tabAreaAltered = true;
getField("tabAreaAltered").set(c, true);
//c.aBoolean1149 = false;
getField("aBoolean1149").set(c, true);
}
private static void openInterface(int interfaceID) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
Field openInterfaceID = getField("openInterfaceID");
Field invOverlayInterfaceID = getField("invOverlayInterfaceID");
Field needDrawTabArea = getField("needDrawTabArea");
Field tabAreaAltered = getField("tabAreaAltered");
Field backDialogID = getField("backDialogID");
Field inputTaken = getField("inputTaken");
Field inputDialogState = getField("inputDialogState");
Method m = getMethod("method60");
m.invoke(c, interfaceID);
if ((Integer) invOverlayInterfaceID.get(c) != -1) {
invOverlayInterfaceID.set(c, -1);
needDrawTabArea.set(c, true);
tabAreaAltered.set(c, true);
}
if ((Integer) backDialogID.get(c) != -1) {
backDialogID.set(c, -1);
inputTaken.set(c, true);
}
if ((Integer) inputDialogState.get(c) != 0) {
inputDialogState.set(c, 0);
inputTaken.set(c, true);
}
openInterfaceID.set(c, interfaceID);
getField("aBoolean1149").set(c, false);
getField("pktType").set(c, -1);
openInterfaceID.set(c, interfaceID);
}
private static void noclip() throws IllegalArgumentException, IllegalAccessException {
for (int k1 = 0; k1 < 4; k1++) {
for (int i2 = 1; i2 < 103; i2++) {
for (int k2 = 1; k2 < 103; k2++) {
Class11[] class11 = (Class11[]) getField("aClass11Array1230").get(c);
//class11[k1].anIntArrayArray294[i2][k2] = 0; //anIntArrayArray294 sg aClass11Array1230 anIntArrayArray294
}
}
}
}
private static void setSidebar(int menuId, int form) throws IllegalArgumentException, IllegalAccessException {
int l1 = form;
int j10 = menuId;
int[] f = (int[]) getField("tabInterfaceIDs").get(c);
//client.tabInterfaceIDs[j10] = l1;
//getField("tabInterfaceIDs").set(c, f);
getField("needDrawTabArea").setBoolean(c, true);
getField("tabAreaAltered").setBoolean(c, true);
}
public static void addObject(int x, int y, int objectId, int face, int type, int height) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
int mX = getField("anInt1069").getInt(c) - 6;
int mY = getField("anInt1070").getInt(c) - 6;
int x2 = x - (mX * 8);
int y2 = y - (mY * 8);
int i15 = 40 >> 2;
int[] anInt = (int[]) getField("anIntArray1177").get(c);
int l17 = anInt[i15];
if (y2 > 0 && y2 < 103 && x2 > 0 && x2 < 103) {
getMethod("method130").invoke(c, -1, objectId, face, l17, y2, type, height, x2, 0);
}
}
}