ProtonOverflow / NoAnkama

A simple C# library that hooks ws2_32.dll!connect without a DLL. It can be useful for MITM Dofus.
17 stars 6 forks source link

Connect hook doest not work #2

Closed SDClowen closed 2 years ago

SDClowen commented 2 years ago

        private static bool HookWinSock(int processId, string ip, string redirectIp, int port)
        {
            var winSockHook = new WinsockHook(processId);
            winSockHook.SourceIPs = new List<IPAddress>
            {
                IPAddress.Parse(ip)
            };

            winSockHook.RemoteIP = new IPEndPoint(IPAddress.Parse(redirectIp), port);
            winSockHook.AllowReplace = true;

            winSockHook.OnHook += (sender, e) =>
            {
                Log.Debug("API function hooked !");
                PrintEventArgs(e);
            };

            winSockHook.OnUnhook += (sender, e) =>
            {
                Log.Debug("API function unhooked !");
                PrintEventArgs(e);
            };

            winSockHook.OnHookDetected += (sender, e) =>
            {
                Log.Debug("API function is already hooked !");
                PrintEventArgs(e);
            };

            return true;
        }

        HookWinSock(process.Id, "110.234.18.129", "127.0.0.1", 15779); // gwgt1.joymax.com
SDClowen commented 2 years ago

Fixed, i just forget to call the winSockHook.Hook();