alanmusician
Programmer
I'm an old programmer but new to C++ and I'd like to ask a confused question. I have a chunk of data in a buffer in memory (type of LPVOID and virtually allocated with VirtualAlloc) that is read from an image file. This chunk of data is a tif file that has been encrypted by switching the two digits in each byte and changing the characters according to this table:
0-0
1-8
2-4
3-C
4-2
5-A
6-6
7-E
8-1
9-9
A-5
B-D
C-3
D-B
E-7
F-F
for example 0x97 becomes 0xE9.
What is the easiest way to convert this data into a usuable chunk? How can I scan through my buffer and convert each byte?
0-0
1-8
2-4
3-C
4-2
5-A
6-6
7-E
8-1
9-9
A-5
B-D
C-3
D-B
E-7
F-F
for example 0x97 becomes 0xE9.
What is the easiest way to convert this data into a usuable chunk? How can I scan through my buffer and convert each byte?