1

*(_BYTE *)(Key + Integer_count - 1) + 79

Here : Key = 0x22EC278 (dw 'Âx') or

Stack[000015B8]:0019FC2C db 78h ; x

Stack[000015B8]:0019FC2D db 0C2h ; Â

Stack[000015B8]:0019FC2E db 2Eh ; .

Stack[000015B8]:0019FC2F db 2

and integer_count is just a incremented loop (e.g. 1,2,3,4,...)

4
  • Key is a pointer it adds 79 to each byte upto integer count. Assume if key to key + intcount contains 0 then after this loop key to key+int count will all be 79 memset (* , 79 , intcount);
    – blabb
    Commented Mar 4, 2023 at 4:45
  • I am still little confused.... as this is entire function {String_from_char_((char *)&Decoded_string, *(_BYTE *)(Addressforencoded + Integer_count - 1) + 79);} now as you said {*(_BYTE *)(Addressforencoded + Integer_count - 1)} --> 0xFE and then addition happen so 0xFE+0x4f(hexof 79) --> gives 0x14D but only 4D has been written in memory Commented Mar 4, 2023 at 10:45
  • Yes correct overflow will be discarded byte is 8 bit max 0xff min 0x00. Ox14d is word or 16 bit. So obviously 0x100 is discarded
    – blabb
    Commented Mar 4, 2023 at 11:58
  • Ok Thanks Got it. Commented Mar 4, 2023 at 14:53

1 Answer 1

-1

That expression is dereferencing a pointer (Key + Integer_count - 1) and then adding 79 to the dereferenced value. So for example, if:

Key = 0x22EC278 Integer_count = 3

Then it would evaluate to: *(0x22EC27B) + 79

Which is accessing the byte at address 0x22EC27B (the last byte of the Key buffer) and adding 79 to it. So in your specific examples, it would be: *(0x22EC2F) + 79 // accessing the last byte (0x2F) of Key and adding 79 *(0x22EC2E) + 79 // accessing the byte before the last (0x2E) and adding 79

etc. So it's basically incrementing the last byte(s) of the Key buffer by 79 on each iteration of the Integer_count loop.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.