Skip to content

Commit

Permalink
Update styling, GameCenter highscore tutorial.
Browse files Browse the repository at this point in the history
  • Loading branch information
cortesi committed Mar 17, 2013
1 parent d2d3eb6 commit 6614498
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 49 deletions.
2 changes: 1 addition & 1 deletion doc-src/01-bootstrap.min.css

Large diffs are not rendered by default.

15 changes: 1 addition & 14 deletions doc-src/02-docstyle.css
Expand Up @@ -3,23 +3,10 @@ body {
padding-bottom: 40px;
}

.terminal {
color: #c0c0c0;
font-size: 1em;
background: #000000;
}


pre {
margin-top: 10px;
color: #333;
}


.tablenum {
font-weight: bold;
}

.nowrap {
white-space: nowrap;
white-space: nowrap;
}
2 changes: 1 addition & 1 deletion doc-src/certinstall/firefox.html
@@ -1,7 +1,7 @@

How to install the __mitmproxy__ certificate authority in Firefox:

<ol>
<ol class="tlist">
<li> If needed, copy the ~/.mitmproxy/mitmproxy-ca-cert.pem file to the target. </li>

<li>Open preferences, click on "Advanced", then select"Encryption":
Expand Down
2 changes: 1 addition & 1 deletion doc-src/certinstall/ios-simulator.html
@@ -1,7 +1,7 @@

How to install the __mitmproxy__ certificate authority in the IOS simulator:

<ol>
<ol class="tlist">

<li> First, check out the <a
href="https://github.com/ADVTOOLS/ADVTrustStore">ADVTrustStore</a> tool
Expand Down
2 changes: 1 addition & 1 deletion doc-src/certinstall/ios.html
@@ -1,7 +1,7 @@

How to install the __mitmproxy__ certificate authority on IOS devices:

<ol>
<ol class="tlist">
<li>Set up the Mail app on the device to receive email.</li>

<li>Mail the mitmproxy-ca-cert.pem file to the device, and tap on the attachment.</li>
Expand Down
2 changes: 1 addition & 1 deletion doc-src/certinstall/osx.html
@@ -1,7 +1,7 @@

How to install the __mitmproxy__ certificate authority in OSX:

<ol>
<ol class="tlist">

<li>Open Finder, and double-click on the mitmproxy-ca-cert.pem file.</li>

Expand Down
2 changes: 1 addition & 1 deletion doc-src/certinstall/windows7.html
@@ -1,7 +1,7 @@

How to install the __mitmproxy__ certificate authority in Windows 7:

<ol>
<ol class="tlist">

<li> Copy the ~/.mitmproxy/mitmproxy-ca-cert.p12 file to the target system. </li>

Expand Down
1 change: 1 addition & 0 deletions doc-src/ssl.html
Expand Up @@ -42,4 +42,5 @@
* [Windows 7](@!urlTo("certinstall/windows7.html")!@)
* [iPhone/iPad](@!urlTo("certinstall/ios.html")!@)
* [IOS Simulator](@!urlTo("certinstall/ios-simulator.html")!@)
* [Android](@!urlTo("certinstall/android.html")!@)

3 changes: 3 additions & 0 deletions doc-src/transparent.html
@@ -0,0 +1,3 @@



68 changes: 68 additions & 0 deletions doc-src/transparent/osx.html
@@ -0,0 +1,68 @@


OSX Lion integrated the [pf](http://www.openbsd.org/faq/pf/) packet filter from
the OpenBSD project, which mitmproxy uses to implement transparent mode on OSX.
Note that this means we don't support transparent mode for earlier versions of
OSX.

<ol class="tlist">

<li> <a href="@!urlTo("ssl.html")!@">Install the mitmproxy
certificates on the test device</a>. </li>

<li> Enable IP forwarding:

<pre class="terminal">sudo sysctl -w net.inet.ip.forwarding=1</pre>
</li>

<li> Place the following two lines in a file called, say, <b>pf.conf</b>:

<pre class="terminal">rdr on en2 inet proto tcp to any port 80 -&gt; 127.0.0.1 port 8080
rdr on en2 inet proto tcp to any port 443 -&gt; 127.0.0.1 port 8080
</pre>

These rules tell pf to redirect all traffic destined for port 80 or 443
to the local mitmproxy instance running on port 8080. You should
replace <b>en2</b> with the interface on which your test device will
appear.

</li>

<li> Configure pf with the rules:

<pre class="terminal">sudo pfctl -f pf.conf</pre>

</li>

<li> And now enable it:

<pre class="terminal">sudo pfctl -e</pre>

</li>

<li> Configure your test device to use the host on which mitmproxy is
running as the default gateway.</li>

<li> Configure sudoers to allow mitmproxy to access pfctl. Edit the file
<b>/etc/sudoers</b> on your system as root. Add the following line to the end
of the file:

<pre>ALL ALL=NOPASSWD: /sbin/pfctl -s state</pre>

Note that this allows any user on the system to run the command
"/sbin/pfctl -s state" as root without a password. This only allows
inspection of the state table, so should not be an undue security risk. If
you're special feel free to tighten the restriction up to the user running
mitmproxy.</li>

<li> Finally, fire up mitmproxy. You probably want a command like this:

<pre class="terminal">mitmproxy -T --host</pre>

The <b>-T</b> flag turns on transparent mode, and the <b>--host</b>
argument tells mitmproxy to use the value of the Host header for URL
display.

</li>

</ol>
73 changes: 45 additions & 28 deletions doc-src/tutorials/gamecenter.html
Expand Up @@ -39,14 +39,21 @@

<!--(block|syntax("xml"))-->
<plist version="1.0">
<dict>
<key>category</key>
<string>SMW_Adv_USA1</string>
<key>score-value</key>
<integer>55</integer>
<key>timestamp</key>
<integer>1301553284461</integer>
</dict>
<dict>
<key>scores</key>
<array>
<dict>
<key>category</key>
<string>SMW_Adv_USA1</string>
<key>context</key>
<integer>0</integer>
<key>score-value</key>
<integer>0</integer>
<key>timestamp</key>
<integer>1363515361321</integer>
</dict>
</array>
</dict>
</plist>
<!--(end)-->

Expand All @@ -66,14 +73,21 @@

<!--(block|syntax("xml"))-->
<plist version="1.0">
<dict>
<key>category</key>
<string>SMW_Adv_USA1</string>
<key>score-value</key>
<integer>2200272667</integer>
<key>timestamp</key>
<integer>1301553284461</integer>
</dict>
<dict>
<key>scores</key>
<array>
<dict>
<key>category</key>
<string>SMW_Adv_USA1</string>
<key>context</key>
<integer>0</integer>
<key>score-value</key>
<integer>2200272667</integer>
<key>timestamp</key>
<integer>1363515361321</integer>
</dict>
</array>
</dict>
</plist>
<!--(end)-->

Expand All @@ -91,15 +105,18 @@
And that's it - according to the records, I am the greatest Super Mega Worm
player of all time.

Curiously, the top competitors' scores are all the same: 2,147,483,647. If you
think that number seems familiar, you're right: it's 2^31-1, the maximum value
you can fit into a signed 32-bit int. Now let me tell you another peculiar
thing about Super Mega Worm - at the end of every game, it submits your highest
previous score to the Game Center, not your current score. This means that it
stores your highscore somewhere, and I'm guessing that it reads that stored
score back into a signed integer. So, if you _were_ to cheat by the relatively
pedestrian means of modifying the saved score on your jailbroken phone, then
2^31-1 might well be the maximum score you could get. Then again, if the game
itself stores its score in a signed 32-bit int, you could get the same score
through perfect play, effectively beating the game. So, which is it in this
case? I'll leave that for you to decide.
There's a curious addendum to this tale. When I first wrote this tutorial, all
the top competitors' scores were the same: 2,147,483,647 (this is no longer the
case, beacause there are now so many fellow cheaters using this tutorial). If
you think that number seems familiar, you're right: it's 2^31-1, the maximum
value you can fit into a signed 32-bit int. Now let me tell you another
peculiar thing about Super Mega Worm - at the end of every game, it submits
your highest previous score to the Game Center, not your current score. This
means that it stores your highscore somewhere, and I'm guessing that it reads
that stored score back into a signed integer. So, if you _were_ to cheat by the
relatively pedestrian means of modifying the saved score on your jailbroken
phone, then 2^31-1 might well be the maximum score you could get. Then again,
if the game itself stores its score in a signed 32-bit int, you could get the
same score through perfect play, effectively beating the game. So, which is it
in this case? I'll leave that for you to decide.

2 changes: 1 addition & 1 deletion libmproxy/flow.py
Expand Up @@ -1309,7 +1309,7 @@ def delete_flow(self, f):
if f.request in self._flow_map:
del self._flow_map[f.request]
self._flow_list.remove(f)
if f.match(self._limit):
if f in self.view:
self.view.remove(f)
return True

Expand Down

0 comments on commit 6614498

Please sign in to comment.