// hook libc created on 2023 May 12 Bypas Toxic @t.me/CacheTmp_DalVi
#pragma once

#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <unistd.h>
#include <dlfcn.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>

#include <stdio.h>
#include <string.h>
#include <dlfcn.h>
#include <stdio.h>


typedef int( * SocketFunc)(int domain, int type, int protocol);
typedef int( * ConnectFunc)(int sockfd, const struct sockaddr * addr, socklen_t addrlen);
int( * originalSocket)(int domain, int type, int protocol);
int( * originalConnect)(int sockfd, const struct sockaddr * addr, socklen_t addrlen);
int( * originalInetPton)(int af, const char * src, void * dst);
int( * originalGetAddrInfo)(const char * node, const char * service, const struct addrinfo * hints, struct addrinfo ** res);
struct hostent * ( * originalGetHostByAddr)(const void * addr, socklen_t len, int type);
struct hostent * ( * originalGetHostByName)(const char * name);

int XXX = 0;

void hookedInetPton(int af, const char * src, void * dst) {
    char ip[INET6_ADDRSTRLEN];
    if (Firewall) {
        if (af == AF_INET && strstr(src, OBFUSCATE("ff.dr.grtc.garenanow.com")) ||
        strstr(src, OBFUSCATE("dl.")) ||
        strstr(src, OBFUSCATE("dl-")) ||
        strstr(src, OBFUSCATE(".cn")) ||
        strstr(src, OBFUSCATE("google")) ||
        strstr(src, OBFUSCATE("164.")) ||
        strstr(src, OBFUSCATE("103.16.33.136")) ||
        strstr(src, OBFUSCATE("103.16.33.")) ||
        strstr(src, OBFUSCATE("dl.")) ||
        strstr(src, OBFUSCATE("dl-")) ||
        strstr(src, OBFUSCATE("64.")) ||
        strstr(src, OBFUSCATE("60.")) ||
        strstr(src, OBFUSCATE("63.")) ||
        strstr(src, OBFUSCATE("56.")) ||
        strstr(src, OBFUSCATE("164.52.102.")) ||
        strstr(src, OBFUSCATE("49.45.0.1")) ||
        strstr(src, OBFUSCATE("202.81.117.88")) ||
        strstr(src, OBFUSCATE("202.81.117.")) ||
        strstr(src, OBFUSCATE("202.81.118.4")) ||
        strstr(src, OBFUSCATE("202.81.118.")) ||
        strstr(src, OBFUSCATE("103.219.201.93")) ||
        strstr(src, OBFUSCATE("103.219.201.")) ||
        strstr(src, OBFUSCATE("199.59.243.225")) ||
        strstr(src, OBFUSCATE("199.")) ||
        strstr(src, OBFUSCATE("127.0.0.0")) ||
        strstr(src, OBFUSCATE("184.183.0.1")) ||
        strstr(src, OBFUSCATE("156.59.187.38")) ||
        strstr(src, OBFUSCATE("129.227.210.98")) ||
        strstr(src, OBFUSCATE("202.81.118.4")) ||
        strstr(src, OBFUSCATE("202.81.117.22")) ||
        strstr(src, OBFUSCATE("143.92.120.31")) ||
        strstr(src, OBFUSCATE("143.92.120.29")) ||
        strstr(src, OBFUSCATE("143.92.120.30")) ||
        strstr(src, OBFUSCATE("129.227.202.238")) ||
        strstr(src, OBFUSCATE("202.81.108.107")) ||
        strstr(src, OBFUSCATE("202.81.109.230")) ||
        strstr(src, OBFUSCATE("129.227.20.170")) ||
        strstr(src, OBFUSCATE("127.0.0.53")) ||
        strstr(src, OBFUSCATE("192.168.0.1")) ||
        strstr(src, OBFUSCATE("203.116.180.99")) ||
        strstr(src, OBFUSCATE("150.109.185.81")) ||
        strstr(src, OBFUSCATE("192.168.31.1")) ||
        strstr(src, OBFUSCATE("192.0.2.111")) ||
        strstr(src, OBFUSCATE("192.168.1.1")) ||
        strstr(src, OBFUSCATE("192.168.31")) ||
        strstr(src, OBFUSCATE("192.168.0")) ||
        strstr(src, OBFUSCATE("192.168.1")) ||
        strstr(src, OBFUSCATE("10.196.138.200")) ||
        strstr(src, OBFUSCATE("10.0.0.1")) ||
        strstr(src, OBFUSCATE("10.0.0.16")) ||
        strstr(src, OBFUSCATE("10.0.0.17")) ||
        strstr(src, OBFUSCATE("10.0.0.27")) ||
        strstr(src, OBFUSCATE("1.1.1.1")) ||
        strstr(src, OBFUSCATE("8.8.8.8")) ||
        strstr(src, OBFUSCATE("8.8.4.4")) ||
        strstr(src, OBFUSCATE("114.114.114.114")) ||
        strstr(src, OBFUSCATE("162.62.64.207")) ||
        strstr(src, OBFUSCATE("49.51.133.79")) ||
        strstr(src, OBFUSCATE("162.62.52.132")) ||
        strstr(src, OBFUSCATE("23.45.233.27")) ||
        strstr(src, OBFUSCATE("23.45.233.51")) ||
        strstr(src, OBFUSCATE("203.205.253.140")) ||
        strstr(src, OBFUSCATE("203.205.253.183")) ||
        strstr(src, OBFUSCATE("203.205.219.94")) ||
        strstr(src, OBFUSCATE("203.205.235.145")) ||
        strstr(src, OBFUSCATE("101.32.143.247")) ||
        strstr(src, OBFUSCATE("119.28.145.130")) ||
        strstr(src, OBFUSCATE("49.51.42.152")) ||
        strstr(src, OBFUSCATE("129.226.23.104")) ||
        strstr(src, OBFUSCATE("101.32.85.212")) ||
        strstr(src, OBFUSCATE("170.106.134.228")) ||
        strstr(src, OBFUSCATE("170.106.134.222")) ||
        strstr(src, OBFUSCATE("182.254.116.117")) ||
        strstr(src, OBFUSCATE("49.51.185.106")) ||
        strstr(src, OBFUSCATE("49.51.177.92")) ||
        strstr(src, OBFUSCATE("150.109.28.218")) ||
        strstr(src, OBFUSCATE("211.152.148.43")) ||
        strstr(src, OBFUSCATE("119.28.147.156")) ||
        strstr(src, OBFUSCATE("49.51.66.225")) ||
        strstr(src, OBFUSCATE("101.32.88.8")) ||
        strstr(src, OBFUSCATE("124.156.33.49")) ||
        strstr(src, OBFUSCATE("101.32.85.132")) ||
        strstr(src, OBFUSCATE("124.156.12.61")) ||
        strstr(src, OBFUSCATE("101.32.89.158")) ||
        strstr(src, OBFUSCATE("129.226.22.158")) ||
        strstr(src, OBFUSCATE("124.132.152.79")) ||
        strstr(src, OBFUSCATE("103.91.209.223")) ||
        strstr(src, OBFUSCATE("203.205.254.157")) ||
        strstr(src, OBFUSCATE("121.51.142.21")) ||
        strstr(src, OBFUSCATE("112.53.26.232")) ||
        strstr(src, OBFUSCATE("111.30.144.71")) ||
        strstr(src, OBFUSCATE("61.129.7.47")) ||
        strstr(src, OBFUSCATE("183.3.226.35")) ||
        strstr(src, OBFUSCATE("123.151.137.18")) ||
        strstr(src, OBFUSCATE("58.250.137.36")) ||
        strstr(src, OBFUSCATE("211.152.136.124")) ||
        strstr(src, OBFUSCATE("101.33.29.196")) ||
        strstr(src, OBFUSCATE("101.33.29.254")) ||
        strstr(src, OBFUSCATE("43.132.66.184")) ||
        strstr(src, OBFUSCATE("87.245.210.7")) ||
        strstr(src, OBFUSCATE("43.132.66.175")) ||
        strstr(src, OBFUSCATE("211.152.148.99")) ||
        strstr(src, OBFUSCATE("211.152.148.72")) ||
        strstr(src, OBFUSCATE("211.152.148.77")) ||
        strstr(src, OBFUSCATE("211.152.146.111")) ||
        strstr(src, OBFUSCATE("211.152.147.12")) ||
        strstr(src, OBFUSCATE("43.132.66.176")) ||
        strstr(src, OBFUSCATE("211.152.148.87")) ||
        strstr(src, OBFUSCATE("211.152.148.84")) ||
        strstr(src, OBFUSCATE("211.152.149.16")) ||
        strstr(src, OBFUSCATE("211.152.148.43")) ||
        strstr(src, OBFUSCATE("211.152.148.78")) ||
        strstr(src, OBFUSCATE("119.28.165.55")) ||
        strstr(src, OBFUSCATE("119.28.165.56")) ||
        strstr(src, OBFUSCATE("203.205.137.123")) ||
        strstr(src, OBFUSCATE("119.28.164.234")) ||
        strstr(src, OBFUSCATE("203.205.137.254")) ||
        strstr(src, OBFUSCATE("203.205.136.62")) ||
        strstr(src, OBFUSCATE("203.205.136.55")) ||
        strstr(src, OBFUSCATE("150.109.207.121")) ||
        strstr(src, OBFUSCATE("101.33.11.25")) ||
        strstr(src, OBFUSCATE("101.33.10.114")) ||
        strstr(src, OBFUSCATE("101.33.11.45")) ||
        strstr(src, OBFUSCATE("101.33.11.110")) ||
        strstr(src, OBFUSCATE("101.33.11.88")) ||
        strstr(src, OBFUSCATE("101.33.11.29")) ||
        strstr(src, OBFUSCATE("101.33.10.52")) ||
        strstr(src, OBFUSCATE("101.33.11.48")) ||
        strstr(src, OBFUSCATE("203.205.224.59")) ||
        strstr(src, OBFUSCATE("211.152.148.71")) ||
        strstr(src, OBFUSCATE("211.152.148.29")) ||
        strstr(src, OBFUSCATE("211.152.148.44")) ||
        strstr(src, OBFUSCATE("211.152.148.30")) ||
        strstr(src, OBFUSCATE("49.51.224.95")) ||
        strstr(src, OBFUSCATE("211.152.146.73")) ||
        strstr(src, OBFUSCATE("203.205.191.27")) ||
        strstr(src, OBFUSCATE("211.152.146.86")) ||
        strstr(src, OBFUSCATE("203.205.191.24")) ||
        strstr(src, OBFUSCATE("211.152.146.99")) ||
        strstr(src, OBFUSCATE("211.152.146.87")) ||
        strstr(src, OBFUSCATE("211.152.146.88")) ||
        strstr(src, OBFUSCATE("211.152.146.88")) ||
        strstr(src, OBFUSCATE("211.152.146.90")) ||
        strstr(src, OBFUSCATE("211.152.146.98")) ||
        strstr(src, OBFUSCATE("203.205.191.22")) ||
        strstr(src, OBFUSCATE("211.152.146.97")) ||
        strstr(src, OBFUSCATE("203.205.191.21")) ||
        strstr(src, OBFUSCATE("211.152.136.71")) ||
        strstr(src, OBFUSCATE("211.152.136.42")) ||
        strstr(src, OBFUSCATE("211.152.136.90")) ||
        strstr(src, OBFUSCATE("211.152.136.89")) ||
        strstr(src, OBFUSCATE("211.152.136.88")) ||
        strstr(src, OBFUSCATE("211.152.136.41")) ||
        strstr(src, OBFUSCATE("211.152.136.77")) ||
        strstr(src, OBFUSCATE("211.152.136.73")) ||
        strstr(src, OBFUSCATE("211.152.136.87")) ||
        strstr(src, OBFUSCATE("23.248.167.156")) ||
        strstr(src, OBFUSCATE("211.152.137.14")) ||
        strstr(src, OBFUSCATE("23.248.167.30")) ||
        strstr(src, OBFUSCATE("23.248.167.12")) ||
        strstr(src, OBFUSCATE("23.248.167.10")) ||
        strstr(src, OBFUSCATE("23.248.167.27")) ||
        strstr(src, OBFUSCATE("23.248.167.15")) ||
        strstr(src, OBFUSCATE("23.248.167.11")) ||
        strstr(src, OBFUSCATE("23.248.167.13")) ||
        strstr(src, OBFUSCATE("23.248.167.26")) ||
        strstr(src, OBFUSCATE("107.20.137.106")) ||
        strstr(src, OBFUSCATE("107.20.137.139")) ||
        strstr(src, OBFUSCATE("107.20.138.96")) ||
        strstr(src, OBFUSCATE("107.20.143.4")) ||
        strstr(src, OBFUSCATE("107.20.148.112")) ||
        strstr(src, OBFUSCATE("107.20.150.120")) ||
        strstr(src, OBFUSCATE("107.20.150.222")) ||
        strstr(src, OBFUSCATE("107.20.151.64")) ||
        strstr(src, OBFUSCATE("107.20.152.92")) ||
        strstr(src, OBFUSCATE("107.20.160.105")) ||
        strstr(src, OBFUSCATE("107.20.164.17")) ||
        strstr(src, OBFUSCATE("107.20.179.226")) ||
        strstr(src, OBFUSCATE("107.20.179.70")) ||
        strstr(src, OBFUSCATE("107.20.185.119")) ||
        strstr(src, OBFUSCATE("107.20.189.226")) ||
        strstr(src, OBFUSCATE("107.20.197.3")) ||
        strstr(src, OBFUSCATE("107.20.200.150")) ||
        strstr(src, OBFUSCATE("107.20.216.34")) ||
        strstr(src, OBFUSCATE("107.20.218.245")) ||
        strstr(src, OBFUSCATE("107.20.219.22")) ||
        strstr(src, OBFUSCATE("107.20.222.132")) ||
        
        strstr(src, OBFUSCATE("uic-cn.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("wkchannelone.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("service.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("cschannel.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("tqos.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("downintl.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("nj.cschannel.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("global.cschannel.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("ff.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("dns.qq.com")) ||
        strstr(src, OBFUSCATE("court.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("ctp.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("intl.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("intltest.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("defender.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("tqos-yun.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("uic.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("vip.qq.com")) ||
        strstr(src, OBFUSCATE("usa.csoversea.mbgame.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("anticheat.ini")) ||
        strstr(src, OBFUSCATE("my.mobfox.com")) ||
        strstr(src, OBFUSCATE("vpn.jxufe.edu.cn")) ||
        strstr(src, OBFUSCATE("qzone.com")) ||
        strstr(src, OBFUSCATE("voice.gcloudcs.com")) ||
        strstr(src, OBFUSCATE("tdm.qq.com")) ||
        strstr(src, OBFUSCATE("helpshift.com")) ||
        strstr(src, OBFUSCATE("tencent.com")) ||
        strstr(src, OBFUSCATE("pandora.com")) ||
        strstr(src, OBFUSCATE("pubgmobile.com")) ||
        strstr(src, OBFUSCATE("xinyue.qq.com")) ||
        strstr(src, OBFUSCATE("btrace.qq.com")) ||
        strstr(src, OBFUSCATE("qun.qq.com")) ||
        strstr(src, OBFUSCATE("y.qq.com")) ||
        strstr(src, OBFUSCATE("i.qq.com")) ||
        strstr(src, OBFUSCATE("mvn.public.igamecj.com")) ||
        strstr(src, OBFUSCATE("mvn.lobby.igamecj.com")) ||
        strstr(src, OBFUSCATE("lgl.public.igamecj.com")) ||
        strstr(src, OBFUSCATE("lgl.lobby.igamecj.com")) ||
        strstr(src, OBFUSCATE("lobby-gray.igamecj.com")) ||
        strstr(src, OBFUSCATE("freeqqm.qq.com")) ||
        strstr(src, OBFUSCATE("daohang.qq.com")) ||
        strstr(src, OBFUSCATE("euspeed.igamecj.com")) ||
        strstr(src, OBFUSCATE("krlobby.igamecj.com")) ||
        strstr(src, OBFUSCATE("wtlogin.qq.com")) ||
        strstr(src, OBFUSCATE("aegis.qq.com")) ||
        strstr(src, OBFUSCATE("imgcache.qq.com")) ||
        strstr(src, OBFUSCATE("sportsnba.qq.com")) ||
        strstr(src, OBFUSCATE("d3g.qq.com")) ||
        strstr(src, OBFUSCATE("docs.qq.com")) ||
        strstr(src, OBFUSCATE("wj.qq.com")) ||
        strstr(src, OBFUSCATE("jsapi.qq.com")) ||
        strstr(src, OBFUSCATE("iqqidip.mtown.qq.com")) ||
        strstr(src, OBFUSCATE("group.store.qq.com")) ||
        strstr(src, OBFUSCATE("qq.com")) ||
        strstr(src, OBFUSCATE("sgspeed.igamecj.com")) ||
        strstr(src, OBFUSCATE("sg.tdatamaster.com")) ||
        strstr(src, OBFUSCATE("group.qpic.cn")) ||
        strstr(src, OBFUSCATE("hkping.igamecj.com")) ||
        strstr(src, OBFUSCATE("as-sg.shadow.igamecj.com")) ||
        strstr(src, OBFUSCATE("3003-shadow.igamecj.com")) ||
        strstr(src, OBFUSCATE("as-sg.shadow.igamecj.com.0.1.adiosfil.roksit.net")) ||
        strstr(src, OBFUSCATE("bizapp.qq.com")) ||
        strstr(src, OBFUSCATE("3g.qq.com")) ||
        strstr(src, OBFUSCATE("sighttp.qq.com")) ||
        strstr(src, OBFUSCATE("filegcp.igamecj.com")) ||
        strstr(src, OBFUSCATE("ic.qq.com")) ||
        strstr(src, OBFUSCATE("sports.qq.com")) ||
        strstr(src, OBFUSCATE("pingfore.qq.com")) ||
        strstr(src, OBFUSCATE("t.qq.com")) ||
        strstr(src, OBFUSCATE("qzone.qq.com")) ||
        strstr(src, OBFUSCATE("eafifa.qq.com")) ||
        strstr(src, OBFUSCATE("im.qq.com")) ||
        strstr(src, OBFUSCATE("naping.igamecj.com")) ||
        strstr(src, OBFUSCATE("de.voice.gcloudcs.com")) ||
        strstr(src, OBFUSCATE("ptlogin2.qq.com")) ||
        strstr(src, OBFUSCATE("reports.crashlytics.com")) ||
        strstr(src, OBFUSCATE("aung.com")) ||
        strstr(src, OBFUSCATE("ig-us-notice.igamecj.com")) ||
        strstr(src, OBFUSCATE("4006-shadow.igamecj.com")) ||
        strstr(src, OBFUSCATE("tsg.tdatamaster.com")) ||
        strstr(src, OBFUSCATE("a.shifen.com")) ||
        strstr(src, OBFUSCATE("app.sparta.mig.tencent-cloud.net")) ||
        strstr(src, OBFUSCATE("simhub.tencent.com")) ||
        strstr(src, OBFUSCATE("ipv6.mainconn.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("adserver.admin.helpshift.com")) ||
        strstr(src, OBFUSCATE("nawzryhwatm.broker.amsoveasea.com")) ||
        strstr(src, OBFUSCATE("file.igamecj.com")) ||
        strstr(src, OBFUSCATE("pandora.game.qq.com")) ||
        strstr(src, OBFUSCATE("capandora.game.qq.com")) ||
        strstr(src, OBFUSCATE("tencentgames.helpshift.com")) ||
        strstr(src, OBFUSCATE("napubgm.broker.amsoveasea.com")) ||
        strstr(src, OBFUSCATE("cloud.gsdk.proximabeta.com")) ||
        strstr(src, OBFUSCATE("down.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("pandoracdn.amsoveasea.com")) ||
        strstr(src, OBFUSCATE("asia.csoversea.mbgame.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("cn.voice.gcloudcs.com")) ||
        strstr(src, OBFUSCATE("a1939.w10.akamai.net")) ||
        strstr(src, OBFUSCATE("garena-call-of-duty.firebaseio.com")) ||
        strstr(src, OBFUSCATE("crashreporter.beetalkmobile.com")) ||
        strstr(src, OBFUSCATE("tapjoy.jp")) ||
        strstr(src, OBFUSCATE("tapjoy.com")) ||
        strstr(src, OBFUSCATE("client.ind.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("ind.event.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("dl.castle.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("version.common.ffmax.garena.com")) ||
        strstr(src, OBFUSCATE("login.common.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("ffguide.garena.com")) ||
        strstr(src, OBFUSCATE("astat.bugly.qcloud.com")) ||
        strstr(src, OBFUSCATE("entireweb.com")) ||
        strstr(src, OBFUSCATE("envolk.com")) ||
        strstr(src, OBFUSCATE("dotnetdotcom.org")) ||
        strstr(src, OBFUSCATE("msn.com")) ||
        strstr(src, OBFUSCATE("search.msn.com")) ||
        strstr(src, OBFUSCATE("yahoo.com")) ||
        strstr(src, OBFUSCATE("help.yahoo.com")) ||
        strstr(src, OBFUSCATE("garykeith.com")) ||
        strstr(src, OBFUSCATE("browsers.garykeith.com")) ||
        strstr(src, OBFUSCATE("devconnect.garena.vn")) ||
        strstr(src, OBFUSCATE("devmsdk.garena.vn")) ||
        strstr(src, OBFUSCATE("msdk.garena.vn")) ||
        strstr(src, OBFUSCATE("login.garena.vn")) ||
        strstr(src, OBFUSCATE("ff.support.garena.vn")) ||
        strstr(src, OBFUSCATE("garena.net")) ||
        strstr(src, OBFUSCATE("support.garena.vn")) ||
        strstr(src, OBFUSCATE("ff.support.garena.com")) ||
        strstr(src, OBFUSCATE("ffm.garena.com")) ||
        strstr(src, OBFUSCATE("ffmax.garena.com")) ||
        strstr(src, OBFUSCATE("login.garena.com")) ||
        strstr(src, OBFUSCATE("help.garena.com")) ||
        strstr(src, OBFUSCATE("support.garena.com")) ||
        strstr(src, OBFUSCATE("coccoc.com")) ||
        strstr(src, OBFUSCATE("m.youtube.com")) ||
        strstr(src, OBFUSCATE("youtube.com")) ||
        strstr(src, OBFUSCATE("sso.garena.com")) ||
        strstr(src, OBFUSCATE("napthe.vn")) ||
        strstr(src, OBFUSCATE("hotro.ff.garena.vn")) ||
        strstr(src, OBFUSCATE("memuplay.com")) ||
        strstr(src, OBFUSCATE("apple.com")) ||
        strstr(src, OBFUSCATE("apps.apple.com")) ||
        strstr(src, OBFUSCATE("play.google.com")) ||
        strstr(src, OBFUSCATE("ffodownload.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("freefire.net")) ||
        strstr(src, OBFUSCATE("freefireadvance.net")) ||
        strstr(src, OBFUSCATE("100067.ff.connect.garena.com")) ||
        strstr(src, OBFUSCATE("100067.ff.connect.garena.vn")) ||
        strstr(src, OBFUSCATE("100067.connect.garena.com")) ||
        strstr(src, OBFUSCATE("100067.connect.garena.vn")) ||
        strstr(src, OBFUSCATE("ggbluefox.com")) ||
        strstr(src, OBFUSCATE("access.line.me")) ||
        strstr(src, OBFUSCATE("api.twitter.com")) ||
        strstr(src, OBFUSCATE("testbeepost.garenanow.com")) ||
        strstr(src, OBFUSCATE("beepost.garenanow.com")) ||
        strstr(src, OBFUSCATE("oauth.vk.com")) ||
        strstr(src, OBFUSCATE("developers.facebook.com")) ||
        strstr(src, OBFUSCATE("accounts.google.com")) ||
        strstr(src, OBFUSCATE("pagead2.googlesyndication.com")) ||
        strstr(src, OBFUSCATE("firebase-settings.crashlytics.com")) ||
        strstr(src, OBFUSCATE("issuetracker.google.com")) ||
        strstr(src, OBFUSCATE("firebase.google.com")) ||
        strstr(src, OBFUSCATE("googleapis.com")) ||
        strstr(src, OBFUSCATE("connect.garena.com")) ||
        strstr(src, OBFUSCATE("devmsdk.garena.com")) ||
        strstr(src, OBFUSCATE("testmsdk.garena.com")) ||
        strstr(src, OBFUSCATE("msdk.garena.com")) ||
        strstr(src, OBFUSCATE("devconnect.garena.com")) ||
        strstr(src, OBFUSCATE("testconnect.garena.com")) ||
        strstr(src, OBFUSCATE("facebook.com")) ||
        strstr(src, OBFUSCATE("grtc.garenanow.com")) ||
        strstr(src, OBFUSCATE("ff.sdk.grtc.garenanow.com")) ||
        strstr(src, OBFUSCATE("gcdsdk.appsflyer.com")) ||
        strstr(src, OBFUSCATE("freefiremobile-a.akamaihd.net")) ||
        strstr(src, OBFUSCATE("app-measurement.com")) ||
        strstr(src, OBFUSCATE("cdn-settings.appsflyersdk.com")) ||
        strstr(src, OBFUSCATE("dl-ind-production.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("ffmconnect.live.gop.garenanow.com")) ||
        strstr(src, OBFUSCATE("csoversea.stronghold.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("gin.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("optimizationguide-pa.googleapis.com")) ||
        strstr(src, OBFUSCATE("gsxnj.cn")) ||
        strstr(src, OBFUSCATE("conversions.appsflyer.com")) ||
        strstr(src, OBFUSCATE("tobapplog.ctobsnssdk.com")) ||
        strstr(src, OBFUSCATE("ffmmsdk.live.gop.garenanow.com")) ||
        strstr(src, OBFUSCATE("graph.facebook.com")) ||
        strstr(src, OBFUSCATE("dl-gmc.ggbluefox.com")) ||
        strstr(src, OBFUSCATE("dl.cdn.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("dl.tata.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("dl.dir.freefiremobile.com")) ||
        strstr(src, OBFUSCATE("garenanow.com")) ||
        strstr(src, OBFUSCATE("akamaiedge.net")) ||
        strstr(src, OBFUSCATE("freefiremobile.com")) ||
        strstr(src, OBFUSCATE("garena.vn")) ||
        strstr(src, OBFUSCATE("garena.com")) ||
        strstr(src, OBFUSCATE("dl.listdl.com")) ||
        strstr(src, OBFUSCATE("listdl.com")) ||
        strstr(src, OBFUSCATE("hocal.com")) ||
        strstr(src, OBFUSCATE("gopapi.io")) ||
        strstr(src, OBFUSCATE("appflyer.com")) ||
        strstr(src, OBFUSCATE("akamai.net")) ||
        strstr(src, OBFUSCATE("1e100.net")) ||
        strstr(src, OBFUSCATE("appsflyersdk.com")) ||
        strstr(src, OBFUSCATE("ff.garena.vn")) ||
        strstr(src, OBFUSCATE("localhost.localdomain")) ||
        strstr(src, OBFUSCATE("ff.garena.com")) ||
        strstr(src, OBFUSCATE("fakegame.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("pokemonunite.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("public-dataproxy.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("credit.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("act.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("gamesafe.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("dump.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("cgi.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("wknet-ac2.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("riot-mtp.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("defender1.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("wkchannel.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("mtp.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("usa.csoversea.mbgame.anticheatexpert.com")) ||
        strstr(src, OBFUSCATE("akamaihd.net"))

        ) {
            XXX = 0;
        } else {
            XXX = 1;
        }
        originalInetPton(af, src, dst);
    
        if (af == AF_INET) {
            struct in_addr * ipv4 = (struct in_addr * ) dst;
            inet_ntop(af, ipv4, ip, INET6_ADDRSTRLEN);
        } else if (af == AF_INET6) {
            struct in6_addr * ipv6 = (struct in6_addr * ) dst;
            inet_ntop(af, ipv6, ip, INET6_ADDRSTRLEN);
        } else {
            return;
        }
	}
}

int hookedGetAddrInfo(const char * node, const char * service, const struct addrinfo * hints, struct addrinfo ** res) {
    int result = originalGetAddrInfo(node, service, hints, res);
    if (result == 0 && * res != NULL) {
		if (Firewall) {
            char ip[INET6_ADDRSTRLEN];
            struct sockaddr * addr = ( * res) -> ai_addr;

            if (addr -> sa_family == AF_INET) {
                struct sockaddr_in * ipv4 = (struct sockaddr_in * ) addr;
                inet_ntop(AF_INET, & (ipv4 -> sin_addr), ip, INET6_ADDRSTRLEN);
            } else if (addr -> sa_family == AF_INET6) {
                struct sockaddr_in6 * ipv6 = (struct sockaddr_in6 * ) addr;
                inet_ntop(AF_INET6, & (ipv6 -> sin6_addr), ip, INET6_ADDRSTRLEN);
            } else {
                return -2;
            }

            if (strstr(node, OBFUSCATE("ff.dr.grtc.garenanow.com")) ||
        strstr(node, OBFUSCATE("dl.")) ||
        strstr(node, OBFUSCATE("dl-")) ||
        strstr(node, OBFUSCATE(".cn")) ||
        strstr(node, OBFUSCATE("google")) ||
        strstr(node, OBFUSCATE("164.")) ||
        strstr(node, OBFUSCATE("103.16.33.136")) ||
        strstr(node, OBFUSCATE("103.16.33.")) ||
        strstr(node, OBFUSCATE("dl.")) ||
        strstr(node, OBFUSCATE("dl-")) ||
        strstr(node, OBFUSCATE("64.")) ||
        strstr(node, OBFUSCATE("60.")) ||
        strstr(node, OBFUSCATE("63.")) ||
        strstr(node, OBFUSCATE("56.")) ||
        strstr(node, OBFUSCATE("164.52.102.")) ||
        strstr(node, OBFUSCATE("49.45.0.1")) ||
        strstr(node, OBFUSCATE("202.81.117.88")) ||
        strstr(node, OBFUSCATE("202.81.117.")) ||
        strstr(node, OBFUSCATE("202.81.118.4")) ||
        strstr(node, OBFUSCATE("202.81.118.")) ||
        strstr(node, OBFUSCATE("103.219.201.93")) ||
        strstr(node, OBFUSCATE("103.219.201.")) ||
        strstr(node, OBFUSCATE("199.59.243.225")) ||
        strstr(node, OBFUSCATE("199.")) ||
        strstr(node, OBFUSCATE("127.0.0.0")) ||
        strstr(node, OBFUSCATE("184.183.0.1")) ||
        strstr(node, OBFUSCATE("156.59.187.38")) ||
        strstr(node, OBFUSCATE("129.227.210.98")) ||
        strstr(node, OBFUSCATE("202.81.118.4")) ||
        strstr(node, OBFUSCATE("202.81.117.22")) ||
        strstr(node, OBFUSCATE("143.92.120.31")) ||
        strstr(node, OBFUSCATE("143.92.120.29")) ||
        strstr(node, OBFUSCATE("143.92.120.30")) ||
        strstr(node, OBFUSCATE("129.227.202.238")) ||
        strstr(node, OBFUSCATE("202.81.108.107")) ||
        strstr(node, OBFUSCATE("202.81.109.230")) ||
        strstr(node, OBFUSCATE("129.227.20.170")) ||
        strstr(node, OBFUSCATE("127.0.0.53")) ||
        strstr(node, OBFUSCATE("192.168.0.1")) ||
        strstr(node, OBFUSCATE("203.116.180.99")) ||
        strstr(node, OBFUSCATE("150.109.185.81")) ||
        strstr(node, OBFUSCATE("192.168.31.1")) ||
        strstr(node, OBFUSCATE("192.0.2.111")) ||
        strstr(node, OBFUSCATE("192.168.1.1")) ||
        strstr(node, OBFUSCATE("192.168.31")) ||
        strstr(node, OBFUSCATE("192.168.0")) ||
        strstr(node, OBFUSCATE("192.168.1")) ||
        strstr(node, OBFUSCATE("10.196.138.200")) ||
        strstr(node, OBFUSCATE("10.0.0.1")) ||
        strstr(node, OBFUSCATE("10.0.0.16")) ||
        strstr(node, OBFUSCATE("10.0.0.17")) ||
        strstr(node, OBFUSCATE("10.0.0.27")) ||
        strstr(node, OBFUSCATE("1.1.1.1")) ||
        strstr(node, OBFUSCATE("8.8.8.8")) ||
        strstr(node, OBFUSCATE("8.8.4.4")) ||
        strstr(node, OBFUSCATE("114.114.114.114")) ||
        strstr(node, OBFUSCATE("162.62.64.207")) ||
        strstr(node, OBFUSCATE("49.51.133.79")) ||
        strstr(node, OBFUSCATE("162.62.52.132")) ||
        strstr(node, OBFUSCATE("23.45.233.27")) ||
        strstr(node, OBFUSCATE("23.45.233.51")) ||
        strstr(node, OBFUSCATE("203.205.253.140")) ||
        strstr(node, OBFUSCATE("203.205.253.183")) ||
        strstr(node, OBFUSCATE("203.205.219.94")) ||
        strstr(node, OBFUSCATE("203.205.235.145")) ||
        strstr(node, OBFUSCATE("101.32.143.247")) ||
        strstr(node, OBFUSCATE("119.28.145.130")) ||
        strstr(node, OBFUSCATE("49.51.42.152")) ||
        strstr(node, OBFUSCATE("129.226.23.104")) ||
        strstr(node, OBFUSCATE("101.32.85.212")) ||
        strstr(node, OBFUSCATE("170.106.134.228")) ||
        strstr(node, OBFUSCATE("170.106.134.222")) ||
        strstr(node, OBFUSCATE("182.254.116.117")) ||
        strstr(node, OBFUSCATE("49.51.185.106")) ||
        strstr(node, OBFUSCATE("49.51.177.92")) ||
        strstr(node, OBFUSCATE("150.109.28.218")) ||
        strstr(node, OBFUSCATE("211.152.148.43")) ||
        strstr(node, OBFUSCATE("119.28.147.156")) ||
        strstr(node, OBFUSCATE("49.51.66.225")) ||
        strstr(node, OBFUSCATE("101.32.88.8")) ||
        strstr(node, OBFUSCATE("124.156.33.49")) ||
        strstr(node, OBFUSCATE("101.32.85.132")) ||
        strstr(node, OBFUSCATE("124.156.12.61")) ||
        strstr(node, OBFUSCATE("101.32.89.158")) ||
        strstr(node, OBFUSCATE("129.226.22.158")) ||
        strstr(node, OBFUSCATE("124.132.152.79")) ||
        strstr(node, OBFUSCATE("103.91.209.223")) ||
        strstr(node, OBFUSCATE("203.205.254.157")) ||
        strstr(node, OBFUSCATE("121.51.142.21")) ||
        strstr(node, OBFUSCATE("112.53.26.232")) ||
        strstr(node, OBFUSCATE("111.30.144.71")) ||
        strstr(node, OBFUSCATE("61.129.7.47")) ||
        strstr(node, OBFUSCATE("183.3.226.35")) ||
        strstr(node, OBFUSCATE("123.151.137.18")) ||
        strstr(node, OBFUSCATE("58.250.137.36")) ||
        strstr(node, OBFUSCATE("211.152.136.124")) ||
        strstr(node, OBFUSCATE("101.33.29.196")) ||
        strstr(node, OBFUSCATE("101.33.29.254")) ||
        strstr(node, OBFUSCATE("43.132.66.184")) ||
        strstr(node, OBFUSCATE("87.245.210.7")) ||
        strstr(node, OBFUSCATE("43.132.66.175")) ||
        strstr(node, OBFUSCATE("211.152.148.99")) ||
        strstr(node, OBFUSCATE("211.152.148.72")) ||
        strstr(node, OBFUSCATE("211.152.148.77")) ||
        strstr(node, OBFUSCATE("211.152.146.111")) ||
        strstr(node, OBFUSCATE("211.152.147.12")) ||
        strstr(node, OBFUSCATE("43.132.66.176")) ||
        strstr(node, OBFUSCATE("211.152.148.87")) ||
        strstr(node, OBFUSCATE("211.152.148.84")) ||
        strstr(node, OBFUSCATE("211.152.149.16")) ||
        strstr(node, OBFUSCATE("211.152.148.43")) ||
        strstr(node, OBFUSCATE("211.152.148.78")) ||
        strstr(node, OBFUSCATE("119.28.165.55")) ||
        strstr(node, OBFUSCATE("119.28.165.56")) ||
        strstr(node, OBFUSCATE("203.205.137.123")) ||
        strstr(node, OBFUSCATE("119.28.164.234")) ||
        strstr(node, OBFUSCATE("203.205.137.254")) ||
        strstr(node, OBFUSCATE("203.205.136.62")) ||
        strstr(node, OBFUSCATE("203.205.136.55")) ||
        strstr(node, OBFUSCATE("150.109.207.121")) ||
        strstr(node, OBFUSCATE("101.33.11.25")) ||
        strstr(node, OBFUSCATE("101.33.10.114")) ||
        strstr(node, OBFUSCATE("101.33.11.45")) ||
        strstr(node, OBFUSCATE("101.33.11.110")) ||
        strstr(node, OBFUSCATE("101.33.11.88")) ||
        strstr(node, OBFUSCATE("101.33.11.29")) ||
        strstr(node, OBFUSCATE("101.33.10.52")) ||
        strstr(node, OBFUSCATE("101.33.11.48")) ||
        strstr(node, OBFUSCATE("203.205.224.59")) ||
        strstr(node, OBFUSCATE("211.152.148.71")) ||
        strstr(node, OBFUSCATE("211.152.148.29")) ||
        strstr(node, OBFUSCATE("211.152.148.44")) ||
        strstr(node, OBFUSCATE("211.152.148.30")) ||
        strstr(node, OBFUSCATE("49.51.224.95")) ||
        strstr(node, OBFUSCATE("211.152.146.73")) ||
        strstr(node, OBFUSCATE("203.205.191.27")) ||
        strstr(node, OBFUSCATE("211.152.146.86")) ||
        strstr(node, OBFUSCATE("203.205.191.24")) ||
        strstr(node, OBFUSCATE("211.152.146.99")) ||
        strstr(node, OBFUSCATE("211.152.146.87")) ||
        strstr(node, OBFUSCATE("211.152.146.88")) ||
        strstr(node, OBFUSCATE("211.152.146.88")) ||
        strstr(node, OBFUSCATE("211.152.146.90")) ||
        strstr(node, OBFUSCATE("211.152.146.98")) ||
        strstr(node, OBFUSCATE("203.205.191.22")) ||
        strstr(node, OBFUSCATE("211.152.146.97")) ||
        strstr(node, OBFUSCATE("203.205.191.21")) ||
        strstr(node, OBFUSCATE("211.152.136.71")) ||
        strstr(node, OBFUSCATE("211.152.136.42")) ||
        strstr(node, OBFUSCATE("211.152.136.90")) ||
        strstr(node, OBFUSCATE("211.152.136.89")) ||
        strstr(node, OBFUSCATE("211.152.136.88")) ||
        strstr(node, OBFUSCATE("211.152.136.41")) ||
        strstr(node, OBFUSCATE("211.152.136.77")) ||
        strstr(node, OBFUSCATE("211.152.136.73")) ||
        strstr(node, OBFUSCATE("211.152.136.87")) ||
        strstr(node, OBFUSCATE("23.248.167.156")) ||
        strstr(node, OBFUSCATE("211.152.137.14")) ||
        strstr(node, OBFUSCATE("23.248.167.30")) ||
        strstr(node, OBFUSCATE("23.248.167.12")) ||
        strstr(node, OBFUSCATE("23.248.167.10")) ||
        strstr(node, OBFUSCATE("23.248.167.27")) ||
        strstr(node, OBFUSCATE("23.248.167.15")) ||
        strstr(node, OBFUSCATE("23.248.167.11")) ||
        strstr(node, OBFUSCATE("23.248.167.13")) ||
        strstr(node, OBFUSCATE("23.248.167.26")) ||
        strstr(node, OBFUSCATE("107.20.137.106")) ||
        strstr(node, OBFUSCATE("107.20.137.139")) ||
        strstr(node, OBFUSCATE("107.20.138.96")) ||
        strstr(node, OBFUSCATE("107.20.143.4")) ||
        strstr(node, OBFUSCATE("107.20.148.112")) ||
        strstr(node, OBFUSCATE("107.20.150.120")) ||
        strstr(node, OBFUSCATE("107.20.150.222")) ||
        strstr(node, OBFUSCATE("107.20.151.64")) ||
        strstr(node, OBFUSCATE("107.20.152.92")) ||
        strstr(node, OBFUSCATE("107.20.160.105")) ||
        strstr(node, OBFUSCATE("107.20.164.17")) ||
        strstr(node, OBFUSCATE("107.20.179.226")) ||
        strstr(node, OBFUSCATE("107.20.179.70")) ||
        strstr(node, OBFUSCATE("107.20.185.119")) ||
        strstr(node, OBFUSCATE("107.20.189.226")) ||
        strstr(node, OBFUSCATE("107.20.197.3")) ||
        strstr(node, OBFUSCATE("107.20.200.150")) ||
        strstr(node, OBFUSCATE("107.20.216.34")) ||
        strstr(node, OBFUSCATE("107.20.218.245")) ||
        strstr(node, OBFUSCATE("107.20.219.22")) ||
        strstr(node, OBFUSCATE("107.20.222.132")) ||
        
        strstr(node, OBFUSCATE("uic-cn.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("wkchannelone.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("service.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("cschannel.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("tqos.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("downintl.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("nj.cschannel.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("global.cschannel.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("ff.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("dns.qq.com")) ||
        strstr(node, OBFUSCATE("court.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("ctp.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("intl.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("intltest.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("defender.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("tqos-yun.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("uic.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("vip.qq.com")) ||
        strstr(node, OBFUSCATE("usa.csoversea.mbgame.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("anticheat.ini")) ||
        strstr(node, OBFUSCATE("my.mobfox.com")) ||
        strstr(node, OBFUSCATE("vpn.jxufe.edu.cn")) ||
        strstr(node, OBFUSCATE("qzone.com")) ||
        strstr(node, OBFUSCATE("voice.gcloudcs.com")) ||
        strstr(node, OBFUSCATE("tdm.qq.com")) ||
        strstr(node, OBFUSCATE("helpshift.com")) ||
        strstr(node, OBFUSCATE("tencent.com")) ||
        strstr(node, OBFUSCATE("pandora.com")) ||
        strstr(node, OBFUSCATE("pubgmobile.com")) ||
        strstr(node, OBFUSCATE("xinyue.qq.com")) ||
        strstr(node, OBFUSCATE("btrace.qq.com")) ||
        strstr(node, OBFUSCATE("qun.qq.com")) ||
        strstr(node, OBFUSCATE("y.qq.com")) ||
        strstr(node, OBFUSCATE("i.qq.com")) ||
        strstr(node, OBFUSCATE("mvn.public.igamecj.com")) ||
        strstr(node, OBFUSCATE("mvn.lobby.igamecj.com")) ||
        strstr(node, OBFUSCATE("lgl.public.igamecj.com")) ||
        strstr(node, OBFUSCATE("lgl.lobby.igamecj.com")) ||
        strstr(node, OBFUSCATE("lobby-gray.igamecj.com")) ||
        strstr(node, OBFUSCATE("freeqqm.qq.com")) ||
        strstr(node, OBFUSCATE("daohang.qq.com")) ||
        strstr(node, OBFUSCATE("euspeed.igamecj.com")) ||
        strstr(node, OBFUSCATE("krlobby.igamecj.com")) ||
        strstr(node, OBFUSCATE("wtlogin.qq.com")) ||
        strstr(node, OBFUSCATE("aegis.qq.com")) ||
        strstr(node, OBFUSCATE("imgcache.qq.com")) ||
        strstr(node, OBFUSCATE("sportsnba.qq.com")) ||
        strstr(node, OBFUSCATE("d3g.qq.com")) ||
        strstr(node, OBFUSCATE("docs.qq.com")) ||
        strstr(node, OBFUSCATE("wj.qq.com")) ||
        strstr(node, OBFUSCATE("jsapi.qq.com")) ||
        strstr(node, OBFUSCATE("iqqidip.mtown.qq.com")) ||
        strstr(node, OBFUSCATE("group.store.qq.com")) ||
        strstr(node, OBFUSCATE("qq.com")) ||
        strstr(node, OBFUSCATE("sgspeed.igamecj.com")) ||
        strstr(node, OBFUSCATE("sg.tdatamaster.com")) ||
        strstr(node, OBFUSCATE("group.qpic.cn")) ||
        strstr(node, OBFUSCATE("hkping.igamecj.com")) ||
        strstr(node, OBFUSCATE("as-sg.shadow.igamecj.com")) ||
        strstr(node, OBFUSCATE("3003-shadow.igamecj.com")) ||
        strstr(node, OBFUSCATE("as-sg.shadow.igamecj.com.0.1.adiosfil.roksit.net")) ||
        strstr(node, OBFUSCATE("bizapp.qq.com")) ||
        strstr(node, OBFUSCATE("3g.qq.com")) ||
        strstr(node, OBFUSCATE("sighttp.qq.com")) ||
        strstr(node, OBFUSCATE("filegcp.igamecj.com")) ||
        strstr(node, OBFUSCATE("ic.qq.com")) ||
        strstr(node, OBFUSCATE("sports.qq.com")) ||
        strstr(node, OBFUSCATE("pingfore.qq.com")) ||
        strstr(node, OBFUSCATE("t.qq.com")) ||
        strstr(node, OBFUSCATE("qzone.qq.com")) ||
        strstr(node, OBFUSCATE("eafifa.qq.com")) ||
        strstr(node, OBFUSCATE("im.qq.com")) ||
        strstr(node, OBFUSCATE("naping.igamecj.com")) ||
        strstr(node, OBFUSCATE("de.voice.gcloudcs.com")) ||
        strstr(node, OBFUSCATE("ptlogin2.qq.com")) ||
        strstr(node, OBFUSCATE("reports.crashlytics.com")) ||
        strstr(node, OBFUSCATE("aung.com")) ||
        strstr(node, OBFUSCATE("ig-us-notice.igamecj.com")) ||
        strstr(node, OBFUSCATE("4006-shadow.igamecj.com")) ||
        strstr(node, OBFUSCATE("tsg.tdatamaster.com")) ||
        strstr(node, OBFUSCATE("a.shifen.com")) ||
        strstr(node, OBFUSCATE("app.sparta.mig.tencent-cloud.net")) ||
        strstr(node, OBFUSCATE("simhub.tencent.com")) ||
        strstr(node, OBFUSCATE("ipv6.mainconn.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("adserver.admin.helpshift.com")) ||
        strstr(node, OBFUSCATE("nawzryhwatm.broker.amsoveasea.com")) ||
        strstr(node, OBFUSCATE("file.igamecj.com")) ||
        strstr(node, OBFUSCATE("pandora.game.qq.com")) ||
        strstr(node, OBFUSCATE("capandora.game.qq.com")) ||
        strstr(node, OBFUSCATE("tencentgames.helpshift.com")) ||
        strstr(node, OBFUSCATE("napubgm.broker.amsoveasea.com")) ||
        strstr(node, OBFUSCATE("cloud.gsdk.proximabeta.com")) ||
        strstr(node, OBFUSCATE("down.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("pandoracdn.amsoveasea.com")) ||
        strstr(node, OBFUSCATE("asia.csoversea.mbgame.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("cn.voice.gcloudcs.com")) ||
        strstr(node, OBFUSCATE("a1939.w10.akamai.net")) ||
        strstr(node, OBFUSCATE("garena-call-of-duty.firebaseio.com")) ||
        strstr(node, OBFUSCATE("crashreporter.beetalkmobile.com")) ||
        strstr(node, OBFUSCATE("tapjoy.jp")) ||
        strstr(node, OBFUSCATE("tapjoy.com")) ||
        strstr(node, OBFUSCATE("client.ind.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("ind.event.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("dl.castle.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("version.common.ffmax.garena.com")) ||
        strstr(node, OBFUSCATE("login.common.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("ffguide.garena.com")) ||
        strstr(node, OBFUSCATE("astat.bugly.qcloud.com")) ||
        strstr(node, OBFUSCATE("entireweb.com")) ||
        strstr(node, OBFUSCATE("envolk.com")) ||
        strstr(node, OBFUSCATE("dotnetdotcom.org")) ||
        strstr(node, OBFUSCATE("msn.com")) ||
        strstr(node, OBFUSCATE("search.msn.com")) ||
        strstr(node, OBFUSCATE("yahoo.com")) ||
        strstr(node, OBFUSCATE("help.yahoo.com")) ||
        strstr(node, OBFUSCATE("garykeith.com")) ||
        strstr(node, OBFUSCATE("browsers.garykeith.com")) ||
        strstr(node, OBFUSCATE("devconnect.garena.vn")) ||
        strstr(node, OBFUSCATE("devmsdk.garena.vn")) ||
        strstr(node, OBFUSCATE("msdk.garena.vn")) ||
        strstr(node, OBFUSCATE("login.garena.vn")) ||
        strstr(node, OBFUSCATE("ff.support.garena.vn")) ||
        strstr(node, OBFUSCATE("garena.net")) ||
        strstr(node, OBFUSCATE("support.garena.vn")) ||
        strstr(node, OBFUSCATE("ff.support.garena.com")) ||
        strstr(node, OBFUSCATE("ffm.garena.com")) ||
        strstr(node, OBFUSCATE("ffmax.garena.com")) ||
        strstr(node, OBFUSCATE("login.garena.com")) ||
        strstr(node, OBFUSCATE("help.garena.com")) ||
        strstr(node, OBFUSCATE("support.garena.com")) ||
        strstr(node, OBFUSCATE("coccoc.com")) ||
        strstr(node, OBFUSCATE("m.youtube.com")) ||
        strstr(node, OBFUSCATE("youtube.com")) ||
        strstr(node, OBFUSCATE("sso.garena.com")) ||
        strstr(node, OBFUSCATE("napthe.vn")) ||
        strstr(node, OBFUSCATE("hotro.ff.garena.vn")) ||
        strstr(node, OBFUSCATE("memuplay.com")) ||
        strstr(node, OBFUSCATE("apple.com")) ||
        strstr(node, OBFUSCATE("apps.apple.com")) ||
        strstr(node, OBFUSCATE("play.google.com")) ||
        strstr(node, OBFUSCATE("ffodownload.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("freefire.net")) ||
        strstr(node, OBFUSCATE("freefireadvance.net")) ||
        strstr(node, OBFUSCATE("100067.ff.connect.garena.com")) ||
        strstr(node, OBFUSCATE("100067.ff.connect.garena.vn")) ||
        strstr(node, OBFUSCATE("100067.connect.garena.com")) ||
        strstr(node, OBFUSCATE("100067.connect.garena.vn")) ||
        strstr(node, OBFUSCATE("ggbluefox.com")) ||
        strstr(node, OBFUSCATE("access.line.me")) ||
        strstr(node, OBFUSCATE("api.twitter.com")) ||
        strstr(node, OBFUSCATE("testbeepost.garenanow.com")) ||
        strstr(node, OBFUSCATE("beepost.garenanow.com")) ||
        strstr(node, OBFUSCATE("oauth.vk.com")) ||
        strstr(node, OBFUSCATE("developers.facebook.com")) ||
        strstr(node, OBFUSCATE("accounts.google.com")) ||
        strstr(node, OBFUSCATE("pagead2.googlesyndication.com")) ||
        strstr(node, OBFUSCATE("firebase-settings.crashlytics.com")) ||
        strstr(node, OBFUSCATE("issuetracker.google.com")) ||
        strstr(node, OBFUSCATE("firebase.google.com")) ||
        strstr(node, OBFUSCATE("googleapis.com")) ||
        strstr(node, OBFUSCATE("connect.garena.com")) ||
        strstr(node, OBFUSCATE("devmsdk.garena.com")) ||
        strstr(node, OBFUSCATE("testmsdk.garena.com")) ||
        strstr(node, OBFUSCATE("msdk.garena.com")) ||
        strstr(node, OBFUSCATE("devconnect.garena.com")) ||
        strstr(node, OBFUSCATE("testconnect.garena.com")) ||
        strstr(node, OBFUSCATE("facebook.com")) ||
        strstr(node, OBFUSCATE("grtc.garenanow.com")) ||
        strstr(node, OBFUSCATE("ff.sdk.grtc.garenanow.com")) ||
        strstr(node, OBFUSCATE("gcdsdk.appsflyer.com")) ||
        strstr(node, OBFUSCATE("freefiremobile-a.akamaihd.net")) ||
        strstr(node, OBFUSCATE("app-measurement.com")) ||
        strstr(node, OBFUSCATE("cdn-settings.appsflyersdk.com")) ||
        strstr(node, OBFUSCATE("dl-ind-production.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("ffmconnect.live.gop.garenanow.com")) ||
        strstr(node, OBFUSCATE("csoversea.stronghold.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("gin.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("optimizationguide-pa.googleapis.com")) ||
        strstr(node, OBFUSCATE("gsxnj.cn")) ||
        strstr(node, OBFUSCATE("conversions.appsflyer.com")) ||
        strstr(node, OBFUSCATE("tobapplog.ctobsnssdk.com")) ||
        strstr(node, OBFUSCATE("ffmmsdk.live.gop.garenanow.com")) ||
        strstr(node, OBFUSCATE("graph.facebook.com")) ||
        strstr(node, OBFUSCATE("dl-gmc.ggbluefox.com")) ||
        strstr(node, OBFUSCATE("dl.cdn.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("dl.tata.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("dl.dir.freefiremobile.com")) ||
        strstr(node, OBFUSCATE("garenanow.com")) ||
        strstr(node, OBFUSCATE("akamaiedge.net")) ||
        strstr(node, OBFUSCATE("freefiremobile.com")) ||
        strstr(node, OBFUSCATE("garena.vn")) ||
        strstr(node, OBFUSCATE("garena.com")) ||
        strstr(node, OBFUSCATE("dl.listdl.com")) ||
        strstr(node, OBFUSCATE("listdl.com")) ||
        strstr(node, OBFUSCATE("hocal.com")) ||
        strstr(node, OBFUSCATE("gopapi.io")) ||
        strstr(node, OBFUSCATE("appflyer.com")) ||
        strstr(node, OBFUSCATE("akamai.net")) ||
        strstr(node, OBFUSCATE("1e100.net")) ||
        strstr(node, OBFUSCATE("appsflyersdk.com")) ||
        strstr(node, OBFUSCATE("ff.garena.vn")) ||
        strstr(node, OBFUSCATE("localhost.localdomain")) ||
        strstr(node, OBFUSCATE("ff.garena.com")) ||
        strstr(node, OBFUSCATE("fakegame.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("pokemonunite.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("public-dataproxy.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("credit.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("act.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("gamesafe.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("dump.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("cgi.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("wknet-ac2.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("riot-mtp.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("defender1.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("wkchannel.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("mtp.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("usa.csoversea.mbgame.anticheatexpert.com")) ||
        strstr(node, OBFUSCATE("akamaihd.net"))
               ) {
                   XXX = 0;
                   return -1;
               } else {
                   XXX = 1;
                   return result;
               }
        }
    }
}

struct hostent * hookedGetHostByAddr(const void * addr, socklen_t len, int type) {
    struct hostent * result = originalGetHostByAddr(addr, len, type);
    if (result != NULL) {
        char ip[INET6_ADDRSTRLEN];
        inet_ntop(type, result -> h_addr_list[0], ip, INET6_ADDRSTRLEN);
    }
    return result;
}

struct hostent * hookedGetHostByName(const char * name) {
    struct hostent * result = originalGetHostByName(name);
    if (result != NULL) {
        char ip[INET6_ADDRSTRLEN];
        inet_ntop(result -> h_addrtype, result -> h_addr_list[0], ip, INET6_ADDRSTRLEN);
    }
    return result;
}

int hookedSocket(int domain, int type, int protocol) {
    struct sockaddr_in addr;
    socklen_t addr_len = sizeof(addr);
    int sockfd = originalSocket(domain, type, protocol);
    if (XXX == 0) {
        close(sockfd);
        return -2;
    }
    return sockfd;
}

int hookedConnect(int sockfd, const struct sockaddr * addr, socklen_t addrlen) {
    struct sockaddr_in * addr_in = (struct sockaddr_in * ) addr;
    if (XXX == 0) {
        return -2;
    }
    return originalConnect(sockfd, addr, addrlen);
}

void( * original_system_property_get)(const char * , char * );
void hooked_system_property_get(const char * name, char * value) {
    if (strcmp(name, "ro.hardware") == 0) {
        strcpy(value, "qualcom");
        printf("Modified hardware name: %s\n", value);
        return;
    }
    original_system_property_get(name, value);
}

char * ( * originalStrstr)(const char * haystack, const char * needle);
char * hookedStrstr(const char * haystack, const char * needle) {
    if (strstr(haystack, "vphonegaga") != nullptr) {
        char * modifiedHaystack = strdup(haystack);
        char * occurrence = strstr(modifiedHaystack, "crash6455");
        if (occurrence != nullptr) {
            strncpy(occurrence, "blocked", strlen("blocked"));
        }
        return originalStrstr(haystack, needle);
    }
    return originalStrstr(haystack, needle);
}

pid_t my_pid = getpid();
ssize_t( * original_send)(int sockfd, const void * buf, size_t len, int flags);
ssize_t hooked_send(int sockfd, const void * buf, size_t len, int flags) {
    return original_send(sockfd, buf, len, flags);
}

ssize_t( * original_recv)(int sockfd, void * buf, size_t len, int flags);
ssize_t( * original_recvfrom)(int sockfd, void * buf, size_t len, int flags, struct sockaddr * src_addr, socklen_t * addrlen);
ssize_t( * original_sendto)(int sockfd, const void * buf, size_t len, int flags, const struct sockaddr * dest_addr, socklen_t addrlen);
ssize_t hooked_recv(int sockfd, void * buf, size_t len, int flags) {
    return original_recv(sockfd, buf, len, flags);
}

ssize_t hooked_recvfrom(int sockfd, void * buf, size_t len, int flags, struct sockaddr * src_addr, socklen_t * addrlen) {
    return original_recvfrom(sockfd, buf, len, flags, src_addr, addrlen);
}

ssize_t hooked_sendto(int sockfd, const void * buf, size_t len, int flags, const struct sockaddr * dest_addr, socklen_t addrlen) {
    return original_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
}

void hookFunctions() {
    void * handle = dlopen("libil2cpp.so", RTLD_LAZY);
    if (handle == NULL) {
        return;
    }
    originalSocket = (SocketFunc) dlsym(handle, "socket");
    originalConnect = (ConnectFunc) dlsym(handle, "connect");
    originalInetPton = (int( * )(int, const char * , void * )) dlsym(handle, "inet_pton");
    originalGetAddrInfo = (int( * )(const char * , const char * , const struct addrinfo * , struct addrinfo ** )) dlsym(handle, "getaddrinfo");
    originalGetHostByAddr = (struct hostent * ( * )(const void * , socklen_t, int)) dlsym(handle, "gethostbyaddr");
    originalGetHostByName = (struct hostent * ( * )(const char * )) dlsym(handle, "gethostbyname");
    original_system_property_get = (void( * )(const char * , char * )) dlsym(handle, "__system_property_get");
    originalStrstr = (char * ( * )(const char * , const char * )) dlsym(handle, "strstr");
    original_send = (ssize_t( * )(int, const void * , size_t, int)) dlsym(handle, "send");
    original_recv = (ssize_t( * )(int, void * , size_t, int)) dlsym(handle, "recv");
    original_recvfrom = (ssize_t( * )(int, void * , size_t, int, struct sockaddr * , socklen_t * )) dlsym(handle, "recvfrom");
    original_sendto = (ssize_t( * )(int, const void * , size_t, int, const struct sockaddr * , socklen_t)) dlsym(handle, "sendto");
    
    if (originalSocket != NULL) {
        DobbyHook((void * ) originalSocket, (void * ) hookedSocket, (void ** ) & originalSocket);
    }
    if (originalConnect != NULL) {
        DobbyHook((void * ) originalConnect, (void * ) hookedConnect, (void ** ) & originalConnect);
    }
    if (originalInetPton != NULL) {
    DobbyHook((void * ) originalInetPton, (void * ) hookedInetPton, (void ** ) & originalInetPton);
    }
    if (originalGetAddrInfo != NULL) {
        DobbyHook((void * ) originalGetAddrInfo, (void * ) hookedGetAddrInfo, (void ** ) & originalGetAddrInfo);
    }
    
  dlclose(handle);
}
