Can anyone explain the following code as it's an array in assembly. I can't understand can you help me to figure it out line by line.
Q.1) what does the 401024 & 40102E line does ?
Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It only takes a minute to sign up.Sign up to join this community
The explanation is given in the book immediately following the listing (Practical Malware Analysis Chapter 6 page 128 "Recognizing C Code Constructs in Assembly"):
In this listing, the base address of array b corresponds to
dword_40A000, and the base address of array a corresponds to
var_14. Since these are both arrays of integers, each element is of size 4, although the instructions at 1 and 2 differ for accessing the two arrays. In both cases,
ecxis used as the index, which is multiplied by 4 to account for the size of the elements. The resulting value is added to the base address of the array to access the proper array element.