Hi!
I'm trying to search a binary file for some hex values and then replace them, using C++ CLR. Reading and writing the file works, but I just haven't found a way to search and replace successfully. Here is the relevant code I've created:
array<Byte>^ fileContents = File::ReadAllBytes(item);
textBox2->Text = item;
Object^ search = '\x6E' + '\x73' + '\x61' + '\x76' + '\x00' + '\x00' + '\x00' + '\x01';
int index = Array::BinarySearch(search, fileContents);
String^ filename = item->Replace(L".mov", L"_new.mov");
textBox2->Text = filename;
File::WriteAllBytes(filename, fileContents);