mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-09-18 01:22:08 +00:00
PHP checksum working need to refactor and make more useful, easier to use, refactor lots of code
This commit is contained in:
10
test.php
10
test.php
@@ -6,9 +6,6 @@
|
||||
require_once './src/D2Functions.php';
|
||||
require_once './src/D2BitReader.php';
|
||||
|
||||
$file = "D:\Diablo II\MODS\ironman-dev\save\Barb.d2s";
|
||||
$data = file_get_contents($file);
|
||||
|
||||
class D2ByteReader {
|
||||
|
||||
private string $data;
|
||||
@@ -157,6 +154,9 @@ class D2ByteReader {
|
||||
|
||||
}
|
||||
|
||||
$file = "D:\Diablo II\MODS\ironman-dev\save\Barb.d2s";
|
||||
$data = file_get_contents($file);
|
||||
|
||||
$c = new D2ByteReader($data);
|
||||
$c->seek(643);
|
||||
$bytes = $c->readh(5);
|
||||
@@ -173,6 +173,4 @@ $c->writeBytes(12, "00000000"); // zero old checksum
|
||||
$newChecksum = checksum(unpack('C*', $c->getData())); // get new checksum
|
||||
dump($newChecksum);
|
||||
$c->writeBytes(12, $newChecksum); // write new checksum
|
||||
file_put_contents($file, $c->getData()); // write bytestream to file
|
||||
|
||||
//shell_exec("bin\d2scs.exe \"$file\"");
|
||||
file_put_contents($file, $c->getData()); // write bytestream to file
|
Reference in New Issue
Block a user