Only valid inside a class definition

167 views
Skip to first unread message

Kenan Maslan

unread,
Jan 14, 2019, 6:18:02 PM1/14/19
to Fiddler

I got this script and it was supposed to be ready to use for fortnite but it doesnt even save. Any ideas why?

//DOWNTIME BYPASS
    static function OnBeforeResponse(oSession: Session) {
        oSession.utilDecodeResponse();
        oSession.utilReplaceInResponse("DOWN", "UP");
	}

//USERNAME CHANGE
    static function OnBeforeResponse(oSession: Session) {
        oSession.utilDecodeResponse();
        oSession.utilReplaceInResponse("Username", "[EPIC] Username");
	}

//FIX LOGIN ERROR
    static function OnBeforeResponse(oSession: Session) {
         oSession.utilDecodeResponse();
         oSession.utilDecodeRequest();
        if(oSession.hostname.Contains("oauth")) {
            oSession.oResponse.headers.Remove("X-Epic-Error-Code");
            oSession.oResponse.headers.Remove("X-Epic-Error-Name");
            oSession.oResponse.headers.Remove("X-Epic-Profile-Revisions");
            oSession.oResponse["X-Epic-Token-TTL"] = "28739";
        }
        if(oSession.PathAndQuery.Contains("profile0") || oSession.PathAndQuery.Contains("VerifyRealMoneyPurchase")) {
            oSession.url = oSession.url.Replace("profileId=profile0", "profileId=athena");
            oSession.oResponse.headers.HTTPResponseCode = 200;
            oSession.oResponse.headers.HTTPResponseStatus = "200 OK";
            oSession.oResponse.headers.Remove("X-Epic-Error-Code");
            oSession.oResponse.headers.Remove("X-Epic-Error-Name");
            oSession.oResponse.headers.Remove("X-Epic-ProfileRevisions");
        }
	if (oSession.PathAndQuery.StartsWith("/fortnite/api/versioncheck?version=")) {
            oSession.oResponse.headers.HTTPResponseCode = 200;
            oSession.oResponse.headers.HTTPResponseStatus = "200 OK";
            oSession.oResponse.headers.Remove("X-Epic-Error-Code");
            oSession.oResponse.headers.Remove("X-Epic-Error-Name");
            oSession.utilSetResponseBody("{\"type\":\"OK\"}");
        } else if (oSession.PathAndQuery.Contains("/RefreshExpeditions") ||
        oSession.PathAndQuery.Contains("/IncrementNamedCounterStat") ||
            oSession.PathAndQuery.Contains("/GetMcpTimeForLogin")) {
              oSession.oResponse.headers.HTTPResponseCode = 200;
              oSession.oResponse.headers.HTTPResponseStatus = "200 OK";
              oSession.oResponse.headers.Remove("X-Epic-Error-Code");
              oSession.oResponse.headers.Remove("X-Epic-Error-Name");
              oSession.utilSetResponseBody("{}");
	}
    }  

//EDIT LEADERBOARDS OR STATS
  static function OnBeforeRequest(oSession: Session) {
         oSession.utilDecodeResponse();
         oSession.utilDecodeRequest();
	if(oSession.PathAndQuery.Contains("leaderboards")) {
	  oSession.utilSetResponseBody("{}");
        }
        if(oSession.PathAndQuery.Contains("/fortnite/api/stats/accountId")) {
          oSession.utilSetResponseBody("{}");
        }
  }

//EDIT ITEMSHOP
	static function OnBeforeRequest(oSession: Session) {
          if (oSession.HostnameIs("fortnite-public-service-prod11.ol.epicgames.com")) {
            oSession.utilDecodeResponse();
            oSession.utilDecodeRequest();
            if(oSession.PathAndQuery.Contains("storefront")) {
                oSession.utilSetResponseBody("");
                oSession.utilSetRequestBody("");
                oSession.oResponse.headers.HTTPResponseCode = 200;
            }
	  }
	}

EricLaw

unread,
Jan 15, 2019, 9:04:50 AM1/15/19
to Fiddler
You need to put this code just after the 

    class Handlers 
    { 

...lines of the FiddlerScript file. 

Kenan Maslan

unread,
Jan 15, 2019, 9:12:59 AM1/15/19
to Fiddler
Can you show me exacly how with the code i provided so that i get an understanding. Im really not good with these types of scripts
Reply all
Reply to author
Forward
0 new messages