mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2025-02-17 03:32:36 +01:00
updated for gwasm minimal 1.0.1
This commit is contained in:
parent
c2fcee21b9
commit
d9d1785a33
@ -232,7 +232,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>G-Earth</groupId>
|
<groupId>G-Earth</groupId>
|
||||||
<artifactId>G-Wasm</artifactId>
|
<artifactId>G-Wasm</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -7,7 +7,6 @@ import wasm.disassembly.modules.sections.code.Locals;
|
|||||||
import wasm.disassembly.types.FuncType;
|
import wasm.disassembly.types.FuncType;
|
||||||
import wasm.disassembly.types.ResultType;
|
import wasm.disassembly.types.ResultType;
|
||||||
import wasm.disassembly.types.ValType;
|
import wasm.disassembly.types.ValType;
|
||||||
import wasm.misc.CodeCompare;
|
|
||||||
import wasm.misc.StreamReplacement;
|
import wasm.misc.StreamReplacement;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -38,8 +37,7 @@ public class IncomingPacketPatcher implements StreamReplacement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CodeCompare getCodeCompare() {
|
public boolean codeMatches(Func code) {
|
||||||
return code -> {
|
|
||||||
if (!(code.getLocalss().equals(Collections.singletonList(new Locals(1, ValType.I32)))))
|
if (!(code.getLocalss().equals(Collections.singletonList(new Locals(1, ValType.I32)))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -55,6 +53,7 @@ public class IncomingPacketPatcher implements StreamReplacement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import wasm.disassembly.modules.sections.code.Func;
|
|||||||
import wasm.disassembly.types.FuncType;
|
import wasm.disassembly.types.FuncType;
|
||||||
import wasm.disassembly.types.ResultType;
|
import wasm.disassembly.types.ResultType;
|
||||||
import wasm.disassembly.types.ValType;
|
import wasm.disassembly.types.ValType;
|
||||||
import wasm.misc.CodeCompare;
|
|
||||||
import wasm.misc.StreamReplacement;
|
import wasm.misc.StreamReplacement;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -36,8 +35,7 @@ public class OutgoingPacketPatcher implements StreamReplacement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CodeCompare getCodeCompare() {
|
public boolean codeMatches(Func code) {
|
||||||
return code -> {
|
|
||||||
if (code.getLocalss().size() != 0) return false;
|
if (code.getLocalss().size() != 0) return false;
|
||||||
List<Instr> expression = code.getExpression().getInstructions();
|
List<Instr> expression = code.getExpression().getInstructions();
|
||||||
if (expression.get(0).getInstrType() != InstrType.LOCAL_GET) return false;
|
if (expression.get(0).getInstrType() != InstrType.LOCAL_GET) return false;
|
||||||
@ -48,6 +46,5 @@ public class OutgoingPacketPatcher implements StreamReplacement {
|
|||||||
if (expression.get(5).getInstrType() != InstrType.CALL) return false;
|
if (expression.get(5).getInstrType() != InstrType.CALL) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import wasm.disassembly.modules.sections.code.Func;
|
|||||||
import wasm.disassembly.types.FuncType;
|
import wasm.disassembly.types.FuncType;
|
||||||
import wasm.disassembly.types.ResultType;
|
import wasm.disassembly.types.ResultType;
|
||||||
import wasm.disassembly.types.ValType;
|
import wasm.disassembly.types.ValType;
|
||||||
import wasm.misc.CodeCompare;
|
|
||||||
import wasm.misc.StreamReplacement;
|
import wasm.misc.StreamReplacement;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -36,13 +35,11 @@ public class ReturnBytePatcher implements StreamReplacement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CodeCompare getCodeCompare() {
|
public boolean codeMatches(Func code) {
|
||||||
return code -> {
|
|
||||||
if (code.getLocalss().size() != 0) return false;
|
if (code.getLocalss().size() != 0) return false;
|
||||||
if (code.getExpression().getInstructions().size() != 30) return false;
|
if (code.getExpression().getInstructions().size() != 30) return false;
|
||||||
List<Instr> expr = code.getExpression().getInstructions();
|
List<Instr> expr = code.getExpression().getInstructions();
|
||||||
if (expr.get(expr.size() - 1).getInstrType() != InstrType.I32_XOR) return false;
|
if (expr.get(expr.size() - 1).getInstrType() != InstrType.I32_XOR) return false;
|
||||||
return true;
|
return true;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import wasm.disassembly.modules.sections.code.Locals;
|
|||||||
import wasm.disassembly.types.FuncType;
|
import wasm.disassembly.types.FuncType;
|
||||||
import wasm.disassembly.types.ResultType;
|
import wasm.disassembly.types.ResultType;
|
||||||
import wasm.disassembly.types.ValType;
|
import wasm.disassembly.types.ValType;
|
||||||
import wasm.misc.CodeCompare;
|
|
||||||
import wasm.misc.StreamReplacement;
|
import wasm.misc.StreamReplacement;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -38,8 +37,7 @@ public class SetKeyPatcher implements StreamReplacement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CodeCompare getCodeCompare() {
|
public boolean codeMatches(Func code) {
|
||||||
return code -> {
|
|
||||||
if (!(code.getLocalss().equals(Collections.singletonList(new Locals(1, ValType.I32)))))
|
if (!(code.getLocalss().equals(Collections.singletonList(new Locals(1, ValType.I32)))))
|
||||||
return false;
|
return false;
|
||||||
List<InstrType> expectedExpr = Arrays.asList(InstrType.I32_CONST, InstrType.I32_LOAD8_S,
|
List<InstrType> expectedExpr = Arrays.asList(InstrType.I32_CONST, InstrType.I32_LOAD8_S,
|
||||||
@ -55,6 +53,5 @@ public class SetKeyPatcher implements StreamReplacement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user