MCPcopy Create free account
hub / github.com/Hiro420/NikkeTools / file_to_function

Method file_to_function

UnLuac/src/unluac/Main.java:129–146  ·  view source on GitHub ↗
(String fn, Configuration config)

Source from the content-addressed store, hash-verified

127 }
128
129 private static LFunction file_to_function(String fn, Configuration config) throws IOException {
130 RandomAccessFile file = null;
131 try {
132 file = new RandomAccessFile(fn, "r");
133 ByteBuffer buffer = ByteBuffer.allocate((int) file.length());
134 buffer.order(ByteOrder.LITTLE_ENDIAN);
135 int len = (int) file.length();
136 FileChannel in = file.getChannel();
137 while(len > 0) len -= in.read(buffer);
138 buffer.rewind();
139 BHeader header = new BHeader(buffer, config);
140 return header.main;
141 } finally {
142 if(file != null) {
143 file.close();
144 }
145 }
146 }
147
148 public static void decompile(String in, String out, Configuration config) throws IOException {
149 LFunction lmain = file_to_function(in, config);

Callers 3

mainMethod · 0.95
decompileMethod · 0.95
disassembleMethod · 0.95

Calls 2

lengthMethod · 0.80
readMethod · 0.80

Tested by

no test coverage detected