I need open and edit a executable file in binary mode, to replace hex value as string.
In PHP, looks like this:
<?php
$fp = fopen('file.exe', 'r+');
$content = fread($fp, filesize('file.exe'));
fclose($fp);
print $content;
/* [...] This program cannot be run in DOS mode.[...] */
?>
How I get it in C#?