|
-
July 29th, 2009, 08:24 AM
#1
C++ CLR - How to search hex in a binary file
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);
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|