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);

Object^ search = '\x6E' + '\x73' + '\x61' + '\x76' + '\x00' + '\x00' + '\x00' + '\x01';
int index = Array::BinarySearch(search, fileContents);//I don't have a clue on how to get this to work

String^ filename = L"aaaa";

File::WriteAllBytes(filename, fileContents);