0
In php to change the value of certain bytes in the binary file, use a simple replace. For example:
$acc = fread($f5900xt, filesize(public_path("5900xt")));
$demoid = substr($acc, 0, $userlenght);
$demopass = substr($acc, 16, $passlenght);
$acc = str_replace($demoid, $login, $acc);
$acc = str_replace($demopass, $password, $acc);
I tried something similar in nodejs, but replace does not count the required homes in the file.
var accountFileExample = fs.readFileSync('./src/fileUtils/5900xt', 'binary', { enconding: 'utf8'});
var accountFinally;
const demoid = accountFileExample.substring(0, loginLength);
const demopass = accountFileExample.substring(16, passLength);
accountFinally = accountFileExample.replace(demoid, login)
accountFinally = accountFinally.replace(demopass, password)
console.log(accountFileExample);
Cool, thanks info. Fill works that way too? I got something like
data.fill(login, 0, login.length);
 data.fill(password, 16, password.length);
but the second Fill does not work.– Fela