mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-23 05:04:24 -05:00
latest, d2s stuff
This commit is contained in:
@@ -64,10 +64,21 @@ class D2ByteReader {
|
||||
$this->data[$pos] = pack('H*', $byte);
|
||||
}
|
||||
}
|
||||
public function insertBytes(int $offset, string $bytes) {
|
||||
if ($offset < 0 || $offset > strlen($this->data) || $bytes == '')
|
||||
return false;
|
||||
$data = bin2hex($this->data); // convert to hex bytes string
|
||||
$newData = substr_replace($data, $bytes, $offset, 0);
|
||||
$this->data = hex2bin($newData);
|
||||
}
|
||||
|
||||
public function getData() {
|
||||
return $this->data ? $this->data : false;
|
||||
}
|
||||
|
||||
public function setData($data){
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function getOffset(): int {
|
||||
return $this->offset;
|
||||
|
Reference in New Issue
Block a user