The array after decompilation is parsed, And the array is parsed by decompilation.

Source: Internet
Author: User

The array after decompilation is parsed, And the array is parsed by decompilation.
In the morning, I saw someone in a group asking about the array problem after decompiling. I don't know how to calculate the data. I think I have written a small record before. I will paste it again for your reference.

For some simple games, store items and figures are defined by arrays. After getting a game decompilation, after analysis, we found that the initialized values of the characters used are defined as arrays. The following are the blood volume values of the characters, from the first level of blood to the full level are stored in the following array.




This figure cannot be understood. No problem. You will understand the java code I added:



For this array, we need to analyze the calculation of the numeric value. After querying the data, the data here is a low-level data storage, and each row represents a data in the array, the two arrays correspond to each other. Therefore, through calculation, a row represents an array of data, each row is divided into four, and the maximum value of each data is 255, So 0x1 in the second data represents a 255, add the first data and 1 of the second data to the value of the second data in the array.

For example, the third behavior example above is:

0x0 + 1*255 + 1 = 256. (decimal of data 1 + decimal of Data 2*255 + decimal of Data 2 = result data)

The fifth line of data is used as an example:

64 + 255*2 + 2 = 576.



At the same time, remember that the data here is in hexadecimal format. You can directly use the calculator in win7 to convert the 10-in-hexadecimal data into hexadecimal data. Example

0x64 = 100


After learning this, we can directly modify the second value of each row, and the third value can directly increase the blood volume of the character, which is very simple ~




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.