mirror of
https://github.com/sirjonasxx/G-Wasm.git
synced 2024-11-23 00:40:51 +01:00
test
This commit is contained in:
parent
573e5af2e2
commit
dc8a93518f
@ -13,7 +13,7 @@ public class Main {
|
|||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException, InvalidOpCodeException {
|
public static void main(String[] args) throws IOException, InvalidOpCodeException {
|
||||||
File unityWasmCode = new File("C:\\Users\\jonas\\Desktop\\Projects\\Jznnp\\S\\habbo2020\\rawfiles\\habbo2020-global-prod.wasm.code.unityweb");
|
File unityWasmCode = new File("C:\\Users\\jonas\\Desktop\\Projects\\Jznnp\\S\\habbo2020\\rawfiles\\0.5.2_(1)\\habbo2020-global-prod.wasm.code.unityweb");
|
||||||
InputStream targetStream = new FileInputStream(unityWasmCode);
|
InputStream targetStream = new FileInputStream(unityWasmCode);
|
||||||
BufferedInputStream in = new BufferedInputStream(targetStream);
|
BufferedInputStream in = new BufferedInputStream(targetStream);
|
||||||
|
|
||||||
@ -21,8 +21,15 @@ public class Main {
|
|||||||
Module module = new Module(in);
|
Module module = new Module(in);
|
||||||
long time_after = System.currentTimeMillis();
|
long time_after = System.currentTimeMillis();
|
||||||
|
|
||||||
System.out.println(String.format("%d", time_after - time_before));
|
System.out.println(String.format("disassemble time: %d", time_after - time_before));
|
||||||
System.out.println("test");
|
|
||||||
|
|
||||||
|
|
||||||
|
FileOutputStream habAssembled = new FileOutputStream("C:\\Users\\jonas\\Desktop\\Projects\\Jznnp\\S\\habbo2020\\rawfiles\\0.5.2_(1)\\out\\GWASM-global-prod.wasm.code.unityweb");
|
||||||
|
|
||||||
|
time_before = System.currentTimeMillis();
|
||||||
|
module.assemble(habAssembled);
|
||||||
|
time_after = System.currentTimeMillis();
|
||||||
|
|
||||||
|
System.out.println(String.format("assemble time: %d", time_after - time_before));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,15 +124,28 @@ public class Module extends WASMOpCode {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void assemble(OutputStream out) throws IOException, InvalidOpCodeException {
|
public void assemble(OutputStream out) throws IOException, InvalidOpCodeException {
|
||||||
Section[] sections = new Section[]{typeSection, importSection, functionSection, tableSection,
|
// Section[] sections = new Section[]{typeSection, importSection, functionSection, tableSection,
|
||||||
memorySection, globalSection, exportSection, startSection, elementSection, codeSection,
|
// memorySection, globalSection, exportSection, startSection, elementSection, codeSection,
|
||||||
|
// dataSection};
|
||||||
|
//
|
||||||
|
// for (int i = 0; i < 11; i++) {
|
||||||
|
// assembleCustomSections(out, i);
|
||||||
|
// sections[i].assemble(out);
|
||||||
|
// }
|
||||||
|
// assembleCustomSections(out, 11);
|
||||||
|
|
||||||
|
magic.assemble(out);
|
||||||
|
version.assemble(out);
|
||||||
|
|
||||||
|
Section[] sections = new Section[]{typeSection, importSection, functionSection, globalSection, exportSection,
|
||||||
|
elementSection, codeSection,
|
||||||
dataSection};
|
dataSection};
|
||||||
|
|
||||||
for (int i = 0; i < 12; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
assembleCustomSections(out, i);
|
assembleCustomSections(out, i);
|
||||||
sections[i].assemble(out);
|
sections[i].assemble(out);
|
||||||
}
|
}
|
||||||
assembleCustomSections(out, 11);
|
assembleCustomSections(out, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assembleCustomSections(OutputStream out, int location) throws IOException, InvalidOpCodeException {
|
private void assembleCustomSections(OutputStream out, int location) throws IOException, InvalidOpCodeException {
|
||||||
|
Loading…
Reference in New Issue
Block a user