Home > Uncategorized > Hacking your pot in Apple’s Texas Holdem for iPhone

Hacking your pot in Apple’s Texas Holdem for iPhone

In Apple’s Texas Holdem app, there are several venues where you can play, with different buy-in amounts. I’m not very good, so it takes me a long time to build up enough money to play the later venues. Since my iPhone is jailbroken, I can just manually adjust the amount of money in my Texas Holdem pot. Here’s how I do this.

User installed apps on the iPhone live at /User/Applications/sandbox_dir/appname.app, where appname is the name of the app in question, and sandbox_dir is a random string of 37 hex digits and hyphens. This string is an example of salt, and it is how Apple implements a per-app sandbox. For one app to interact with another’s data, it would have to guess the name of its sandbox directory, which is a statistical impossibility.

To discover which sandbox directory Holdem lives in, I run ls -d /User/Applications/*/* | grep -i holdem, which on my device yields /User/Applications/6FFC1F30-3ECB-45F2-9A26-6473B554A360/HoldEm.app/. The file /User/Applications/6FFC1F30-3ECB-45F2-9A26-6473B554A360/Documents/data is where all your game data are stored. How many games played, how many games won, how much money, etc. I had hoped for an Apple .plist, but it seems to be a straight-up binary file. With a little trial and error, one finds that the amount of winnings is stored in bytes 51 through 53 of this file. Note that they’re in reverse order. So if you want 0×123456 dollars, byte 51 should be 56, byte 52 should be 34, and byte 53 should be 12.

In summary, with a jailbroken iPhone named iphone_name, with OpenSSH installed:

  1. From a computer on the same LAN as the iPhone, copy the data file to the local computer: scp root@iphone_name.local:/User/Applications/'`ls -d /User/Applications/*/* | grep -i holdem | cut -f 4 -d \/`'/Documents/data .
  2. Edit the data file on your computer with a hex edit program, adding your desire money to bytes 51 through 53. FF FF FF to max out your money.
  3. Copy the file back to your iPhone with: scp data root@iphone_name.local:/User/Applications/'`ls -d /User/Applications/*/* | grep -i holdem | cut -f 4 -d \/`'/Documents/data

And that’s it. That’s my killer app justification for all the hassle of jailbreaking; cheating at poker. You get $16,777,215 dollars. Plenty of money to lose at Dubai 160 times.

  1. lior
    January 21, 2010 at 7:16 pm | #1

    i cant understan this line
    can u help me?

    “Edit the data file on your computer with a hex edit program, adding your desire money to bytes 51 through 53. FF FF FF to max out your money ”

    i downloaded xvi32 i changed the 51 bytes to 56 , the 52 byte to 34 and the 53 byte to 12 but it dosent works , the amont stay the same 20,500 dollars
    maybe i do somthing wrong , please help me

    • January 22, 2010 at 4:26 am | #2

      Are you sure you’re putting the numbers in the right bytes? xvi32 shows which byte has focus in the bottom area of the window. If you have focus in the binary display, it shows the address in hex. We want to key the numbers in binary, so make sure you’re in the byte where it says “Adr. hex: 33″ (33 in hexadecimal is 51 in decimal).

      Also, you say you started with $20,500, right? 20,500 in decimal is 5014 in hexadecimal. Reverse the order of the bytes and you should see 14 50 00 in bytes 51-53. If you do see those numbers, then you’re editing the right place. If you don’t, then find those three bytes in your file.

  2. lior
    January 21, 2010 at 7:17 pm | #3

    moreover i didnt understand the FF FF FF thing
    i can see them but i dont understand what they are

  3. January 22, 2010 at 4:33 am | #4

    Your bytes 51-53 should contain 14 50 00 (since 0×005014 = 20,500). If you follow the example in my post, then you put 56 34 12 in bytes 51-53, and end up with $1,193,046. If you want to max out your money, then write FF FF FF into bytes 51-53, giving you $16,777,215. That’s the max you can have, because FF FF FF is the highest 3 byte number you can write in hexadecimal, just as 9999 is the highest four digit number in decimal.

  1. No trackbacks yet.