问题描述
我最近开始学习c ++和汇编语言,当我在IDA中反汇编某些内容并用伪代码查看该功能时,我遇到了LOBYTE.
i recently started learning c++ and assembly and i came across LOBYTE when i disassembled something in IDA and viewed the function in pseudo code.
阅读msdn: http://msdn.microsoft.com/zh-CN/library/windows/desktop/ms632658(v = vs.85).aspx
我还是不明白.什么是低位字节?有人可以告诉我更多关于它的用途以及在c ++中的用法示例吗?
i still dont understand.What is a low order byte? Can someone tell me more on what its used for and an example of its usage in c++ ?
推荐答案
LOBYTE
和 HIBYTE
以及 HIWORD
和 LOWORD
是用于从较大的一组字节/单词中提取一个单词或一个字节的宏.
LOBYTE
and HIBYTE
along with HIWORD
and LOWORD
, are macros used to extract a word or a byte from a larger set of bytes/words.
作为一个例子,假设您有两个字节 24 FF
,它们组成一个单词.您已将此值存储在程序中的 unsigned short ushortvar
中.现在,您可以使用 HIBYTE(ushortvar)
或 LOBYTE(ushortvar)
提取两个字节之一.第一个等于 0x24
,第二个等于 0xff
.您可以分别使用 LOWORD
和 HIWORD
,对 unsigned int
进行相同操作以提取单词中的一个.
As an example, say you have the two bytes 24 FF
, which make a word. You have this value stored in a unsigned short ushortvar
in your program. Now you can extract either of the two bytes by using HIBYTE(ushortvar)
or LOBYTE(ushortvar)
. The first will be equal to 0x24
, and the latter will be equal to 0xff
. You can do the same with a unsigned int
to extract a one of the words by using LOWORD
respectively HIWORD
.
这篇关于C ++ LOBYTE.请解释更多?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!