mirror of
https://github.com/TheOfficialFloW/bd-jb
synced 2024-11-22 00:42:21 -05:00
Make constants public as well.
This commit is contained in:
parent
6be7872c8b
commit
fd9d1ce342
@ -14,16 +14,16 @@ import java.lang.reflect.Method;
|
||||
|
||||
/** API class to access native data and execute native code. */
|
||||
public final class API {
|
||||
static final int INT8_SIZE = 1;
|
||||
static final int INT16_SIZE = 2;
|
||||
static final int INT32_SIZE = 4;
|
||||
static final int INT64_SIZE = 8;
|
||||
public static final int INT8_SIZE = 1;
|
||||
public static final int INT16_SIZE = 2;
|
||||
public static final int INT32_SIZE = 4;
|
||||
public static final int INT64_SIZE = 8;
|
||||
|
||||
static final long RTLD_DEFAULT = -2;
|
||||
public static final long RTLD_DEFAULT = -2;
|
||||
|
||||
static final long LIBC_MODULE_HANDLE = 0x2;
|
||||
static final long LIBKERNEL_MODULE_HANDLE = 0x2001;
|
||||
static final long LIBJAVA_MODULE_HANDLE = 0x4A;
|
||||
public static final long LIBC_MODULE_HANDLE = 0x2;
|
||||
public static final long LIBKERNEL_MODULE_HANDLE = 0x2001;
|
||||
public static final long LIBJAVA_MODULE_HANDLE = 0x4A;
|
||||
|
||||
private static final String UNSUPPORTED_DLOPEN_OPERATION_STRING =
|
||||
"Unsupported dlopen() operation";
|
||||
|
@ -14,11 +14,10 @@ import java.io.RandomAccessFile;
|
||||
* executable memory.
|
||||
*/
|
||||
public final class JIT {
|
||||
static final int BDJ_MODULE_HANDLE = 0;
|
||||
|
||||
static final int MAX_JIT_SIZE = 24 * 1024 * 1024; // Actually max is 30MB, but let's be safe.
|
||||
static final int PAGE_SIZE = 0x4000;
|
||||
static final int ALIGNMENT = 0x100000;
|
||||
// We actually have 32MB of code memory, but reserve 8MB for Java JIT.
|
||||
public static final int MAX_CODE_SIZE = 24 * 1024 * 1024;
|
||||
public static final int PAGE_SIZE = 0x4000;
|
||||
public static final int ALIGNMENT = 0x100000;
|
||||
|
||||
private static final int CHUNK_SIZE = 0x30;
|
||||
|
||||
@ -40,6 +39,8 @@ public final class JIT {
|
||||
private static final String WRITE_SYMBOL = "write";
|
||||
private static final String READ_SYMBOL = "read";
|
||||
|
||||
private static final int BDJ_MODULE_HANDLE = 0;
|
||||
|
||||
private static JIT instance;
|
||||
|
||||
private final API api;
|
||||
@ -116,9 +117,9 @@ public final class JIT {
|
||||
RandomAccessFile file = new RandomAccessFile(path, "r");
|
||||
|
||||
// TODO: Currently we just use maximum size so that the address is predictable.
|
||||
long size = MAX_JIT_SIZE;
|
||||
long size = MAX_CODE_SIZE;
|
||||
// long size = file.length() + 0x88 + ALIGNMENT - 1;
|
||||
// if (size >= MAX_JIT_SIZE) {
|
||||
// if (size >= MAX_CODE_SIZE) {
|
||||
// throw new IllegalArgumentException("Payload is too big.");
|
||||
// }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user