PHP Replace binary file at hex address -


i want modify binary file server side of aprox. 700kb change url in save it.

my first idea use bin hex , preg_replace replace url in binary.

the adress url in binary same, need change every time function called.

is there better/faster way ?

example:

somesite.com/api***

i want replace *** numbers var example.

*** between hex adress 00010edb-00010edd

thanks!

if string @ fixed position, can write data directly:

$position=hexdec("00010edb"); // have pre-calculate once $data="some data"; // replacement if ($f=fopen("your_file", "r+")) {     fseek($f, $position);     fwrite($f, $data);     fclose($f); } else {     echo "can't open file"; } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -