-1

Here is memory block I'm working with:

enter image description here

You can see 8b ff 55 8b ec 83 7d 0c 01 . . . . code. I want to get one each byte, so I tried:

DWORD offset; // this memroy has '0x61CAB0E4' and that means '8b ff 55... memroy block'
BYTE Result;
memcpy(&Result, &offset, 1); //1 mean byte as I want

BUT, the result is not correct. If I debug, the result value is 228 and I was expecting that value would be 8b.

How can I memory block one byte one?

8b,
ff,
55,
8b,
ec,
83,
7d,

....etc

These are the results:

enter image description here

iamdanchiv
  • 4,052
  • 4
  • 37
  • 42
mwK
  • 1
  • 6

1 Answers1

1

You are not converting properly your result, and misinterpreting:

  1. Your result is indeed decimal - 228.
  2. In binary this is 11100100
  3. The data is most likely stored in 2s complement in your P and depending on the endian and assuming the debugger just interpreted the binary as binary you get 10001011 - this is 139.
  4. Finally, convert to two digit hex number: 1000 is 8, 1011 is 11 which is b, so finally 8b.
kabanus
  • 24,623
  • 6
  • 41
  • 74