有人可以向我解释十六进制偏移吗? [英] Can someone explain hex offsets to me?

查看:1223
本文介绍了有人可以向我解释十六进制偏移吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


如果您阅读$ b,它应该包含28,315 $ b offset 0x04和0x05

我不确定如何做到这一点? 0x04是什么意思?

解决方案

0x04是4进制的十六进制数(0x就是基数16表示数字的通用前缀约定 - 因为很多人都认为是十进制),这将是第四个字节(因为他们说的是偏移量,所以他们可能将第一个字节计数为0字节,所以偏移量0x04将是第5个字节)。

我猜他们是说第4和第5个字节一起是28315,但他们说这是小端还是大端?

28315(十进制)是十六进制符号的0x6E9B,如果是小尾数,可能是0x9B 0x6E。

注意:Little-endian和big - endian是指写入顺序字节。人类通常以大写字母的方式写十进制符号和十六进制,所以:

<256>将被写为0x0100(左边的数字是最大的数字)



但是这需要两个字节,小端系统会先写低字节:0x00 0x01。大端系统会先写高字节:0x01 0x00。

通常英特尔系统是小端系统,其他系统也有所不同。

I downloaded Hex Workshop, and I was told to read a .dbc file.

It should contain 28,315 if you read offset 0x04 and 0x05

I am unsure how to do this? What does 0x04 mean?

解决方案

0x04 is hex for 4 (the 0x is just a common prefix convention for base 16 representation of numbers - since many people think in decimal), and that would be the fourth byte (since they are saying offset, they probably count the first byte as byte 0, so offset 0x04 would be the 5th byte).

I guess they are saying that the 4th and 5th byte together would be 28315, but did they say if this is little-endian or big-endian?

28315 (decimal) is 0x6E9B in hexadecimal notation, probably in the file in order 0x9B 0x6E if it's little-endian.

Note: Little-endian and big-endian refer to the order bytes are written. Humans typical write decimal notation and hexadecimal in a big-endian way, so:

256 would be written as 0x0100 (digits on the left are the biggest scale)

But that takes two bytes and little-endian systems will write the low byte first: 0x00 0x01. Big-endian systems will write the high-byte first: 0x01 0x00.

Typically Intel systems are little-endian and other systems vary.

这篇关于有人可以向我解释十六进制偏移吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆