Get last 2 client.drawAlpha hooks
This commit is contained in:
@@ -166,7 +166,7 @@ public class DrawAfterWidgets
|
|||||||
{
|
{
|
||||||
// If we get here, we're either in the wrong method
|
// If we get here, we're either in the wrong method
|
||||||
// or Jagex has removed the "if (535573958 * kl != -1)"
|
// or Jagex has removed the "if (535573958 * kl != -1)"
|
||||||
logger.debug("Could not find the label for jumping to the " + noClip + " call in " + m);
|
// logger.debug("Could not find the label for jumping to the " + noClip + " call in " + m);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import net.runelite.asm.attributes.Code;
|
|||||||
import net.runelite.asm.attributes.code.Instruction;
|
import net.runelite.asm.attributes.code.Instruction;
|
||||||
import net.runelite.asm.attributes.code.InstructionType;
|
import net.runelite.asm.attributes.code.InstructionType;
|
||||||
import net.runelite.asm.attributes.code.Instructions;
|
import net.runelite.asm.attributes.code.Instructions;
|
||||||
|
import net.runelite.asm.attributes.code.instruction.types.LVTInstruction;
|
||||||
|
import net.runelite.asm.attributes.code.instructions.ALoad;
|
||||||
import net.runelite.asm.attributes.code.instructions.ArrayStore;
|
import net.runelite.asm.attributes.code.instructions.ArrayStore;
|
||||||
import net.runelite.asm.attributes.code.instructions.GetField;
|
import net.runelite.asm.attributes.code.instructions.GetField;
|
||||||
import net.runelite.asm.attributes.code.instructions.GetStatic;
|
import net.runelite.asm.attributes.code.instructions.GetStatic;
|
||||||
@@ -44,6 +46,8 @@ public class RasterizerHook
|
|||||||
private static final String r3d_vert = "Rasterizer3D_vertAlpha";
|
private static final String r3d_vert = "Rasterizer3D_vertAlpha";
|
||||||
private static final String r3d_horiz = "Rasterizer3D_horizAlpha";
|
private static final String r3d_horiz = "Rasterizer3D_horizAlpha";
|
||||||
private static final String r3d_field = "Rasterizer3D_alpha";
|
private static final String r3d_field = "Rasterizer3D_alpha";
|
||||||
|
private static final String sprite_alpha1 = "Sprite_alpha1";
|
||||||
|
private static final String sprite_alpha2 = "Sprite_alpha2";
|
||||||
|
|
||||||
private static final String font = "AbstractFont_placeGlyph";
|
private static final String font = "AbstractFont_placeGlyph";
|
||||||
private static final String rast3D = "Rasterizer3D_iDontKnow";
|
private static final String rast3D = "Rasterizer3D_iDontKnow";
|
||||||
@@ -71,15 +75,14 @@ public class RasterizerHook
|
|||||||
public void inject() throws InjectionException
|
public void inject() throws InjectionException
|
||||||
{
|
{
|
||||||
runDrawAlpha();
|
runDrawAlpha();
|
||||||
|
|
||||||
logger.info("Injected {} drawAlpha's", count);
|
logger.info("Injected {} drawAlpha's", count);
|
||||||
|
assert count == 35 : "Either too many or not enough drawAlpha's were injected";
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
runVars();
|
runVars();
|
||||||
|
|
||||||
{
|
|
||||||
// throw new InjectionException("Not all variable alpha thingshits were found");
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,6 +95,8 @@ public class RasterizerHook
|
|||||||
runAlpha(line_alpha, 1, 4);
|
runAlpha(line_alpha, 1, 4);
|
||||||
runAlpha(line_alpha2, 1, 4);
|
runAlpha(line_alpha2, 1, 4);
|
||||||
runAlpha(more_alpha, 1, 5);
|
runAlpha(more_alpha, 1, 5);
|
||||||
|
runAlpha(sprite_alpha1, 1, 9, 0);
|
||||||
|
runAlpha(sprite_alpha2, 1, 12, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runR3DAlpha(String methodName, int req, String fieldName) throws InjectionException
|
private void runR3DAlpha(String methodName, int req, String fieldName) throws InjectionException
|
||||||
@@ -135,16 +140,27 @@ public class RasterizerHook
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void runAlpha(String methodName, int req, int extraArg) throws InjectionException
|
private void runAlpha(String methodName, int req, int extraArg) throws InjectionException
|
||||||
|
{
|
||||||
|
runAlpha(methodName, req, extraArg, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void runAlpha(String methodName, int req, int extraArg, int varIndex) throws InjectionException
|
||||||
{
|
{
|
||||||
final net.runelite.asm.pool.Field pixels = findDeobField("Rasterizer2D_pixels").getPoolField();
|
final net.runelite.asm.pool.Field pixels = findDeobField("Rasterizer2D_pixels").getPoolField();
|
||||||
Method meth = findStaticMethod(methodName);
|
Method meth = findStaticMethod(methodName);
|
||||||
Instructions ins = meth.getCode().getInstructions();
|
if (meth == null)
|
||||||
|
{
|
||||||
|
throw new InjectionException(methodName + " couldnt be found");
|
||||||
|
}
|
||||||
|
|
||||||
|
Code code = meth.getCode();
|
||||||
|
Instructions ins = code.getInstructions();
|
||||||
int added = 0;
|
int added = 0;
|
||||||
|
|
||||||
List<Integer> indices = new ArrayList<>();
|
List<Integer> indices = new ArrayList<>();
|
||||||
for (Instruction i : ins.getInstructions())
|
for (Instruction i : ins.getInstructions())
|
||||||
{
|
{
|
||||||
if (!(i instanceof IALoad) && !(i instanceof GetField))
|
if (!(i instanceof IALoad) && !(i instanceof GetField) && !(i instanceof ALoad))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -155,10 +171,15 @@ public class RasterizerHook
|
|||||||
{
|
{
|
||||||
indices.add(ins.getInstructions().indexOf(i));
|
indices.add(ins.getInstructions().indexOf(i));
|
||||||
}
|
}
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
else if ((i instanceof ALoad) && varIndex >= 0 && ((LVTInstruction) i).getVariableIndex() == varIndex)
|
||||||
indices.add(ins.getInstructions().indexOf(i));
|
{
|
||||||
|
indices.add(ins.getInstructions().indexOf(i));
|
||||||
|
}
|
||||||
|
else if (varIndex == -1)
|
||||||
|
{
|
||||||
|
indices.add(ins.getInstructions().indexOf(i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (indices.isEmpty())
|
if (indices.isEmpty())
|
||||||
@@ -273,7 +294,7 @@ public class RasterizerHook
|
|||||||
Instructions ins = i.getInstructions();
|
Instructions ins = i.getInstructions();
|
||||||
Code code = ins.getCode();
|
Code code = ins.getCode();
|
||||||
Method method = code.getMethod();
|
Method method = code.getMethod();
|
||||||
logger.debug(i.toString());
|
//logger.debug(i.toString());
|
||||||
|
|
||||||
if (!(i instanceof IAStore))
|
if (!(i instanceof IAStore))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ public final class Sprite extends Rasterizer2D {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(var7 > 0 && var6 > 0) {
|
if(var7 > 0 && var6 > 0) {
|
||||||
method6070(Rasterizer2D.Rasterizer2D_pixels, this.pixels, 0, var5, var4, var7, var6, var8, var9, var3);
|
Sprite_alpha1(Rasterizer2D.Rasterizer2D_pixels, this.pixels, 0, var5, var4, var7, var6, var8, var9, var3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,7 +538,7 @@ public final class Sprite extends Rasterizer2D {
|
|||||||
var15 += var16;
|
var15 += var16;
|
||||||
}
|
}
|
||||||
|
|
||||||
method6072(Rasterizer2D.Rasterizer2D_pixels, this.pixels, 0, var8, var9, var14, var15, var3, var4, var12, var13, var6, var5);
|
Sprite_alpha2(Rasterizer2D.Rasterizer2D_pixels, this.pixels, 0, var8, var9, var14, var15, var3, var4, var12, var13, var6, var5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1515,7 +1515,8 @@ public final class Sprite extends Rasterizer2D {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ObfuscatedName("b")
|
@ObfuscatedName("b")
|
||||||
static void method6070(int[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9) {
|
@Export("Sprite_alpha1")
|
||||||
|
static void Sprite_alpha1(int[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9) {
|
||||||
int var10 = 256 - var9;
|
int var10 = 256 - var9;
|
||||||
|
|
||||||
for(int var11 = -var6; var11 < 0; ++var11) {
|
for(int var11 = -var6; var11 < 0; ++var11) {
|
||||||
@@ -1536,7 +1537,8 @@ public final class Sprite extends Rasterizer2D {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ObfuscatedName("p")
|
@ObfuscatedName("p")
|
||||||
static void method6072(int[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12) {
|
@Export("Sprite_alpha2")
|
||||||
|
static void Sprite_alpha2(int[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12) {
|
||||||
int var13 = 256 - var12;
|
int var13 = 256 - var12;
|
||||||
int var14 = var3;
|
int var14 = var3;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user