Various clean up.

This commit is contained in:
Andy Nguyen 2021-10-28 18:15:33 +02:00
parent 73f3c476ef
commit 0818b13b23
5 changed files with 18 additions and 16 deletions

View File

@ -1,4 +1,4 @@
SRC = \ CLASSES = \
com/bdjb/ExploitXlet.java \ com/bdjb/ExploitXlet.java \
com/bdjb/Exploit.java \ com/bdjb/Exploit.java \
com/bdjb/ExploitInterface.java \ com/bdjb/ExploitInterface.java \
@ -19,7 +19,7 @@ SRC = \
all: all:
javac com/bdjb/PayloadClassLoaderSerializer.java && java com/bdjb/PayloadClassLoaderSerializer javac com/bdjb/PayloadClassLoaderSerializer.java && java com/bdjb/PayloadClassLoaderSerializer
javac -source 1.4 -target 1.4 -bootclasspath "lib/rt.jar:lib/bdjstack.jar" $(SRC) javac -Xlint:all -Xlint:-options -source 1.4 -target 1.4 -bootclasspath "lib/rt.jar:lib/bdjstack.jar" $(CLASSES)
jar cf disc/BDMV/JAR/00000.jar com/bdjb/*.class com/bdjb/*.ser com/bdjb/bluray.ExploitXlet.perm jar cf disc/BDMV/JAR/00000.jar com/bdjb/*.class com/bdjb/*.ser com/bdjb/bluray.ExploitXlet.perm
java -cp "tools/security.jar:tools/bcprov-jdk15-137.jar:tools/tools.jar" net.java.bd.tools.security.BDSigner disc/BDMV/JAR/00000.jar java -cp "tools/security.jar:tools/bcprov-jdk15-137.jar:tools/tools.jar" net.java.bd.tools.security.BDSigner disc/BDMV/JAR/00000.jar
java -jar tools/bdjo.jar bdmv/bdjo.xml disc/BDMV/BDJO/00000.bdjo java -jar tools/bdjo.jar bdmv/bdjo.xml disc/BDMV/BDJO/00000.bdjo

View File

@ -20,11 +20,11 @@ public final class API {
public static final int INT32_SIZE = 4; public static final int INT32_SIZE = 4;
public static final int INT64_SIZE = 8; public static final int INT64_SIZE = 8;
public static final long RTLD_DEFAULT = -2; public static final int RTLD_DEFAULT = -2;
public static final long LIBC_MODULE_HANDLE = 0x2; public static final int LIBC_MODULE_HANDLE = 0x2;
public static final long LIBKERNEL_MODULE_HANDLE = 0x2001; public static final int LIBKERNEL_MODULE_HANDLE = 0x2001;
public static final long LIBJAVA_MODULE_HANDLE = 0x4A; public static final int LIBJAVA_MODULE_HANDLE = 0x4A;
private static final String UNSUPPORTED_DLOPEN_OPERATION_STRING = private static final String UNSUPPORTED_DLOPEN_OPERATION_STRING =
"Unsupported dlopen() operation"; "Unsupported dlopen() operation";
@ -356,7 +356,7 @@ public final class API {
} }
public long dlsym(long handle, String symbol) { public long dlsym(long handle, String symbol) {
int oldHandle = (int) RTLD_DEFAULT; int oldHandle = RTLD_DEFAULT;
try { try {
if (executableHandle != 0) { if (executableHandle != 0) {
// In earlier versions, there's a bug where only the main executable's handle is used. // In earlier versions, there's a bug where only the main executable's handle is used.

View File

@ -14,11 +14,6 @@ import java.io.RandomAccessFile;
* executable memory. * executable memory.
*/ */
public final class JIT { public final class JIT {
// 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;
public static final int PROT_NONE = 0x0; public static final int PROT_NONE = 0x0;
public static final int PROT_READ = 0x1; public static final int PROT_READ = 0x1;
public static final int PROT_WRITE = 0x2; public static final int PROT_WRITE = 0x2;
@ -31,6 +26,11 @@ public final class JIT {
public static final long MAP_FAILED = -1; public static final long MAP_FAILED = -1;
// 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; private static final int CHUNK_SIZE = 0x30;
private static final int SCE_KERNEL_MODULE_INFO_SIZE = 0x160; private static final int SCE_KERNEL_MODULE_INFO_SIZE = 0x160;
@ -166,12 +166,14 @@ public final class JIT {
long address = align(code, ALIGNMENT); long address = align(code, ALIGNMENT);
byte[] chunk = new byte[CHUNK_SIZE];
long request = api.malloc(COMPILER_AGENT_REQUEST_SIZE); long request = api.malloc(COMPILER_AGENT_REQUEST_SIZE);
long response = api.malloc(API.INT8_SIZE); long response = api.malloc(API.INT8_SIZE);
// Copy .text section. // Copy .text section.
for (long i = 0; i < dataSectionOffset; i += CHUNK_SIZE) { for (long i = 0; i < dataSectionOffset; i += CHUNK_SIZE) {
byte[] chunk = new byte[CHUNK_SIZE]; api.memset(chunk, 0, CHUNK_SIZE);
file.seek(i); file.seek(i);
file.read(chunk, 0, (int) Math.min(dataSectionOffset - i, CHUNK_SIZE)); file.read(chunk, 0, (int) Math.min(dataSectionOffset - i, CHUNK_SIZE));
@ -207,7 +209,7 @@ public final class JIT {
// Copy .data section. // Copy .data section.
for (long i = dataSectionOffset; i < file.length(); i += CHUNK_SIZE) { for (long i = dataSectionOffset; i < file.length(); i += CHUNK_SIZE) {
byte[] chunk = new byte[CHUNK_SIZE]; api.memset(chunk, 0, CHUNK_SIZE);
file.seek(dataSectionOffset); file.seek(dataSectionOffset);
int read = file.read(chunk, 0, (int) Math.min(file.length() - i, CHUNK_SIZE)); int read = file.read(chunk, 0, (int) Math.min(file.length() - i, CHUNK_SIZE));

View File

@ -10,13 +10,11 @@ package com.bdjb;
import com.oracle.ProviderAccessor; import com.oracle.ProviderAccessor;
import com.oracle.ProviderAdapter; import com.oracle.ProviderAdapter;
import com.oracle.security.Service; import com.oracle.security.Service;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set; import java.util.Set;
import java.security.Provider; import java.security.Provider;
import java.security.Security;
/** ProviderAccessor implementation that allows arbitrary services to be added. */ /** ProviderAccessor implementation that allows arbitrary services to be added. */
class ProviderAccessorImpl implements ProviderAccessor { class ProviderAccessorImpl implements ProviderAccessor {

View File

@ -14,6 +14,8 @@ import java.awt.Graphics;
import java.util.ArrayList; import java.util.ArrayList;
public class Screen extends Container { public class Screen extends Container {
private static final long serialVersionUID = 0x4141414141414141L;
private static final Font FONT = new Font(null, Font.PLAIN, 36); private static final Font FONT = new Font(null, Font.PLAIN, 36);
private static final ArrayList messages = new ArrayList(); private static final ArrayList messages = new ArrayList();