Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. import System;
  2. import System.Threading;
  3. import System.Web;
  4. import System.Windows.Forms;
  5. import Fiddler;
  6.  
  7. class Handlers
  8. {
  9. static function OnBeforeRequest(oSession: Session) {
  10. if (oSession.hostname.StartsWith("xmpp-service-") && oSession.hostname.EndsWith(".ol.epicgames.com") ||
  11. oSession.hostname.StartsWith("fortnite-matchmaking-public-service-") && oSession.hostname.EndsWith(".ol.epicgames.com"))
  12. oSession.oRequest.headers.UriScheme = "https";
  13. else if (oSession.hostname.StartsWith("account-public-service-") && oSession.hostname.EndsWith(".ol.epicgames.com")) {
  14. if (oSession.PathAndQuery.Contains("/account/api/oauth/token")) {
  15. oSession.oRequest.headers["Authorization"] = "basic MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I0MWE=";
  16. }
  17. /*if (oSession.PathAndQuery.Contains("/QueryProfile?profileId=profile0")) {
  18. oSession.url = oSession.url.Replace("profileId=profile0","profileId=athena");
  19. }
  20. else if (oSession.PathAndQuery.StartsWith("/fortnite/api/game/v2/matchmakingservice/ticket/player/")) {
  21.  
  22. var uriSplit = (oSession.url + "?").split("?");
  23. var queryString = HttpUtility.ParseQueryString(uriSplit[1]);
  24. var bucketSplit = queryString.Get("bucketId").split(":");
  25.  
  26. }*/
  27. }
  28. }
  29.  
  30. static function OnBeforeResponse(oSession: Session) {
  31. oSession.utilDecodeResponse();
  32. oSession.utilReplaceInResponse("wss+insecure://", "wss+insecure://");
  33. if (oSession.HostnameIs("fortnite-public-service-prod11.ol.epicgames.com")) {
  34. oSession.utilDecodeResponse();
  35.  
  36. if (oSession.PathAndQuery.StartsWith("/fortnite/api/versioncheck?version=")) {
  37. oSession.oResponse.headers.HTTPResponseCode = 204;
  38. oSession.oResponse.headers.HTTPResponseStatus = "204 No Content";
  39. oSession.utilSetResponseBody("");
  40. }
  41. else if (oSession.PathAndQuery.Contains("/RefreshExpeditions") ||
  42. oSession.PathAndQuery.Contains("/IncrementNamedCounterStat") ||
  43. oSession.PathAndQuery.Contains("/GetMcpTimeForLogin")) {
  44.  
  45. oSession.oResponse.headers.HTTPResponseCode = 200;
  46. oSession.oResponse.headers.HTTPResponseStatus = "200";
  47.  
  48. oSession.oResponse.headers.Remove("X-Epic-Error-Code");
  49. oSession.oResponse.headers.Remove("X-Epic-Error-Name");
  50.  
  51. oSession.utilSetResponseBody("{}");
  52. }
  53. }
  54. else if (new String(oSession.GetRequestBodyAsString()).Contains("client_credentials")) {
  55. oSession.oResponse.headers.HTTPResponseCode = 500;
  56. oSession.utilSetResponseBody("{}");
  57. Thread.Sleep(10000);
  58. }
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement