From 73f3c476effb9fcd6f09448c088bc1bbab24cdaf Mon Sep 17 00:00:00 2001 From: Andy Nguyen Date: Wed, 27 Oct 2021 21:15:40 +0200 Subject: [PATCH] Use file length as the address is already predictable. --- com/bdjb/JIT.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/com/bdjb/JIT.java b/com/bdjb/JIT.java index c45acbd..7119098 100644 --- a/com/bdjb/JIT.java +++ b/com/bdjb/JIT.java @@ -149,9 +149,7 @@ public final class JIT { throw new IllegalArgumentException("Invalid data section offset."); } - // TODO: Currently we hardcode the size so that the address is predictable. - long size = 1 * 1024 * 1024; - // long size = file.length() + 0x88 + ALIGNMENT - 1; + long size = file.length() + 0x88 + ALIGNMENT - 1; if (size >= MAX_CODE_SIZE) { throw new IllegalArgumentException("Payload is too big."); }