x64 Reverse Engineering (Part 15 - SHR Instruction)
For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the topics it will cover. https://github.com/mytechnotalent/Reverse-Engineering-Tutorial
The SHR command stands for shift right.
Let’s assume the register al holds 00010100b which is an 8-bit binary value. Let’s assume the instruction is shr al, 2. Below is what transpires as we see the values move two bits to the left.
00010100
00010100
00000101
Next week we will dive into ROL! Stay tuned!
Director of ... <All things AntiTamper>
6 年Additionally, the CF has no effect on shr/shl instructions... but sar/sal do. The direct shifts are exactly that. But the cf other than being set or cleared has no effect on the value... C example: Unsigned int (notice UNSIGNED!!) foo=0x80000004; (I’m assuming that this is a 32bit int..) ... foo = foo >> 4; Foo is now 0x08000000 even though the high bit was set .. as the compiler will use shr not sar on an unsigned word....
Director of ... <All things AntiTamper>
6 年And it’s the lsb that was shifted that goes into the CF... not the msb on a shr operation
Director of ... <All things AntiTamper>
6 年Umm.. the new value is 00000101