Skip to content

Commit

Permalink
add isSpoofed to config.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
GuckTubeYT authored May 13, 2023
1 parent b574136 commit 8693ce7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
28 changes: 15 additions & 13 deletions events/eventClient.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,31 @@ void clientReceive(ENetEvent event, ENetPeer* clientPeer, ENetPeer* serverPeer)

if (!currentInfo.isLogin) {
char** loginInfo = strsplit(packetText, "\n", 0);
char* klvGen;

if (userConfig.usingServerData) loginInfo[findArray(loginInfo, "meta|")] = CatchMessage("meta|%s", currentInfo.meta);
else loginInfo[findArray(loginInfo, "meta|")] = CatchMessage("meta|%s", userConfig.manualMeta);
loginInfo[findArray(loginInfo, "wk|")] = CatchMessage("wk|%s", currentInfo.wk);
loginInfo[findArray(loginInfo, "rid|")] = CatchMessage("rid|%s", currentInfo.rid);
loginInfo[findArray(loginInfo, "mac|")] = CatchMessage("mac|%s", currentInfo.mac);
loginInfo[findArray(loginInfo, "hash|")] = CatchMessage("hash|%d", protonHash(CatchMessage("%sRT", currentInfo.mac)));
loginInfo[findArray(loginInfo, "hash2|")] = CatchMessage("hash2|%d", protonHash(CatchMessage("%sRT", currentInfo.deviceID)));

if (findArray(loginInfo, "gid|") == -1) klvGen = generateKlv(loginInfo[findArray(loginInfo, "game_version|")] + 13, loginInfo[findArray(loginInfo, "hash|")] + 5, currentInfo.rid, loginInfo[findArray(loginInfo, "protocol|")] + 9, 0);
else klvGen = generateKlv(loginInfo[findArray(loginInfo, "game_version|")] + 13, loginInfo[findArray(loginInfo, "hash|")] + 5, currentInfo.rid, loginInfo[findArray(loginInfo, "protocol|")] + 9, 1);
if (userConfig.isSpoofed) {
char* klvGen;

loginInfo[findArray(loginInfo, "wk|")] = CatchMessage("wk|%s", currentInfo.wk);
loginInfo[findArray(loginInfo, "rid|")] = CatchMessage("rid|%s", currentInfo.rid);
loginInfo[findArray(loginInfo, "mac|")] = CatchMessage("mac|%s", currentInfo.mac);
loginInfo[findArray(loginInfo, "hash|")] = CatchMessage("hash|%d", protonHash(CatchMessage("%sRT", currentInfo.mac)));
loginInfo[findArray(loginInfo, "hash2|")] = CatchMessage("hash2|%d", protonHash(CatchMessage("%sRT", currentInfo.deviceID)));

if (findArray(loginInfo, "gid|") == -1) klvGen = generateKlv(loginInfo[findArray(loginInfo, "game_version|")] + 13, loginInfo[findArray(loginInfo, "hash|")] + 5, currentInfo.rid, loginInfo[findArray(loginInfo, "protocol|")] + 9, 0);
else klvGen = generateKlv(loginInfo[findArray(loginInfo, "game_version|")] + 13, loginInfo[findArray(loginInfo, "hash|")] + 5, currentInfo.rid, loginInfo[findArray(loginInfo, "protocol|")] + 9, 1);

loginInfo[findArray(loginInfo, "klv|")] = CatchMessage("klv|%s", klvGen);
loginInfo[findArray(loginInfo, "klv|")] = CatchMessage("klv|%s", klvGen);

free(klvGen);
}

char* resultSpoofed = arrayJoin(loginInfo, "\n", 1);
printf("[Client] Spoofed Login info: %s\n", resultSpoofed);
sendPacket(2, resultSpoofed, serverPeer);

free(loginInfo);
free(resultSpoofed);
free(klvGen);

currentInfo.isLogin = 1;

break;
Expand Down
7 changes: 6 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ void loadConfig() {
userConfig.usingNewPacket = 1;
userConfig.httpsPort = 443;
userConfig.skipGazette = 1;
userConfig.isSpoofed = 0;

fprintf(fp, "usingServerData=1\nserverDataIP=2.17.198.162\nmanualIP=127.0.0.1\nmanualPort=17091\nmanualMeta=localhost\nusingNewPacket=1\nhttpsPort=443\nskipGazette=1");
fprintf(fp, "usingServerData=1\nserverDataIP=2.17.198.162\nmanualIP=127.0.0.1\nmanualPort=17091\nmanualMeta=localhost\nusingNewPacket=1\nhttpsPort=443\nskipGazette=1\nisSpoofed=0");
fclose(fp);
printf("[GTProxy] config.conf has been created!\n");
} else {
Expand Down Expand Up @@ -74,6 +75,10 @@ void loadConfig() {
if (split2[1][0] == '1') userConfig.skipGazette = 1;
else userConfig.skipGazette = 0;
}
if (isStr(split2[0], "isSpoofed", 1)) {
if (split2[1][0] == '1') userConfig.isSpoofed = 1;
else userConfig.isSpoofed = 0;
}

free(split2);
}
Expand Down
1 change: 1 addition & 0 deletions proxyStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct userConfig_ {
char usingNewPacket;
short httpsPort;
char skipGazette;
char isSpoofed;
};

struct userOpt_ {
Expand Down

0 comments on commit 8693ce7

Please sign in to comment.