0

I disassembled some code and i get this function call , i guess from a rcr instruction , what is it really doing ?

__RCR__(v8, v9)

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
dcasda
  • 13
  • 4
  • Which CPU architecture, and which disassembler? – Michael Sep 18 '20 at 09:20
  • Intel x64 with Ida Pro ( Hex Rays ) – dcasda Sep 18 '20 at 09:21
  • 1
    See https://stackoverflow.com/questions/10395071/what-is-the-difference-between-rcr-and-ror – Elijan9 Sep 18 '20 at 09:23
  • 1
    Presumably `v8` is the input register and `v9` is `cl` (the rotate count). It's decompiling, not just disassembling, right? Because those aren't register names. I assume they're invented variable names. – Peter Cordes Sep 18 '20 at 22:44
  • `__RCR__` is a macro. Look in your IDA installation for `\plugins\defs.h` This file contains all of the macros used by the Hex-Rays decompiler. – fpmurphy Sep 20 '20 at 05:04

1 Answers1

-1

http://www.c-jump.com/CIS77/ASM/Assembly/A77_0420_rotate_with_carry.htm

RCR doing a rotate to the right and put on the left bit the value from Carry flag, The overridden bit will be in the Carry flag

AL = 01010100 CF = 1 ROR AL, 1;AL will be 10101010 and CF 0

rmbo56
  • 1
  • 1
    Yes, we know what the asm instruction does. But what semantics does the C function `__RCR__(int, int)` have? Apparently from IDA decompiling machine code back to C source. – Peter Cordes Jan 18 '23 at 17:49