How can I find the data structure that represents mine layout of Minesweeper in memory?

前端 未结 10 1060
悲哀的现实
悲哀的现实 2021-01-29 17:18

I\'m trying to learn about reverse engineering, using Minesweeper as a sample application. I\'ve found this MSDN article on a simple WinDbg command that reveals all the mines b

10条回答
  •  生来不讨喜
    2021-01-29 18:16

    The mines will probably be stored in some kind of two-dimensional array. This means that it is either an array of pointers or a single C style array of booleans.

    Whenever the form receives a mouse-up event this data structure is referenced. The index will be calculated using the mouse coordinate, probably using integer division. That means that you should probably look for a cmp or a similar instruction, where one of the operands is computed using an offset and x, where x is the result of a calculation involving integer division. The offset will then be the pointer to the beginning of the data structure.

提交回复
热议问题