Modify data after reading file as bytes?


Hello friends,
I am trying to modify binary data after read a file,the code like below:
–File.txt content is “abcd”

NeedFile=(dotnetclass "System.IO.File").ReadAllBytes @"C:\File.txt" asdotnetobject:on
GetData=(dotnetclass "System.Text.Encoding").Default.GetString NeedFile asdotnetobject:on
print GetData.Chars[0]  --"a"
print GetData.Chars[1]  --"b"
print GetData.Chars[2]  --"c"
print GetData.Chars[3]  --"d"

--How can I modify the total data to "1234" ?

Any help would be appreciate!


i don’t recommend to do anything like a “binary” max file modification. it’s a sure hack and very unsafe.


All right,thanks for your kind suggestion.