ahhhhhhhhhhhhhhh

This commit is contained in:
Adam
2015-10-01 17:02:25 -04:00
parent d61d006b34
commit 164b5fd5af
3 changed files with 20 additions and 14 deletions

View File

@@ -84,7 +84,7 @@ public class Deob
//new ModArith().run(group);
new MultiplicationDeobfuscator().run(group); // this causes spinning?
new MultiplicationDeobfuscator().run(group);
// new MultiplyOneDeobfuscator().run(group);
//

View File

@@ -146,10 +146,16 @@ public class MultiplicationDeobfuscator implements Deobfuscator
MultiplicationExpression other = parseExpression(orig.getPushed());
// this expression is used elsewhere like 'pushConstant' so any changes
// done to it affect that, too. so multiply it by existing values?
me.instructions.addAll(other.instructions);
me.dupedInstructions.addAll(other.instructions);
me.subexpressions.addAll(other.subexpressions);
//me.subexpressions.add(other);
if (orig.getPushed().getInstruction() instanceof IAdd || orig.getPushed().getInstruction() instanceof ISub)
{
me.subexpressions.add(other);
}
else
{
me.instructions.addAll(other.instructions);
me.dupedInstructions.addAll(other.instructions);
me.subexpressions.addAll(other.subexpressions);
}
}
catch (IllegalStateException ex)
{

View File

@@ -62,15 +62,15 @@ public class MultiplicationExpression
count += me.simplify(result);
}
// if (dupmagic != null)
// {
// PushConstantInstruction pci = (PushConstantInstruction) dupmagic.getInstruction();
// int value = (int) pci.getConstant().getObject();
//
// value *= DMath.modInverse(result);
//
// pci.setConstant(new net.runelite.deob.pool.Integer(value));
// }
if (dupmagic != null)
{
PushConstantInstruction pci = (PushConstantInstruction) dupmagic.getInstruction();
int value = (int) pci.getConstant().getObject();
value *= DMath.modInverse(result);
pci.setConstant(new net.runelite.deob.pool.Integer(value));
}
result = 1; // constant has been distributed, outer numbers all go to 1
}