Cosmetic updates
continuous-integration/drone Build is passing Details

master
Dmitry Isaenko 2022-10-01 03:05:35 +03:00
parent 74d9bf270a
commit 4ce10480b0
13 changed files with 654 additions and 1496 deletions

30
.drone.yml Normal file
View File

@ -0,0 +1,30 @@
kind: pipeline
type: docker
name: default
steps:
- name: build
image: maven:3-jdk-11
commands:
- mvn -B -DskipTests clean install
- mvn test -B
volumes:
- name: m2
path: /root/.m2
- name: archive-artifact
image: alpine:latest
commands:
- mkdir -p /builds/ESRPatchJava
- cp target/ESRPatchJava-*[0-9].jar /builds/ESRPatchJava/
volumes:
- name: builds
path: /builds
volumes:
- name: m2
host:
path: /home/docker/drone/files/m2
- name: builds
host:
path: /home/www/builds

View File

7
README.md Normal file
View File

@ -0,0 +1,7 @@
### ESRPatchJava
I don't know who is author(s), check code, maybe you'll find out.
History of changes you can track on git logs. Updated for using with Java 8+, added CI, Maven etc.
Taken from https://sksapps.haldrie.com/ps2exploit.php

47
pom.xml Normal file
View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>undefined</groupId>
<artifactId>ESRPatchJava</artifactId>
<version>0.2.3a</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyyMMdd.HHmmss</maven.build.timestamp.format>
</properties>
<build>
<finalName>${project.artifactId}-${project.version}-${maven.build.timestamp}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources-filtered</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>esrpatchjava.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -1,178 +0,0 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;
import java.util.*;
public class Main extends JFrame implements ActionListener, DropTargetListener {
private JLabel lblUsage, lblInfo1, lblInfo2;
private JButton btnPatch, btnUnpatch, btnQuit;
private JPanel pnlButtons;
public Main() {
super("ESRPatchJava v0.2.3");
Container container = getContentPane();
container.setLayout(new GridLayout(5, 1));
btnPatch = new JButton("Patch ISO...");
btnPatch.setMnemonic('P');
btnPatch.addActionListener(this);
btnUnpatch = new JButton("Unpatch ISO...");
btnUnpatch.setMnemonic('U');
btnUnpatch.addActionListener(this);
pnlButtons = new JPanel(new GridLayout(1, 2));
pnlButtons.add(btnPatch);
pnlButtons.add(btnUnpatch);
lblUsage = new JLabel("Select button below or drag and drop files here:", JLabel.LEFT);
lblInfo1 = new JLabel("(C)06/2008 - bootsector - http://www.brunofreitas.com/", JLabel.CENTER);
lblInfo2 = new JLabel("ESR Project by ffgriever", JLabel.CENTER);
btnQuit = new JButton("Close");
btnQuit.setMnemonic('C');
btnQuit.addActionListener(this);
container.add(lblUsage);
container.add(pnlButtons);
container.add(lblInfo1);
container.add(lblInfo2);
container.add(btnQuit);
setSize(450, 150);
setResizable(false);
centerFrameOnScreen(this);
new DropTarget(getContentPane(), this);
setVisible(true);
}
public static void main(String args[]) {
Main app = new Main();
app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
private void centerFrameOnScreen(JFrame frame) {
Dimension d=Toolkit.getDefaultToolkit().getScreenSize();
Dimension f=frame.getSize();
frame.setBounds(Math.max(0, (d.width - f.width) / 2),
Math.max(0, (d.height - f.height) / 2),
f.width, f.height);
}
public void actionPerformed(ActionEvent e) {
JFileChooser fc = new JFileChooser();
fc.setFileFilter(new ISOFileFilter());
if (e.getSource() == btnQuit)
System.exit(0);
if (e.getSource() == btnPatch) {
if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
switch(ESRPatch.apply(fc.getSelectedFile().getAbsolutePath())) {
case ESRPatch.ALREADY_PATCHED: JOptionPane.showMessageDialog(this, "ISO is already patched!", "Attention", JOptionPane.INFORMATION_MESSAGE); break;
case ESRPatch.ERROR_PATCHING: JOptionPane.showMessageDialog(this, "Error trying to patch ISO!", "Error", JOptionPane.ERROR_MESSAGE); break;
case ESRPatch.PATCH_OK: JOptionPane.showMessageDialog(this, "ISO patched successfully! :)", "Ok!", JOptionPane.INFORMATION_MESSAGE); break;
case ESRPatch.NOT_UDF_ISO: JOptionPane.showMessageDialog(this, "ISO doesn't contain UDF descriptor!", "Error", JOptionPane.ERROR_MESSAGE); break;
}
}
}
if (e.getSource() == btnUnpatch) {
if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
switch(ESRPatch.unPatch(fc.getSelectedFile().getAbsolutePath())) {
case ESRPatch.NOT_PATCHED: JOptionPane.showMessageDialog(this, "ISO is not patched!", "Attention", JOptionPane.INFORMATION_MESSAGE); break;
case ESRPatch.ERROR_PATCHING: JOptionPane.showMessageDialog(this, "Error trying to patch ISO!", "Error", JOptionPane.ERROR_MESSAGE); break;
case ESRPatch.PATCH_OK: JOptionPane.showMessageDialog(this, "ISO unpatched successfully! :)", "Ok!", JOptionPane.INFORMATION_MESSAGE); break;
case ESRPatch.NOT_UDF_ISO: JOptionPane.showMessageDialog(this, "ISO doesn't contain UDF descriptor!", "Error", JOptionPane.ERROR_MESSAGE); break;
}
}
}
}
public void dragEnter(DropTargetDragEvent dtde) {
// System.out.println("Drag Enter");
}
public void dragExit(DropTargetEvent dte) {
// System.out.println("Drag Exit");
}
public void dragOver(DropTargetDragEvent dtde) {
// System.out.println("Drag Over");
}
public void dropActionChanged(DropTargetDragEvent dtde) {
// System.out.println("Drop Action Changed");
}
public void drop(DropTargetDropEvent dtde) {
try {
dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
Transferable tr = dtde.getTransferable();
DataFlavor[] flavors = tr.getTransferDataFlavors();
for (int i = 0; i < flavors.length; i++) {
if (flavors[i].isFlavorJavaFileListType()) {
//dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
java.util.List list = (java.util.List) tr.getTransferData(flavors[i]);
ArrayList<Object> filesList = new ArrayList<Object>();
for (int j = 0; j < list.size(); j++) {
filesList.add(list.get(j));
}
//Custom button text
Object[] options = {"Patch",
"Unpatch"};
int opt = JOptionPane.showOptionDialog(this,
"What would you like to do?",
"What to do?",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
options,
options[0]);
if(opt == JOptionPane.YES_OPTION)
ESRPatch.apply(filesList, this);
else
ESRPatch.unPatch(filesList, this);
dtde.dropComplete(true);
return;
}
//System.out.println("Drop failed: " + dtde);
dtde.rejectDrop();
}
}catch (Exception e) {
e.printStackTrace();
dtde.rejectDrop();
}
}
}

View File

@ -1,4 +1,4 @@
/* /*
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package esrpatchjava;
public class CRC { public class CRC {
static int[] CRC16_Lookup = { static int[] CRC16_Lookup = {
@ -51,12 +51,10 @@ public class CRC {
}; };
public static int CRC16CCITT(byte[] data) { public static int CRC16CCITT(byte[] data) {
int crc16 = 0; int crc16 = 0;
for(int i= 0, n= data.length; i < n; i++ ) for (byte datum : data) {
{ int t = (crc16 >> 8) ^ ((int) datum & 0xFF);
int t = (crc16 >> 8) ^ ((int)data[i] & 0xFF);
crc16 = ((crc16 << 8) & 0xffff) ^ CRC16_Lookup[t]; crc16 = ((crc16 << 8) & 0xffff) ^ CRC16_Lookup[t];
} }

View File

@ -0,0 +1,301 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package esrpatchjava;
import java.io.*;
import java.nio.Buffer;
import java.nio.ByteBuffer;
public class DVDV {
static {
{
ByteBuffer byteBuffer = ByteBuffer.allocate(0x6000);
byteBuffer.put(new byte[]{
(byte)0x00, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0x60, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xD5, (byte)0x97, (byte)0xF0, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x0F, (byte)0x1A, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x03, (byte)0x00, (byte)0x03, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x4F, (byte)0x53, (byte)0x54, (byte)0x41, (byte)0x20, (byte)0x43, (byte)0x6F, (byte)0x6D, (byte)0x70, (byte)0x72, (byte)0x65, (byte)0x73, (byte)0x73, (byte)0x65, (byte)0x64,
(byte)0x20, (byte)0x55, (byte)0x6E, (byte)0x69, (byte)0x63, (byte)0x6F, (byte)0x64, (byte)0x65
});
((Buffer) byteBuffer).position(112);
byteBuffer.put(new byte[]{0x08, 0x44, 0x56, 0x44, 0x56, 0x49, 0x44, 0x45, 0x4F});
((Buffer) byteBuffer).position(239);
byteBuffer.put(new byte[]{
0x09, 0x00, 0x4F, 0x53, 0x54, 0x41, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65,
0x64, 0x20, 0x55, 0x6E, 0x69, 0x63, 0x6F, 0x64, 0x65
});
((Buffer) byteBuffer).position(304);
byteBuffer.put(new byte[]{
0x08, 0x44, 0x56, 0x44, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09
});
((Buffer) byteBuffer).position(400);
byteBuffer.put(new byte[]{
0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x2A, 0x4F, 0x53, 0x54, 0x41, 0x20, 0x55, 0x44, 0x46, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x6C,
0x69, 0x61, 0x6E, 0x74, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x03
});
((Buffer) byteBuffer).position(2048);
byteBuffer.put(new byte[]{
(byte)0x08, (byte)0x00, (byte)0x02, (byte)0x00, (byte)0xFC, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xF0, (byte)0x01, (byte)0x01
});
((Buffer) byteBuffer).position(4096);
byteBuffer.put(new byte[]{
(byte)0x05, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0x5F, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x80, (byte)0xA8, (byte)0x2C, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x30, (byte)0x02, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xA5, (byte)0x14, (byte)0x00, (byte)0x00,
(byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x88, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x0F, (byte)0x1A,
(byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x0F, (byte)0x1A, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x0F, (byte)0x1A, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01
});
((Buffer) byteBuffer).position(4224);
byteBuffer.put(new byte[]{
0x00, 0x2A, 0x41, 0x48, 0x45, 0x41, 0x44, 0x20, 0x4E, 0x65, 0x72, 0x6F
});
((Buffer) byteBuffer).position(4264);
byteBuffer.put(new byte[]{
(byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x06, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xEE, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xA7, (byte)0x34, (byte)0x08, (byte)0x00, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x18, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x34, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44, (byte)0x46, (byte)0x20, (byte)0x46, (byte)0x72,
(byte)0x65, (byte)0x65, (byte)0x45, (byte)0x41, (byte)0x53, (byte)0x70, (byte)0x61, (byte)0x63, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x61, (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x38, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44,
(byte)0x46, (byte)0x20, (byte)0x44, (byte)0x56, (byte)0x44, (byte)0x20, (byte)0x43, (byte)0x47, (byte)0x4D, (byte)0x53, (byte)0x20, (byte)0x49, (byte)0x6E, (byte)0x66, (byte)0x6F, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x49, (byte)0x05, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x88, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x03
});
((Buffer) byteBuffer).position(6144);
byteBuffer.put(new byte[]{
(byte)0x01, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xC8, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x47, (byte)0x62, (byte)0x18, (byte)0x00, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x0A, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xAD, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0xD5, (byte)0xB1, (byte)0x20, (byte)0x00, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x02, (byte)0x09, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00,
(byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x56,
(byte)0x49, (byte)0x44, (byte)0x45, (byte)0x4F, (byte)0x5F, (byte)0x54, (byte)0x53, (byte)0x00, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xCD, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x63, (byte)0x43, (byte)0x20, (byte)0x00, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x02, (byte)0x09, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00,
(byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x41,
(byte)0x55, (byte)0x44, (byte)0x49, (byte)0x4F, (byte)0x5F, (byte)0x54, (byte)0x53
});
((Buffer) byteBuffer).position(8192);
byteBuffer.put(new byte[]{
(byte)0x05, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0x9D, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xA5, (byte)0xBF, (byte)0x2C, (byte)0x01, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x30, (byte)0x02, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xA5, (byte)0x14, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x90, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x17,
(byte)0x35, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x17, (byte)0x35, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x17, (byte)0x35, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01
});
((Buffer) byteBuffer).position(8320);
byteBuffer.put(new byte[]{
0x00, 0x2A, 0x41, 0x48, 0x45, 0x41, 0x44, 0x20, 0x4E, 0x65, 0x72, 0x6F
});
((Buffer) byteBuffer).position(8352);
byteBuffer.put(new byte[]{
(byte)0x17, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x06, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xF0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xA7, (byte)0x34, (byte)0x08, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x18, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x34, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44, (byte)0x46, (byte)0x20, (byte)0x46, (byte)0x72,
(byte)0x65, (byte)0x65, (byte)0x45, (byte)0x41, (byte)0x53, (byte)0x70, (byte)0x61, (byte)0x63, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x61, (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x38, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44,
(byte)0x46, (byte)0x20, (byte)0x44, (byte)0x56, (byte)0x44, (byte)0x20, (byte)0x43, (byte)0x47, (byte)0x4D, (byte)0x53, (byte)0x20, (byte)0x49, (byte)0x6E, (byte)0x66, (byte)0x6F, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x49, (byte)0x05, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x90, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x06
});
((Buffer) byteBuffer).position(10240);
byteBuffer.put(new byte[]{
(byte)0x05, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0x1A, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xA6, (byte)0x3A, (byte)0x2C, (byte)0x01, (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x30, (byte)0x02, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xA5, (byte)0x14, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x28, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x17,
(byte)0x35, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x17, (byte)0x35, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x17, (byte)0x35, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01
});
((Buffer) byteBuffer).position(10368);
byteBuffer.put(new byte[]{
0x00, 0x2A, 0x41, 0x48, 0x45, 0x41, 0x44, 0x20, 0x4E, 0x65, 0x72, 0x6F
});
((Buffer) byteBuffer).position(10400);
byteBuffer.put(new byte[]{
(byte)0x1A, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x06, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xF1, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xA7, (byte)0x34, (byte)0x08, (byte)0x00, (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x18, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x34, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44, (byte)0x46, (byte)0x20, (byte)0x46, (byte)0x72,
(byte)0x65, (byte)0x65, (byte)0x45, (byte)0x41, (byte)0x53, (byte)0x70, (byte)0x61, (byte)0x63, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x61, (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x38, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44,
(byte)0x46, (byte)0x20, (byte)0x44, (byte)0x56, (byte)0x44, (byte)0x20, (byte)0x43, (byte)0x47, (byte)0x4D, (byte)0x53, (byte)0x20, (byte)0x49, (byte)0x6E, (byte)0x66, (byte)0x6F, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x49, (byte)0x05, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x28, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09
});
((Buffer) byteBuffer).position(12288);
byteBuffer.put(new byte[]{
(byte)0x01, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xCB, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x47, (byte)0x62, (byte)0x18, (byte)0x00, (byte)0x06, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x0A, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xCD, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0xEC, (byte)0xB3, (byte)0x24, (byte)0x00, (byte)0x06, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x0D, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00,
(byte)0x07, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x56,
(byte)0x49, (byte)0x44, (byte)0x45, (byte)0x4F, (byte)0x5F, (byte)0x54, (byte)0x53, (byte)0x2E, (byte)0x49, (byte)0x46, (byte)0x4F, (byte)0x00, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x00,
(byte)0x7D, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xE0, (byte)0x6F, (byte)0x24, (byte)0x00, (byte)0x06, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x0D,
(byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x08, (byte)0x56, (byte)0x49, (byte)0x44, (byte)0x45, (byte)0x4F, (byte)0x5F, (byte)0x54, (byte)0x53, (byte)0x2E, (byte)0x42, (byte)0x55, (byte)0x50
});
((Buffer) byteBuffer).position(14336);
byteBuffer.put(new byte[]{
(byte)0x05, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0x66, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x68, (byte)0xC2, (byte)0x2C, (byte)0x01, (byte)0x07, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x30, (byte)0x02, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xA5, (byte)0x14, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xF0, (byte)0x07, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x19,
(byte)0x0E, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x19, (byte)0x0E, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x19, (byte)0x0E, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01
});
((Buffer) byteBuffer).position(14464);
byteBuffer.put(new byte[]{
0x00, 0x2A, 0x41, 0x48, 0x45, 0x41, 0x44, 0x20, 0x4E, 0x65, 0x72, 0x6F
});
((Buffer) byteBuffer).position(14496);
byteBuffer.put(new byte[]{
(byte)0x18, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x06, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xF3, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xA7, (byte)0x34, (byte)0x08, (byte)0x00, (byte)0x07, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x18, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x34, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44, (byte)0x46, (byte)0x20, (byte)0x46, (byte)0x72,
(byte)0x65, (byte)0x65, (byte)0x45, (byte)0x41, (byte)0x53, (byte)0x70, (byte)0x61, (byte)0x63, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x61, (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x38, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44,
(byte)0x46, (byte)0x20, (byte)0x44, (byte)0x56, (byte)0x44, (byte)0x20, (byte)0x43, (byte)0x47, (byte)0x4D, (byte)0x53, (byte)0x20, (byte)0x49, (byte)0x6E, (byte)0x66, (byte)0x6F, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x49, (byte)0x05, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xF0, (byte)0x07, (byte)0x00, (byte)0x00, (byte)0x0A
});
((Buffer) byteBuffer).position(16384);
byteBuffer.put(new byte[]{
(byte)0x05, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0x0E, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x53, (byte)0x7E, (byte)0x2C, (byte)0x01, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x30, (byte)0x02, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xA5, (byte)0x14, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xF0, (byte)0x07, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x19,
(byte)0x17, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x19, (byte)0x17, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x78, (byte)0x10, (byte)0xD5, (byte)0x07, (byte)0x08, (byte)0x1C, (byte)0x11, (byte)0x19, (byte)0x17, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01
});
((Buffer) byteBuffer).position(16512);
byteBuffer.put(new byte[]{
0x00, 0x2A, 0x41, 0x48, 0x45, 0x41, 0x44, 0x20, 0x4E, 0x65, 0x72, 0x6F
});
((Buffer) byteBuffer).position(16544);
byteBuffer.put(new byte[]{
(byte)0x19, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x06, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xF4, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xA7, (byte)0x34, (byte)0x08, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x18, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x84, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x34, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44, (byte)0x46, (byte)0x20, (byte)0x46, (byte)0x72,
(byte)0x65, (byte)0x65, (byte)0x45, (byte)0x41, (byte)0x53, (byte)0x70, (byte)0x61, (byte)0x63, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x61, (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x38, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2A, (byte)0x55, (byte)0x44,
(byte)0x46, (byte)0x20, (byte)0x44, (byte)0x56, (byte)0x44, (byte)0x20, (byte)0x43, (byte)0x47, (byte)0x4D, (byte)0x53, (byte)0x20, (byte)0x49, (byte)0x6E, (byte)0x66, (byte)0x6F, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x49, (byte)0x05, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xF0, (byte)0x07, (byte)0x00, (byte)0x00, (byte)0x0B
});
((Buffer) byteBuffer).position(18432);
byteBuffer.put(new byte[]{
(byte)0x01, (byte)0x01, (byte)0x02, (byte)0x00, (byte)0xCE, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x47, (byte)0x62, (byte)0x18, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x01, (byte)0x00, (byte)0x0A, (byte)0x00, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x02
});
((Buffer) byteBuffer).position(20480);
byteBuffer.put(new byte[]{
(byte)0x44, (byte)0x56, (byte)0x44, (byte)0x56, (byte)0x49, (byte)0x44, (byte)0x45, (byte)0x4F, (byte)0x2D, (byte)0x56, (byte)0x4D, (byte)0x47, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x74,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0A,
(byte)0x00, (byte)0x10, (byte)0x00, (byte)0xFE, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x01, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x06
});
((Buffer) byteBuffer).position(20610);
byteBuffer.put(new byte[]{
0x05, 0x03, 0x00, 0x00, 0x04
});
((Buffer) byteBuffer).position(20675);
byteBuffer.put(new byte[]{
0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0A
});
((Buffer) byteBuffer).position(20736);
byteBuffer.put((byte)0x43);
((Buffer) byteBuffer).position(20821);
byteBuffer.put((byte)0x01);
((Buffer) byteBuffer).position(21511);
byteBuffer.put(new byte[]{
(byte)0xC0, (byte)0x01, (byte)0x80
});
((Buffer) byteBuffer).position(21728);
byteBuffer.put(new byte[]{
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xEC, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x17, (byte)0x71, (byte)0x00, (byte)0x00, (byte)0x0F, (byte)0x00, (byte)0x63, (byte)0x00, (byte)0x00, (byte)0x30, (byte)0x06, (byte)0x00, (byte)0x02,
(byte)0x00, (byte)0xC0
});
((Buffer) byteBuffer).position(22528);
byteBuffer.put(new byte[]{
(byte)0x44, (byte)0x56, (byte)0x44, (byte)0x56, (byte)0x49, (byte)0x44, (byte)0x45, (byte)0x4F, (byte)0x2D, (byte)0x56, (byte)0x4D, (byte)0x47, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x74,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0A,
(byte)0x00, (byte)0x10, (byte)0x00, (byte)0xFE, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x01, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x06
});
((Buffer) byteBuffer).position(22658);
byteBuffer.put(new byte[]{
(byte)0x05, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x04
});
((Buffer) byteBuffer).position(22720);
byteBuffer.put(new byte[]{
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0B, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x06, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0A
});
((Buffer) byteBuffer).position(22784);
byteBuffer.put((byte)0x43);
((Buffer) byteBuffer).position(22869);
byteBuffer.put((byte)0x01);
((Buffer) byteBuffer).position(23559);
byteBuffer.put(new byte[]{(byte)0xC0, (byte)0x01, (byte)0x80});
((Buffer) byteBuffer).position(23781);
byteBuffer.put(new byte[]{
(byte)0xEC, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x17, (byte)0x71,
(byte)0x00, (byte)0x00, (byte)0x0F, (byte)0x00, (byte)0x63, (byte)0x00, (byte)0x00, (byte)0x30, (byte)0x06, (byte)0x00, (byte)0x02, (byte)0x00, (byte)0xC0
});
((Buffer) byteBuffer).flip();
dvdvdata = byteBuffer.array();
}
}
private static final byte[] dvdvdata;
public static void write(RandomAccessFile iso) throws IOException {
iso.seek(128 * ESRPatch.LBA_SIZE);
iso.write(dvdvdata);
}
}

View File

@ -1,4 +1,4 @@
/* /*
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
@ -12,8 +12,10 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package esrpatchjava;
import java.io.*; import java.io.*;
import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.swing.*; import javax.swing.*;
@ -28,7 +30,7 @@ public class ESRPatch {
public static final int NOT_PATCHED = 4; public static final int NOT_PATCHED = 4;
private static RandomAccessFile iso; private static RandomAccessFile iso;
private static byte[] buffer = new byte[LBA_SIZE]; private static final byte[] buffer = new byte[LBA_SIZE];
public static int apply(String fileName) { public static int apply(String fileName) {
byte[] b; byte[] b;
@ -37,7 +39,7 @@ public class ESRPatch {
try { try {
iso = new RandomAccessFile(fileName, "rw"); iso = new RandomAccessFile(fileName, "rw");
// Checks if image is an UDF ISO // Checks if image is a UDF ISO
if(!isUDFISO()) { if(!isUDFISO()) {
iso.close(); iso.close();
return NOT_UDF_ISO; return NOT_UDF_ISO;
@ -75,9 +77,7 @@ public class ESRPatch {
desc_crc_len = (((int)buffer[11] & 0xFF) << 8 & 0xFF00)+ ((int) buffer[10] & 0xFF); desc_crc_len = (((int)buffer[11] & 0xFF) << 8 & 0xFF00)+ ((int) buffer[10] & 0xFF);
b = new byte[desc_crc_len]; b = new byte[desc_crc_len];
for(int i = 0; i < desc_crc_len; i++) { System.arraycopy(buffer, 16, b, 0, desc_crc_len);
b[i] = buffer[i + 16];
}
desc_crc = CRC.CRC16CCITT(b); desc_crc = CRC.CRC16CCITT(b);
@ -110,9 +110,7 @@ public class ESRPatch {
desc_crc_len = (((int)buffer[11] & 0xFF) << 8 & 0xFF00)+ ((int) buffer[10] & 0xFF); desc_crc_len = (((int)buffer[11] & 0xFF) << 8 & 0xFF00)+ ((int) buffer[10] & 0xFF);
b = new byte[desc_crc_len]; b = new byte[desc_crc_len];
for(int i = 0; i < desc_crc_len; i++) { System.arraycopy(buffer, 16, b, 0, desc_crc_len);
b[i] = buffer[i + 16];
}
desc_crc = CRC.CRC16CCITT(b); desc_crc = CRC.CRC16CCITT(b);
@ -133,7 +131,7 @@ public class ESRPatch {
iso.seek(50 * LBA_SIZE); iso.seek(50 * LBA_SIZE);
iso.write(buffer); iso.write(buffer);
// Writes DVDV data // Writes esrpatchjava.DVDV data
DVDV.write(iso); DVDV.write(iso);
return PATCH_OK; return PATCH_OK;
@ -145,7 +143,8 @@ public class ESRPatch {
} finally { } finally {
try { try {
iso.close(); iso.close();
} catch(Exception e) {} }
catch(Exception ignore) {}
} }
} }
@ -175,33 +174,40 @@ public class ESRPatch {
if (buffer[1] == (byte) 0x4E && buffer[2] == (byte) 0x53 && buffer[3] == (byte) 0x52) if (buffer[1] == (byte) 0x4E && buffer[2] == (byte) 0x53 && buffer[3] == (byte) 0x52)
return true; return true;
} }
} catch (Exception ex) { }
catch (Exception ex) {
return false; return false;
} }
return false; return false;
} }
public static int apply(List files, JFrame parent) { public static int apply(List files, JFrame parent) {
String results = ""; StringBuilder results = new StringBuilder();
for (int j = 0; j < files.size(); j++) {
File f = new File(files.get(j).toString()); for (Object file : files) {
File f = new File(file.toString());
if(f.isFile() && f.exists()) {
results += f.getName(); if (f.isFile() && f.exists()) {
results.append(f.getName());
switch(apply(f.getPath())) {
case ESRPatch.ALREADY_PATCHED: results += " - ISO is already patched!\n"; break; switch (apply(f.getPath())) {
case ESRPatch.ERROR_PATCHING: results += " - Error trying to patch ISO!\n"; break; case ESRPatch.ALREADY_PATCHED:
case ESRPatch.PATCH_OK: results += " - ISO patched successfully! :)\n"; break; results.append(" - ISO is already patched!\n");
case ESRPatch.NOT_UDF_ISO: results += " - Error: ISO doesn't contain UDF descriptor!\n"; break; break;
case ESRPatch.ERROR_PATCHING:
results.append(" - Error trying to patch ISO!\n");
break;
case ESRPatch.PATCH_OK:
results.append(" - ISO patched successfully! :)\n");
break;
case ESRPatch.NOT_UDF_ISO:
results.append(" - Error: ISO doesn't contain UDF descriptor!\n");
break;
} }
} }
} }
JOptionPane.showMessageDialog(parent, results, "Results:", JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(parent, results.toString(), "Results:", JOptionPane.INFORMATION_MESSAGE);
return 0; return 0;
} }
@ -211,7 +217,7 @@ public class ESRPatch {
try { try {
iso = new RandomAccessFile(fileName, "rw"); iso = new RandomAccessFile(fileName, "rw");
// Checks if image is an UDF ISO // Checks if image is a UDF ISO
if(!isUDFISO()) { if(!isUDFISO()) {
iso.close(); iso.close();
return NOT_UDF_ISO; return NOT_UDF_ISO;
@ -238,9 +244,7 @@ public class ESRPatch {
iso.write(buffer); iso.write(buffer);
// Clear backups // Clear backups
for(int i = 0; i < buffer.length; i++) { Arrays.fill(buffer, (byte) 0);
buffer[i] = 0;
}
iso.seek(14 * LBA_SIZE); iso.seek(14 * LBA_SIZE);
iso.write(buffer); iso.write(buffer);
@ -254,34 +258,44 @@ public class ESRPatch {
ex.printStackTrace(); ex.printStackTrace();
return ERROR_PATCHING; return ERROR_PATCHING;
} finally { }
finally {
try { try {
iso.close(); iso.close();
} catch(Exception e) {} }
catch(Exception ignore) {}
} }
} }
public static int unPatch(List files, JFrame parent) { public static int unPatch(List files, JFrame parent) {
String results = ""; StringBuilder results = new StringBuilder();
for (int j = 0; j < files.size(); j++) {
File f = new File(files.get(j).toString()); for (Object file : files) {
if(f.isFile() && f.exists()) { File f = new File(file.toString());
results += f.getName();
if (f.isFile() && f.exists()) {
switch(unPatch(f.getPath())) { results.append(f.getName());
case ESRPatch.NOT_PATCHED: results += " - ISO is not patched!\n"; break;
case ESRPatch.ERROR_PATCHING: results += " - Error trying to unpatch ISO!\n"; break; switch (unPatch(f.getPath())) {
case ESRPatch.PATCH_OK: results += " - ISO unpatched successfully! :)\n"; break; case ESRPatch.NOT_PATCHED:
case ESRPatch.NOT_UDF_ISO: results += " - Error: ISO doesn't contain UDF descriptor!\n"; break; results.append(" - ISO is not patched!\n");
break;
case ESRPatch.ERROR_PATCHING:
results.append(" - Error trying to unpatch ISO!\n");
break;
case ESRPatch.PATCH_OK:
results.append(" - ISO unpatched successfully! :)\n");
break;
case ESRPatch.NOT_UDF_ISO:
results.append(" - Error: ISO doesn't contain UDF descriptor!\n");
break;
} }
} }
} }
JOptionPane.showMessageDialog(parent, results, "Results:", JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(parent, results.toString(), "Results:", JOptionPane.INFORMATION_MESSAGE);
return 0; return 0;
} }

View File

@ -1,4 +1,4 @@
/* /*
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
@ -12,6 +12,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package esrpatchjava;
import java.io.File; import java.io.File;
import javax.swing.filechooser.*; import javax.swing.filechooser.*;
@ -24,13 +25,8 @@ public class ISOFileFilter extends FileFilter {
} }
String extension = getExtension(f); String extension = getExtension(f);
if (extension != null) { if (extension != null)
if (extension.compareToIgnoreCase("iso") == 0) { return extension.compareToIgnoreCase("iso") == 0;
return true;
} else {
return false;
}
}
return false; return false;
} }

View File

@ -0,0 +1,129 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package esrpatchjava;
import esrpatchjava.ui.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.dnd.*;
import java.util.*;
public class Main extends JFrame implements ActionListener {
private final JButton btnPatch;
private final JButton btnUnpatch;
private final JButton btnQuit;
public static void main(String[] args) {
Main app = new Main();
app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public Main() {
super("ESRPatchJava "+ResourceBundle.getBundle("app").getString("_version"));
Container container = getContentPane();
container.setLayout(new GridLayout(5, 1));
btnPatch = new JButton("Patch ISO...");
btnPatch.setMnemonic('P');
btnPatch.addActionListener(this);
btnPatch.setBackground(Color.getHSBColor(0.5f, 0.12156863f, 1));
btnUnpatch = new JButton("Unpatch ISO...");
btnUnpatch.setMnemonic('U');
btnUnpatch.addActionListener(this);
btnUnpatch.setBackground(Color.getHSBColor(0.5f, 0.12156863f, 1));
GridLayout pnlButtonsLayout = new GridLayout(1, 2);
pnlButtonsLayout.setHgap(5);
JPanel pnlButtons = new JPanel(pnlButtonsLayout);
pnlButtons.add(btnPatch);
pnlButtons.add(btnUnpatch);
JLabel lblUsage = new JLabel("Select button below or drag and drop files here:", JLabel.LEFT);
JLabel lblInfo1 = new JLabel("(C)06/2008 - bootsector - http://www.brunofreitas.com/", JLabel.CENTER);
JLabel lblInfo2 = new JLabel("ESR Project by ffgriever", JLabel.CENTER);
btnQuit = new JButton("Close");
btnQuit.setMnemonic('C');
btnQuit.addActionListener(this);
btnQuit.setBackground(Color.getHSBColor(0.90f, 0.12156863f, 1));
container.add(lblUsage);
container.add(pnlButtons);
container.add(lblInfo1);
container.add(lblInfo2);
container.add(btnQuit);
((JPanel) container).setBorder(new EmptyBorder(5, 5, 5, 5));
setSize(450, 150);
setResizable(false);
setLocationRelativeTo(null);
setDropTarget(new DropTarget(getContentPane(), new MyDropTargetListener()));
setVisible(true);
}
public void actionPerformed(ActionEvent event){
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileFilter(new ISOFileFilter());
if (event.getSource() == btnQuit)
System.exit(0);
if (fileChooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION)
return;
String fileLocation = fileChooser.getSelectedFile().getAbsolutePath();
if (event.getSource() == btnPatch) {
doPatch(fileLocation);
return;
}
if (event.getSource() == btnUnpatch)
doUnPatch(fileLocation);
}
private void doPatch(String fileLocation){
switch(ESRPatch.apply(fileLocation)) {
case ESRPatch.ALREADY_PATCHED:
JOptionPane.showMessageDialog(this, "ISO is already patched!", "Attention", JOptionPane.INFORMATION_MESSAGE);
break;
case ESRPatch.ERROR_PATCHING:
JOptionPane.showMessageDialog(this, "Error trying to patch ISO!", "Error", JOptionPane.ERROR_MESSAGE);
break;
case ESRPatch.PATCH_OK:
JOptionPane.showMessageDialog(this, "ISO patched successfully! :)", "Ok!", JOptionPane.INFORMATION_MESSAGE);
break;
case ESRPatch.NOT_UDF_ISO:
JOptionPane.showMessageDialog(this, "ISO doesn't contain UDF descriptor!", "Error", JOptionPane.ERROR_MESSAGE);
}
}
private void doUnPatch(String fileLocation){
switch(ESRPatch.unPatch(fileLocation)) {
case ESRPatch.NOT_PATCHED:
JOptionPane.showMessageDialog(this, "ISO is not patched!", "Attention", JOptionPane.INFORMATION_MESSAGE);
break;
case ESRPatch.ERROR_PATCHING:
JOptionPane.showMessageDialog(this, "Error trying to patch ISO!", "Error", JOptionPane.ERROR_MESSAGE);
break;
case ESRPatch.PATCH_OK:
JOptionPane.showMessageDialog(this, "ISO unpatched successfully! :)", "Ok!", JOptionPane.INFORMATION_MESSAGE);
break;
case ESRPatch.NOT_UDF_ISO:
JOptionPane.showMessageDialog(this, "ISO doesn't contain UDF descriptor!", "Error", JOptionPane.ERROR_MESSAGE);
}
}
}

View File

@ -0,0 +1,70 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package esrpatchjava.ui;
import esrpatchjava.ESRPatch;
import javax.swing.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.*;
import java.io.File;
import java.util.List;
public class MyDropTargetListener implements DropTargetListener {
@Override
public void drop(DropTargetDropEvent event) {
try{
JFrame source = (JFrame) event.getDropTargetContext().getComponent();
event.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
Transferable transferable = event.getTransferable();
List<File> filesDropped = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
event.dropComplete(true);
Object[] options = {"Patch",
"Unpatch"};
int opt = JOptionPane.showOptionDialog(source,
"What would you like to do?",
"What to do?",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
options,
options[0]);
if (opt == JOptionPane.YES_OPTION)
ESRPatch.apply(filesDropped, source);
else
ESRPatch.unPatch(filesDropped, source);
}
catch (Exception e){
e.printStackTrace();
event.rejectDrop();
}
}
@Override
public void dragEnter(DropTargetDragEvent dropTargetDragEvent) {}
@Override
public void dragOver(DropTargetDragEvent dropTargetDragEvent) {}
@Override
public void dropActionChanged(DropTargetDragEvent dropTargetDragEvent) {}
@Override
public void dragExit(DropTargetEvent dropTargetEvent) {}
}

View File

@ -0,0 +1 @@
_version=v${project.version}