Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
1,729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.89 KB | None | 0 0
  1. import System;
  2.  
  3. import System.Web;
  4.  
  5. import System.Windows.Forms;
  6.  
  7. import Fiddler;
  8.  
  9.  
  10. class Handlers
  11.  
  12. {
  13. //CODED BY r00t
  14. static var SquadPlayground = true;
  15. static var RegionOverride = "EU";
  16.  
  17. static function OnBeforeRequest(oSession: Session) {
  18. if(oSession.hostname.Contains("oauth")) {
  19. oSession.oResponse.headers.Remove("X-Epic-Error-Code");
  20. oSession.oResponse.headers.Remove("X-Epic-Error-Name");
  21. oSession.oResponse.headers.Remove("X-Epic-Profile-Revisions");
  22. oSession.oResponse["X-Epic-Token-TTL"] = "28739";
  23. }
  24. if(oSession.hostname.Contains("fortnite") || oSession.hostname.Contains("epic")) {
  25. oSession.oRequest.headers.Remove("X-Epic-ProfileRevisions");
  26. //oSession.oResponse.headers.Remove("X-Epic-Profile-Revisions");
  27. //oSession.oResponse.headers.Remove("X-EpicGames-McpVersion");
  28. oSession.RequestHeaders.Remove("User-Agent");
  29. oSession.oRequest["X-EpicGames-ProfileRevisions"] = '[{"profileId":"athena","clientCommandRevision":0},{"profileId":"theater0","clientCommandRevision":999},{"profileId":"outpost0","clientCommandRevision":21},{"profileId":"metadata","clientCommandRevision":270},{"profileId":"athena","clientCommandRevision":19139},{"profileId":"collection_book_people0","clientCommandRevision":102},{"profileId":"collection_book_schematics0","clientCommandRevision":74}]';
  30. oSession.oRequest["User-Agent"] = "game=Fortnite, engine=UE4, build=++Fortnite+Release-6.31-CL-4573279-Windows";
  31. oSession.utilReplaceInRequest("build=++Fortnite+Release-Live-CL-3724489", "build=++Fortnite+Release-6.31-CL-4573279-Windows");
  32. oSession.utilReplaceInRequest("profile0", "athena");
  33. oSession.utilReplaceInRequest("++Fortnite+Release-Live-CL-3724489", "++Fortnite+Release-6.31-CL-4573279");
  34. oSession.url = oSession.url.Replace("Fortnite%2BRelease-Live-CL-3724489", "Fortnite%2BRelease-6.31-CL-4573279");
  35. oSession.utilReplaceInRequest("Playing Battle Royale", "Playing Season 1");
  36. oSession.utilReplaceInRequest("Online", "Playing Season 1");
  37. }
  38. if (oSession.HostnameIs("fortnite-public-service-prod11.ol.epicgames.com")) {
  39. oSession.utilDecodeResponse();
  40. if(oSession.PathAndQuery.Contains("/fortnite/api/game")) {
  41. var response = oSession.utilDecodeResponse();
  42. if(response.ToString().Contains("errors.com.epicgames.modules.profiles.invalid_command")) {
  43. oSession.utilSetResponseBody("");
  44. }
  45. if (oSession.PathAndQuery.Contains("profileId=profile0")) {
  46. oSession.url = oSession.url.Replace("profileId=profile0","profileId=athena");
  47. }
  48. else if (oSession.PathAndQuery.StartsWith("/fortnite/api/game/v2/matchmakingservice/ticket/player/")) {
  49. var uriSplit = (oSession.url + "?").split("?");
  50. var queryString = HttpUtility.ParseQueryString(uriSplit[1]);
  51. var bucketSplit = queryString.Get("bucketId").split(":");
  52. bucketSplit[2] = RegionOverride;
  53. switch (bucketSplit[3]) {
  54. case "2": bucketSplit[3] = "playlist_playground"; break;
  55. case "10": bucketSplit[3] = "playlist_playground"; break;
  56. case "9":
  57. if (SquadPlayground) {
  58. bucketSplit[3] = "playlist_playground";
  59. }
  60. else {
  61. bucketSplit[3] = "playlist_defaultsquad";
  62. }
  63. break;
  64. default: FiddlerObject.alert("Unknown Match Type (" + bucketSplit[3] + ")");
  65. }
  66. var bucketString = bucketSplit.join(":");
  67. queryString.Set("bucketId", bucketString);
  68. queryString.Set("party.WIN", "true");
  69. queryString.Set("input.KBM", "true");
  70. oSession.url = uriSplit[0] + "?" + queryString.ToString();
  71. }
  72. }
  73. }
  74. }
  75. static var url = "https://pastebin.com/raw/GET2t7kn";
  76. static var rules = Fiddler.WebFormats.JSON.JsonDecode("[]");
  77. static function OnBeforeResponse(oSession: Session) {
  78. if (oSession.fullUrl === url) {
  79. oSession.utilDecodeResponse();
  80. rules = Fiddler.WebFormats.JSON.JsonDecode(oSession.GetResponseBodyAsString()).JSONObject;
  81. }
  82. oSession.utilDecodeResponse();
  83. if (oSession.uriContains("/api/oauth/exchange")) {
  84. FiddlerObject.utilIssueRequest("GET " + url + " HTTP/1.1\r\n\r\n");
  85. }
  86. oSession.utilDecodeResponse();
  87. oSession.utilReplaceInResponse("DOWN", "UP");
  88. oSession.utilReplaceInResponse("Kelzo.", "[KDT] Jonas");
  89. if (oSession.LocalProcess.StartsWith("fortniteclient")) {
  90. oSession.utilDecodeResponse();
  91. for (var i = 0; i < rules.Count; i++) {
  92. oSession.utilReplaceInResponse(rules[i][0], rules[i][1]);
  93. }
  94. }
  95. oSession.utilDecodeRequest();
  96. /*if (oSession.HostnameIs("fortnite-public-service-prod11.ol.epicgames.com")) {
  97. oSession.utilDecodeResponse();
  98. oSession.utilDecodeRequest();
  99. if(oSession.PathAndQuery.Contains("storefront")) {
  100. oSession.utilSetResponseBody("");
  101. oSession.utilSetRequestBody("");
  102. oSession.oResponse.headers.HTTPResponseCode = 200;
  103. }*/
  104. /*if(oSession.PathAndQuery.Contains("/lightswitch")) {
  105. var oResponseBody = oSession.GetResponseBodyAsString();
  106. JSON.JSONParseResult oJSON = JSON.JsonDecode(oResponseBody);
  107. FiddlerObject.alert(oJSON["banned"]);
  108. }*/
  109. if(oSession.PathAndQuery.Contains("profile0") || oSession.PathAndQuery.Contains("VerifyRealMoneyPurchase")) {
  110. oSession.url = oSession.url.Replace("profileId=profile0", "profileId=athena");
  111. oSession.oResponse.headers.HTTPResponseCode = 200;
  112. oSession.oResponse.headers.HTTPResponseStatus = "200 OK";
  113. oSession.oResponse.headers.Remove("X-Epic-Error-Code");
  114. oSession.oResponse.headers.Remove("X-Epic-Error-Name");
  115. oSession.oResponse.headers.Remove("X-Epic-ProfileRevisions");
  116. }
  117. if(oSession.PathAndQuery.Contains("leaderboards")) {
  118. oSession.utilSetResponseBody("");
  119. }
  120. if(oSession.PathAndQuery.Contains("/fortnite/api/stats/accountId")) {
  121. oSession.utilSetResponseBody("");
  122. }
  123. if (oSession.PathAndQuery.StartsWith("/fortnite/api/versioncheck?version=")) {
  124. oSession.oResponse.headers.HTTPResponseCode = 200;
  125. oSession.oResponse.headers.HTTPResponseStatus = "200 OK";
  126. oSession.oResponse.headers.Remove("X-Epic-Error-Code");
  127. oSession.oResponse.headers.Remove("X-Epic-Error-Name");
  128. oSession.utilSetResponseBody("{\"type\":\"OK\"}");
  129. }
  130. else if (oSession.PathAndQuery.Contains("/RefreshExpeditions") ||
  131. oSession.PathAndQuery.Contains("/IncrementNamedCounterStat") ||
  132. oSession.PathAndQuery.Contains("/GetMcpTimeForLogin")) {
  133. oSession.oResponse.headers.HTTPResponseCode = 200;
  134. oSession.oResponse.headers.HTTPResponseStatus = "200 OK";
  135. oSession.oResponse.headers.Remove("X-Epic-Error-Code");
  136. oSession.oResponse.headers.Remove("X-Epic-Error-Name");
  137. oSession.utilSetResponseBody("{}");
  138. }
  139. }
  140. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement