-
Notifications
You must be signed in to change notification settings - Fork 24
/
fiddler.cs
50 lines (45 loc) · 1.55 KB
/
fiddler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
# No mom, my code is not this bad, im just lazy to make it efficient #
*/
import System;
import System.Windows.Forms;
import Fiddler;
import System.Text.RegularExpressions;
var list = ["https://api-os-takumi.mihoyo.com",
"https://hk4e-api-os-static.mihoyo.com",
"https://hk4e-sdk-os.mihoyo.com",
"https://dispatchosglobal.yuanshen.com",
"https://osusadispatch.yuanshen.com",
"https://account.mihoyo.com",
"https://log-upload-os.mihoyo.com",
"https://dispatchcntest.yuanshen.com",
"https://devlog-upload.mihoyo.com",
"https://webstatic.mihoyo.com",
"https://log-upload.mihoyo.com",
"https://hk4e-sdk.mihoyo.com",
"https://api-beta-sdk.mihoyo.com",
"https://api-beta-sdk-os.mihoyo.com",
"https://cnbeta01dispatch.yuanshen.com",
"https://dispatchcnglobal.yuanshen.com",
"https://cnbeta02dispatch.yuanshen.com",
"https://sdk-os-static.mihoyo.com",
"https://webstatic-sea.mihoyo.com",
];
class Handlers
{
static function OnBeforeRequest(oS: Session) {
var active = 10 // Debugging
if(active){
if(oS.uriContains("http://overseauspider.yuanshen.com:8888/log")){
oS.oRequest.FailSession(404, "Blocked", "yourmom"); // How funny
}
for(var i = 0;i<20;i++) {
if(oS.uriContains(list[i])) {
oS.fullUrl = oS.fullUrl.Replace("https://", "http://");
oS.host = "localhost";
break;
}
}
}
}
};