SRL Archive - Archive

gregdw - SRL Member Application


gregdw

2011-12-11 18:25:12

How Long have You Played Runescape?
6 Year(s)


Are you affilated in anyway with Jagex LTD?
no

Were you Referred to SRL?
Pyroryan


What is your general programming knowledge?
Java and a few of its extended libraries.


Are you a member of any other communities?
RSCheata.net - Gmod, RS-Hacking.com.


Tell us about yourself…
From: gregdw
I'm active duty air force, I skate, read, and learn. I love programming.



Please show us one (or multiple) of your scripts.

Wasn't sure what exactly you were looking for, I do got code though.


package bot.src.updater.searcher;

import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;

import org.apache.bcel.classfile.Field;
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.FieldInstruction;
import org.apache.bcel.generic.FieldOrMethod;
import org.apache.bcel.generic.GETFIELD;
import org.apache.bcel.generic.GETSTATIC;
import org.apache.bcel.generic.Instruction;
import org.apache.bcel.generic.InstructionHandle;
import org.apache.bcel.generic.InstructionList;
import org.apache.bcel.generic.PUTFIELD;
import org.apache.bcel.generic.PUTSTATIC;
import org.apache.bcel.generic.Type;
import org.apache.bcel.util.InstructionFinder;

import com.rshacking.rhf.files.ClassContainer;
import com.rshacking.rhf.files.JarContainer;

public class Locator {

ArrayList<InstructionHandle> instruction_list = new ArrayList<InstructionHandle>();

boolean isStatic = false;
boolean hasInterfaces = false;
boolean isFinal = false;
boolean isAbstract = false;
boolean isEnum = false;
boolean isPrivate= false;


int[] codes = new int[] {179, 180, 178, 181};

public Locator(String clazz, String field, JarContainer old, JarContainer jc) {
Object pfd = null;
Object pd = null;
Object pf = null;
int l = 0;
for(ClassContainer cc : old.getClassFiles().values()) {
if(cc.getBCEL().getClassName().contains(clazz)) {
ClassGen cg = new ClassGen(cc.getBCEL());
getSpecials(cg);
for(Method m : cg.getMethods())
if(!m.isStatic() && field != null)
if(cg.containsField(field) != null) {
System.out.println(cg.getClassName() + " Contains field: " + field + " In Method :" + m.getName());
InstructionFinder finder = new InstructionFinder(new InstructionList(m.getCode().getCode()));
for(int i = 0; i < finder.getInstructionList().getInstructions().length; i++) {
InstructionHandle ih = finder.getInstructionList().getInstructionHandles()[i];
for(int i1 : codes)
if(ih.getInstruction().getOpcode() == i1) {
switch(i1) {
case 178:
pf = (GETSTATIC) ih.getInstruction();
break;
case 179:
pf = (PUTSTATIC) ih.getInstruction();
break;
case 180:
pf = (GETFIELD) ih.getInstruction();
break;
case 181:
pf = (PUTFIELD) ih.getInstruction();
break;
}
pfd = ((FieldInstruction) pf).getFieldName(cg.getConstantPool());
pd = ((FieldOrMethod) pf).getLoadClassType(cg.getConstantPool());
if(pd.toString().contains(clazz) && pfd.toString().contains(field)) {
if(ih.getPosition() > 4) {
InstructionHandle temp = ih;
for(int count = -2; count < 7; count++) {
if(count < 0) {
instruction_list.add(temp.getPrev());
temp = temp.getPrev();
} else if(count == 0) {
instruction_list.add(ih);
temp = ih;
} else if(count >0) {
instruction_list.add(temp.getNext());
temp = temp.getNext();
}
}
searchInstructions(getInstructionSet(), jc);
}
}
}
}
}
}
}
}


public boolean searchInstructions(String instructionSet, JarContainer jc) {
boolean found = false;

return found;
}

public void getSpecials(ClassGen cg) {
if(cg.isFinal())
isFinal = true;
if(cg.getInterfaces().length > 0)
hasInterfaces = true;
if(cg.isStatic())
isStatic = true;
if(cg.isAbstract())
isAbstract = true;
if(cg.isEnum())
isEnum = true;
if(cg.isPrivate())
isPrivate = true;
}

public String getInstructionSet() {
String thePattern = "";
for(int i = 0; i < instruction_list.size(); i++) {
thePattern = thePattern + instruction_list.get(i).getInstruction().getName() + " ";
}
instruction_list.clear();
return thePattern;
}
public static void main(String[] args) {
new Locator("ui", "pc", new JarContainer(new File("C:/Users/Greg/Documents/Runescape_Jars/runescape-531.jar")),
new JarContainer(new File("C:/Users/Greg/Documents/Runescape_Jars/runescape-532.jar")));
}
}


import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.Iterator;

import org.apache.bcel.Constants;
import org.apache.bcel.classfile.ConstantPool;
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.Instruction;
import org.apache.bcel.generic.InstructionHandle;
import org.apache.bcel.generic.InstructionList;
import org.apache.bcel.generic.LDC;
import org.apache.bcel.generic.LoadInstruction;
import org.apache.bcel.generic.MethodGen;
import org.apache.bcel.util.InstructionFinder;

import com.rshacking.rhf.files.ClassContainer;
import com.rshacking.rhf.files.JarContainer;
public class ldcFinder {

public ldcFinder() {
try{
FileWriter fstream = new FileWriter("ldc.txt");
BufferedWriter out = new BufferedWriter(fstream);
JarContainer jc = new JarContainer(new File("rs_injected-645.jar"));
for (ClassContainer cc : jc.getClassFiles().values()) {
ClassGen cg = new ClassGen(cc.getBCEL());
for(Method m : cg.getMethods()) {
MethodGen mg = new MethodGen(m,cg.getClassName(),cg.getConstantPool());
if(!m.isInterface() && !m.isAbstract() && !m.isNative()) {
if(m.getCode().getCode() != null) {
InstructionFinder finder = new InstructionFinder(new InstructionList(m.getCode().getCode()));
for (Iterator<InstructionHandle[]> it = finder.search("ldc"); it.hasNext();) {
InstructionHandle[] ih = it.next();
LDC ldc = (LDC) ih[0].getInstruction();
Object ldcVal = ldc.getValue(cg.getConstantPool());
out.write("\n"+cg.getClassName() + "." + mg.getName() + " String :" + ldcVal.toString());
}
}
}
}

}
out.close();
} catch (Exception e){
System.err.println("Error: " + e.getMessage());
}
}

public static void main(String[] args) {
new ldcFinder();
}
}
Otherwise I have no scripts at the moment, I've recently rebooted back to day one without file backs up. I know it sounds convenient, but that's the circumstance.

PatDuffy

2011-12-11 18:27:26

….sigh…. we require a script using SRL functions and procedures in Pascal.

Kyle Undefined

2011-12-11 18:28:19

The application process says Simba (or Scar) scripts needed. Please read. It's a no.

gregdw

2011-12-11 18:45:20

Yeah, I just read all that just now, my brother sent me a link to apply with. My bad. I'll write something up when I get a moment. The updater calls.

Delete please.

Nava2

2011-12-11 19:45:58

Closed, see you shortly. Check out the tutorial section and apply again! :)