• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Python/C++] Hooking HTTPClient directly in order to log Toontown Online packets.

Initiate Mage
Joined
Jul 2, 2012
Messages
1
Reaction score
0
Hi everybody,

I'm looking for some information and direction for something I'm trying to do, I'm NOT looking for somebody to do all the work for me, I would just like advice on where I should start in order to achieve what I want to achieve. Any help whatsoever, even if it's a comment like "Go back to whatever grave you crawled out of" :lol:, would be greatly appreciated.

In simple terms, I'm trying to create a Server Emulator for Toontown Online, now I realize, I will probably never achieve this goal, as I've found a few posts with people wanting to do the same, (see here, here, and here) however they all vanish never to be heard from again, :blink: I can only assume they gave up, and I probably will too, but since I'm so darn stubborn, I must at the very least attempt this goal. :p:

Now what I'm trying to do is log packets from Toontown (toontown.exe) and the Toontown game servers (h-t-t-p-s://gameserver-lv.toontown.c-o-m). I can log these packets in Wireshark, and I can filter them just find to only get the packets I want for Toontown, however these packets are encrypted (who knew right?) [sarcasm]Gee, I wonder if it has anything to do with the fact that it's using HTTPS[/sarcasm]

I know that it uses OpenSSL, and HTTPClient as this game runs on and is well documented, also you can find "HTTPClient" on "toontown.exe" while viewing with a hex editor, and OpenSSL is listed on their page. I've found that (toontown.exe) has no encryption, you can easily view it in HxD or any other hex editor, infact I'm looking at it right now! :eek:tt1: I can even type find "HTTPClient" and find a few things of interest, so not much work in that area, the engine is Panda3D which is completely open sourced, if your not familiar with it, it's just a mixture of python with a C++ wrapper from I understand, so you get the easy to use python, with the speed of C++, or so the tagline claims.


The startup process for Toontown is pretty simple, You just start the TT Launcher, the launcher downloads news, checks to see if a file is present on the server that would describe the servers being closed, if not found, it decides TT is live, and allows you to login. You input your username and password, launcher goes to (h-t-t-p-s://toontown.go.com/launcher/login?n=YOUR_USERNAME&p=YOUR_PASSWORD), it will give you a login token only valid for a couple of days. The launcher then hands this information off to "toontown.exe" and then Toontown starts.

You can start this toontown.exe manually once you get a login token.
This is not my info, this is found off google, to start Toontown manually you just open up notepad and past the following.
Code:
@echo off
set DOWNLOAD_SERVER=http://download.toontown.com/english/currentVersionWIN/content
set WEB_ACCT_PARAMS=None
set GAME_USERNAME=zzz
set GAME_SERVER=https://gameserver-lv.toontown.com
set LOGIN_TOKEN=vvv
set GAME_CHAT_ELIGIBLE=1
set ACCOUNT_SERVER=http://toontown.go.com
Toontown.exe
pause
You just replace "zzz" with your username, and replace "vvv" with your login token, now just name your file "runtt.bat", then just run the bat file in the same folder as "toontown.exe".

Toontown will then start, it will check if all files are updated, and update if necessary.
Then it will proceed to log you in, while downloading ToonNews files (just simple image files that contain weekly news). When it logs in, it starts communicating with the game server, which currently points to IP "68.71.220.197", however that is via https, and that is where I'm stuck at.

Now all the data is stored as a , and these multifiles are named "Phase_3.mf, Phase_5.mf, ext." very easy to extract (as the engine is opensourced), as such I have found a few certificates, but I don't think TT uses them anymore.

This is "certificates.txt"
Code:
This file contains SSL public-key certificates to allow the client to
confirm the identify of our various account servers when logging in.


This one is for VeriSign.  We are no longer using VeriSign to sign our
certificate.

subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
notBefore=Nov  9 00:00:00 1994 GMT
notAfter=Jan  7 23:59:59 2010 GMT
-----BEGIN CERTIFICATE-----
MIICNDCCAaECEAKtZn5ORf5eV288mBle3cAwDQYJKoZIhvcNAQECBQAwXzELMAkG
A1UEBhMCVVMxIDAeBgNVBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYD
VQQLEyVTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk0
MTEwOTAwMDAwMFoXDTEwMDEwNzIzNTk1OVowXzELMAkGA1UEBhMCVVMxIDAeBgNV
BAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQLEyVTZWN1cmUgU2Vy
dmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGbMA0GCSqGSIb3DQEBAQUAA4GJ
ADCBhQJ+AJLOesGugz5aqomDV6wlAXYMra6OLDfO6zV4ZFQD5YRAUcm/jwjiioII
0haGN1XpsSECrXZogZoFokvJSyVmIlZsiAeP94FZbYQHZXATcXY+m3dM41CJVphI
uR2nKRoTLkoRWZweFdVJVCxzOmmCsZc5nG1wZ0jl3S3WyB57AgMBAAEwDQYJKoZI
hvcNAQECBQADfgBl3X7hsuyw4jrg7HFGmhkRuNPHoLQDQCYCPgmc4RKz0Vr2N6W3
YQO2WxZpO8ZECAyIUwxrl0nHPjXcbLm7qt9cuzovk2C2qUtN8iD3zV9/ZHuO3ABc
1/p3yjkWWW8O6tO1g39NTUJWdrTJXwT4OPjr0l91X817/OWOgHz8UA==
-----END CERTIFICATE-----


This is the old authority we are using at the moment.

GTE CyberTrust Root CA
======================
MD5 Fingerprint: C4:D7:F0:B2:A3:C5:7D:61:67:F0:04:CD:43:D3:BA:58
PEM Data:
-----BEGIN CERTIFICATE-----
MIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYD
VQQKEw9HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJv
b3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJV
UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJU
cnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyv
RLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4M
ypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/5
1KiOQswkwB6RJ0q1bQaAYznEol44A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wHgYD
VQQDExdnYW1lc2VydmVyLnRvb250b3duLmNvbTEoMCYGCSqGSIb3DQEJARYZdG9v
bnRvd25AZGlzbmV5b25saW5lLmNvbTAeFw0wMzA5MTgwNTMwMjhaFw0wNjA5MTcw
NTMwMjhaMIG0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEYMBYG
A1UEBxMPTm9ydGggSG9sbHl3b29kMRswGQYDVQQKExJEaXNuZXkgRW50ZXJwcmlz
ZXMxDTALBgNVBAsTBFdESUcxIDAeBgNVBAMTF2dhbWVzZXJ2ZXIudG9vbnRvd24u
Y29tMSgwJgYJKoZIhvcNAQkBFhl0b29udG93bkBkaXNuZXlvbmxpbmUuY29tMIGf
MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCiNKkoSGdeBvMgsHpRWePENUW5ja9w
LTwbyinbDDIyJ8JIEQTPNxYosWvqhZGj+QEI3ya5KJM58LniuGHPbnC+C+XTEwwS
XZXIaMJjNT2GJ3gpJWytgVrk+A6zSaT2PHyE9wAPBF7lbBvLxCFUQ+N0I4QK0tus
k1rqixVGrqGz2wIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAAcgKbTgDY34c881vLrB
o2QqGqauXko9G8surSDbFjZWwbcIyGJyhwMCXzHQCLh9yruMbCMq5S7LZpS4yslX
aH3iboemYE7xT7RoFU4pPU5EQ2hJ+M5v79H81ubnuFrdOhk7pyo67Pn508X62V+j
eic2l1RcbBc5s9iq3+F2Ns5l
-----END CERTIFICATE-----

Why do I think they don't use them anymore? Toontown's log file keeps saying it cannot read "gameserver.txt", and if it can't read that, how is it communicating with the server?

Anyway to make a long story short :lol:, instead of messing with finding these SSL keys, and decrypting, I thought maybe I should just go straight to the source, and intercept calls to "HTTPClient", I would assume I write a bit of code that intercepts calls and sends packets to my own logger so I can inspect them without needing to decrypt anything.

Problem is, I don't know the first thing about trying to do that, any advice on where to start would be greatly appreciated, I'm currently trying to learn python, (by trying, I mean I know nothing except the very basic, "Hello World") I do not know C++, but I'm willing to learn.


Sorry for the long post, but I just wanted to provide as much information as I could.
Any advice would be sweet, Thanks for reading. :cool:

Anything related to my actual question is in bold, so you can just skim through the rest.
 

Kia

Newbie Spellweaver
Joined
Nov 12, 2013
Messages
8
Reaction score
2
Ultra BUMP.
Meanwhile the Client Source Code is available. Anyone still intrested in this project?
 
Back
Top