English 中文(简体)
左翼反向工程 七个
原标题:Reverse Engineering, Left Bit shift by seven

我曾试图推翻工程师的游戏功能,但I m美妙药混淆不清。 I m 粗略为新来扭转工程(Im , ollydbg btw),因此我没有真正了解所有陷阱和细节。

Anyway here s my problem. This function is called when you pick up any Item in the game. It then calculates the value of the item and adds this value to your score. Before the function is called, a value is pushed which I m quite confident is the ID of the item. This is the code that confuses me:

SHL ESI,7
MOV CX,WORD PTR DS:[EDX+ESI+42]

ESI = the ID of the item EDX = constant value FE56A0

I was guessing that EDX (FE56A0) was the start of an array of items, ESI was the index of the item somehow and 42 would be the index of the value the item holds. This would be kinda weird though since your bit shifting ESI to the left by 7. As ESI increases, it s bit shifted value doesn t grow linearly.

So if EDX represent the start of an array and ESI would be an index, the items in the array wouldn t be of equal size. The meaning of this code is puzzling me.

Anyone got an idea what this code could represent?

问题回答

这个阵列可能拥有128个半固定的结构。 由7台多台电离光128台,加上进入电离层电离层结构所需的抵销。

这是因为多种重复实际上增加了多面指数线:

0 << 7 == 0
1 << 7 == 128
2 << 7 == 256
3 << 7 == 384

等等。

这部法典只是从一个阵列中储存的结构的成员手中获取。

可能的话,EDX指出了阵列的一部分的某些结构的开始。 阵列之前的数据需要42个字塔,阵列中每个元素需要128个字塔。 (1<<7为128 - 轮班常常被用作快速乘以两台力量的方式) 例如:

// EDX points here
struct GameItems
{
   int numItems;
   int stuff;
   int moreStuff;
   char[30] data;
   GameItem[MAX_ITEMS] items;  // offset 42 bytes from start
};

struct GameItem
{
   // 128-bit structure
}




相关问题
Minimum bit length needed for a positive integer in Python

1 = 0b1 -> 1 5 = 0b101 -> 3 10 = 0b1010 -> 4 100 = 0b1100100 -> 7 1000 = 0b1111101000 -> 10 … How can I get the bit length of an integer, i.e. the number of bits that are necessary to ...

C/C++ efficient bit array

Can you recommend efficient/clean way to manipulate arbitrary length bit array? Right now I am using regular int/char bitmask, but those are not very clean when array length is greater than datatype ...

Why is it useful to count the number of bits?

I ve seen the numerous questions about counting the number of set bits in an insert type of input, but why is it useful? For those looking for algorithms about bit counting, look here: Counting ...

Comparing set of bits in byte array

I have a byte array, as follows: byte[] array = new byte[] { 0xAB, 0x7B, 0xF0, 0xEA, 0x04, 0x2E, 0xF3, 0xA9}; The task is to find the quantity of occurrences 0xA in it. Could you advise what to ...

One s complement instead of just a sum of bits

A question in my university homework is why use the one s complement instead of just the sum of bits in a TCP checksum. I can t find it in my book and Google isn t helping. Any chance someone can ...

热门标签