Slashdot Mirror


Reverse Engineering MineSweeper

hdm writes "The first edition of the Uninformed Journal introduces reverse engineering by ripping apart the MineSweeper game included with Windows XP. This paper covers the basics of the Windows Debugger and steps through the entire reverse engineering and cheat code development process."

49 of 60 comments (clear)

  1. Building a MineSweeper player? by Hidyman · · Score: 1

    So they are going to build a bot to play MineSweeper? I didn't think it was that hard to begin with.

    --
    You can't take the sky from me ...
    1. Re:Building a MineSweeper player? by Teddy+Beartuzzi · · Score: 1
      I didn't think it was that hard to begin with.

      Depends on how you play it. At full size 24x30, with 200 mines it's amazingly difficult. I've managed to win it *once* in seven years or so at these settings.

    2. Re:Building a MineSweeper player? by fvbommel · · Score: 2, Informative

      Minesweeper is NP-Complete, which is basically a haughty way of saying "it's probably very difficult, but if you can prove whether it is or not, there's a million bucks in it for you"

      [another interesting link on the subject]

    3. Re:Building a MineSweeper player? by rbarreira · · Score: 1

      My friend has done it in C, it usually solves the expert level under 4 seconds in a Pentium 4 Centrino :D

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    4. Re:Building a MineSweeper player? by Sparr0 · · Score: 3, Interesting

      That has nothing to do with difficulty, thats a purely luck-based setup. With most minesweeper boards there will come a point where you have to pick one of two equally probable positions for the remaining mines. One of them will be wrong and lose the game, the other will be right. In "easy" games that happens rarely. In "medium" it happens sometimes. In "hard" it happens often enough that the game SEEMS hard, but its really just you coming up against 50/50 odds one more time than your luck held out.

    5. Re:Building a MineSweeper player? by mcmonkey · · Score: 1

      F.U. Teddy Beartuzzi. I did have stuff I wanted to get done this afternoon, ya know.

      (I was able to consistenly get to around 50 mines left.)

      (BTW (Best. Nickname. Ever.))

    6. Re:Building a MineSweeper player? by Teddy+Beartuzzi · · Score: 2, Insightful
      It's true that luck plays a part, but that's true of almost all solitaire games. Sometimes the tiles, cards, or bombs are stacked against you no matter what you do.

      Doesn't make it any less enjoyable, though. :) It's not totally luck though, good players will consistently get further than poorer players, because they can see the "I know two of these four are mines, and three of these five are mines, therefore this one cannot be a mine!" moments better. The players who know to use both mouse buttons simultaneously to clear areas do better as well.

      I find that many Minesweeper players think of it as a race against time, so I'm just pointing out it's enjoyable as a test of quantity as well. Start at full size, 100 mines, and work your way up.

  2. But we already know the cheat by P-Nuts · · Score: 3, Informative

    It's a lot of effort to go to just to cheat at Minesweeper. I find it easier to type "xyzzy" followed by enter, shift+enter. Then look at the top-left pixel of your screen.

    1. Re:But we already know the cheat by Miffe · · Score: 1

      Does this still work? I havent got it to work since the win 3.x days.

    2. Re:But we already know the cheat by fvbommel · · Score: 1

      Just tried it on Win2K and WinXP, still works.

    3. Re:But we already know the cheat by Retroneous · · Score: 1

      Doesn't work on WinXP Pro...

    4. Re:But we already know the cheat by justanyone · · Score: 1

      Does Not Work on XP. And, what do you mean by, "Look At" the top left pixel? mouseover it? Of the desktop or of the minesweeper window? WTF? Sorry, have to ask here, this can't just be my inability to type.

    5. Re:But we already know the cheat by KDR_11k · · Score: 1

      Works on 2k.

      It's the top left pixel of the screen.

      --
      Justice is the sheep getting arrested while an impartial judge declares the vote void.
    6. Re:But we already know the cheat by DJDutcher · · Score: 2, Funny

      Yes it does work on WinXP Pro, I just tried it. Now how do I get ride of this colored pixel?!

    7. Re:But we already know the cheat by MyDixieWrecked · · Score: 1

      it does work on XP pro. I just tried it.

      I never even knew about that cheat. oh man...

      too bad REAL men don't cheat at minesweeper. 99% of the time the game can be won fare and square (every once and a while, you get stuck and have to guess).

      Although, I find it even EASIER to just modify the winmine.ini file and set the high-scores.

      --



      ...spike
      Ewwwwww, coconut...
    8. Re:But we already know the cheat by fvbommel · · Score: 2, Informative

      Hold your mouse over a square on the minesweeper field. Now look at the top left pixel of your screen. If it's white, the square doesn't contain a mine. If it's black, it does.

    9. Re:But we already know the cheat by clintp · · Score: 2, Insightful
      every once and a while, you get stuck and have to guess.
      Unless you're psychic you'll have to guess at least once in every game -- the first move.
      --
      Get off my lawn.
    10. Re:But we already know the cheat by MagicDude · · Score: 2, Interesting

      IIRC, the game is set so that the mines are distributed after you choose your first spot, ensuring that you never die on the first move. Makes sense, since in all the years I've played Minesweeper, I don't ever recall having hit a mine on the first try. Just to test this out, I made a custom game with a 10x10 grid and 81 mines (I tried 99 mines, but 81 seems to be the max for these dimensions). After about 20 games, I have yet to hit a mine on my first try.

    11. Re:But we already know the cheat by MyDixieWrecked · · Score: 1

      I've done the same. I'm completely sure it's engineered to not let you die in the first step.

      --



      ...spike
      Ewwwwww, coconut...
    12. Re:But we already know the cheat by Rolan · · Score: 1

      I've hit a mine on the first try several times, it's definately possible.

      --
      - AMW
    13. Re:But we already know the cheat by EnronHaliburton2004 · · Score: 1

      It doesn't work for me either. These people are crazy. There is no changing pixel on the upper left hand corner of the screen.

    14. Re:But we already know the cheat by b1t+r0t · · Score: 1

      I think "Up, Up, Down, Down, Left, Right, Left, Right, B, A, Start" is more fun.

      --

      --
      "Open source is good." - Steve Jobs
      "Open source is evil." - Microsoft
    15. Re:But we already know the cheat by erlenic · · Score: 1

      Maybe in a different version, such as on Linux. I also have yet to die on the first click in Windows, but I've never seen another version that did this same thing.

    16. Re:But we already know the cheat by innerlimit · · Score: 1

      It certainly does rearrange the field... if you activate the cheat and hover over a square of which the top left pixel tells you it's a bomb (i.e. black) and you click it, it won't reveal a bomb at all. in fact the bomb that was there will be moved to the top left corner of the field or the adjacent square if that one already contains one...

      and if you still don't believe me, do a search on codeproject.com with the keyword INVOKE and you'll turn up this

      ow, and of course clicking both buttons at the same time while hitting the 'esc' key will stop your timer!

    17. Re:But we already know the cheat by G-funk · · Score: 1

      Jebus.... You're all wrong, it's xyxxy, shift. THAT'S IT!

      --
      Send lawyers, guns, and money!
    18. Re:But we already know the cheat by RyoSaeba · · Score: 1

      OMG, i'm not the only one to remember that combo sooooo many years after last playing O.o
      was Air-something, right? don't even remember the name lol (horizontal shoot-em-up, on some console)

      --
      Tsuyoikoto ha taisetsu da ne, dakedo namida mo hitsuyousa (Strength is an important thing, but tears too are necessary)
    19. Re:But we already know the cheat by Anonymous Coward · · Score: 2, Insightful

      Well, I was semi-interested when I read the article, and at page 11, my jaws dropped:

      Time was spent to download and install the Symbols Packages, so let's see what hints they provide. Issue the following within the Command window get a list of all available symbols for WinMine.

      x WinMine!*


      The WinMine sybols are INCLUDED in the XP debug symbols !!!

      Of COURSE, it renders the reverse engineering task easier !

      Conclusion: crap article, as in most case, you will not have the symbols when you reverse engineer. The CodeProject article is much better.

    20. Re:But we already know the cheat by ultranova · · Score: 1

      Ikari Warriors on Nintendo Entertainment System (8-bit NES).

      You know, I keep on hoping that someone makes OpenIkari GLWarriors...

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  3. score by astrokid · · Score: 2, Funny

    Can't I just edit the winmine.ini file if I wanted the fastest/highest time/score?

    kidding :)

    --

    Chewie does not get a medal. Come on, George. Can a Wookie get a medal?
    1. Re:score by superpulpsicle · · Score: 1

      Hey I do that to all my games. My relatives are always so impressed to see my scoreboard of 10 cazillion points in Dxball and all these old tetris games. When they insist in watching me play, I tell them I am only good after free beer.

  4. "Reverse Engineering Minsweeper" by kniLnamiJ-neB · · Score: 1

    No doubt named "MinePlanter".

    It's a good example though, something that everyone knows about in order to demo reverse-engineering techniques.

    --
    Windows isn't the answer... it's the question. NO is the answer!
    1. Re:"Reverse Engineering Minsweeper" by AndroidCat · · Score: 4, Funny

      I'd prefer a game of MimeSweeper, but maybe that would work better as a FPS or god game.

      --
      One line blog. I hear that they're called Twitters now.
  5. This reminds me... by orkysoft · · Score: 4, Funny

    Years ago, I worked somewhere, and a colleague had reverse-engineered Hearts (Windows 95), and created an executable that modified the Hearts executable to enable and disable a cheat, that allowed any card to be played, not just legal cards.

    In typical Microsoft fashion, the other players' clients (and the server) accepted the illegal cards without problems.

    That was kinda fun to use on unsuspecting colleagues during the break (though I used it just to make them go WTF? once or twice ;-)).

    --

    I suffer from attention surplus disorder.
    1. Re:This reminds me... by Ratbert42 · · Score: 4, Funny

      I once hacked up the resources for Minesweeper to swap the "4" and "5" bitmaps. A guy in my office was ready to report the bug to Microsoft before we all lost it. He refused to believe us until I showed him how I did it.

  6. Another take on hacking minesweeper by markh1967 · · Score: 3, Informative

    There's also a good article on hacking minesweeper here

    --
    Input error. Replace user and press any key to continue.
  7. Gone, Daddy. Gone. by Dr.+Smeegee · · Score: 1

    Already slashdotted- 2:04pm cst

    1. Re:Gone, Daddy. Gone. by HanClinto · · Score: 1

      Really? Loaded fine just now for me -- saved the PDF to disk.

  8. Not on 95/98/ME by Tired_Blood · · Score: 1

    I was attempting it on the WinME I'm currently using with no success. Before trying to strain my eyes, I figured that an internet search is in order...

    Apparently, I'm not alone here.

    Those with 95/98/ME can't use this cheat.

    --
    This is not my sig.
  9. Shift-enter FIRST then Enter. by EnronHaliburton2004 · · Score: 3, Informative

    Dude! You have the enter and shift+enter backwards. was getting really angry with you until I did some investigation.

    You type "XYZZY" then press shift-enter and Enter.

    Unless it's different on different versions of Windows.

    (WinXP SP2 here)

    1. Re:Shift-enter FIRST then Enter. by enosys · · Score: 1

      xyzzy seems sufficient with WinXP SP2

    2. Re:Shift-enter FIRST then Enter. by enosys · · Score: 1
      Oops, sorry that was very misleading. I wrote:

      xyzzy <shift> seems sufficient with WinXP SP2

      The shift was treated like an HTML tag and so it was invisible.

  10. His instructions are wrong. by EnronHaliburton2004 · · Score: 1

    It's not you, it's him. He had the instructions wrong.

    You type "XYZZY" then press shift-enter and Enter. It should work now.

    It's pretty unimpressive... it's faster just to use your skill & intuition rather then divert your eyes to look for a stupid, teeny pixel.

    18 seconds! Third try! Woot!

  11. Careful... by arose · · Score: 1

    Don't blow up!

    --
    Analogies don't equal equalities, they are merely somewhat analogous.
  12. This is retarded... by Anonymous Coward · · Score: 1, Informative

    The source for minesweeper comes with Visual Studio on the MSDN CD as an example project.

    1. Re:This is retarded... by Anonymous Coward · · Score: 1, Informative

      I think the point of the article is to describe *how* to reverse engineer a Windows application, not some quick hack for winning at the game =P

  13. So reverse Engineering IS OK Now? by fluffy99 · · Score: 2, Insightful

    So if a MS employee was caught reverse engineering code, it's ok? I realize it's a stupid game, but it's against the EULA and potentially illegal as well. Damn hypocrites.

    1. Re:So reverse Engineering IS OK Now? by Shadowlore · · Score: 1

      So if a MS employee was caught reverse engineering code, it's ok?

      You can't reverse engineer code. A product, a service, an API, a protocol, a process, etc.; yes. Code, no.

      and potentially illegal as well

      You post is potentially illegal.

      --
      My Suburban burns less gasoline than your Prius.
    2. Re:So reverse Engineering IS OK Now? by fluffy99 · · Score: 1

      Ok, so technically you reverse a binary, dll, etc to produce your own version of the code. You're nitpicking and know what I mean. So why am I now illegal? It is because I sound like a heretic amongst the OSS fanatics? Dang Idahoans (I'm one too.)

  14. Re:AOL was the same way by Anonymous Coward · · Score: 2, Interesting

    That's nothing compared to the old days when AOL charged a per minute fee. Turns out the only security on their service was client side. With a small program you could get AOL for free by causing the client to lie and claim you were in a free area such as account status. Even worse, the only thing preventing anyone from accessing the employee only areas such as the customer database was the fact the AOL client wouldn't let you use the keyword (similar to a domain name) normally used to access that area. All you had to do to get access to the entire customer database including all the credit card numbers was request access to that area directly with another program rather than use the AOL GUI. That's right, if you could send the right data yourself you could do anything on AOL that an employee could.