EMO Style ForumPro - Hos Geldiniz
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 202 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: AnthonyFurey3

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Kimler hatta?
Toplam 4 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 4 Misafir

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 92 kişi Paz Ağus. 28, 2016 6:58 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
Cuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
Cuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
Çarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
Ptsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
C.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
Çarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
Çarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
Çarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
Ptsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

[CodeSnippet] - Clientless Code

Önceki başlık Sonraki başlık Aşağa gitmek

[CodeSnippet] - Clientless Code

Mesaj tarafından Hello EMO Bir Ptsi Tem. 08, 2013 6:22 am

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace xStall
{
    ///
    /// The base interface for various proxy models.
    ///

    interface IClient
    {
        event Action ToAnalyze;
        RemoteClient remoteClient { get; set; }
        ServerParser serverParser { get; set; }
        void InjectServerPacket(PacketWriter packet);
        void Start();
    }

    ///
    /// Game <-> proxy <-> server based interface.
    ///

    class Client : IClient
    {
        public ServerParser serverParser { get; set; }
        private ClientParser clientParser { get; set; }
        public RemoteClient remoteClient { get; set; }
        public LocalClient localClient { get; set; }
        private Client() { ;}
        public event Action ToAnalyze;

        ///
        /// Default constructor, which initializes all the necessary events.
        ///

        ///
        public Client(int listeningPort)
        {
            // Client parser.
            clientParser = new ClientParser();
            clientParser.Security.PacketReceived += new Action(clientParser.ParsePacket);
            clientParser.LocalSend += new Action(InjectGamePacket);
            clientParser.RemoteSend += new Action(InjectServerPacket);

            // Server parser.
            serverParser = new ServerParser();
            serverParser.Security.PacketReceived += new Action(serverParser.ParsePacket);
            serverParser.LocalSend += new Action(InjectGamePacket);
            serverParser.RemoteSend += new Action(InjectServerPacket);
            serverParser.HandshakeDone += new Action(parser_HandshakeDone);

            // Local client.
            localClient = new LocalClient(listeningPort);
            localClient.Connected += new Action(localClient_Connected);
            localClient.NewDataReceived += new Action(clientParser.Security.DecryptPacket);

            // Remote client.
            remoteClient = new RemoteClient();
            remoteClient.Connected += new Action(remote_Connected);
            remoteClient.NewDataReceived += new Action(serverParser.Security.DecryptPacket);
        }
        ///
        /// Called when the remote handshake has been successfully initialized.
        ///

        void parser_HandshakeDone()
        {
            Console.WriteLine("Handshake has been initialized.");
            InjectServerPacket(new PacketWriter(0x9000));
            clientParser.valiSent = true;
        }
        ///
        /// Called when game has been connected to proxy. Initializes handhshake.
        ///

        void localClient_Connected()
        {
            clientParser.Security.InitBlowfish(new byte[] { 0xD, 0x3, 0x3D, 0x3, 0x3, 0xD, 0x3, 0x1D });
            PacketWriter securityPacket = new PacketWriter(LoginOpcodes.Handshake, false);
            securityPacket.AppendArray(new byte[] { 0xE, 0x17, 0x7D, 0x4E, 0x92, 0x97, 0xF8, 0x8, 0xFE, 0x8A, 0x0, 0x0, 0x0, 0xF2, 0x0,
                0x0, 0x0, 0x85, 0xD8, 0x1D, 0x98, 0x28, 0xC7, 0x1C, 0xCF, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x4A, 0xCC, 0xEA, 0x22 });
            InjectGamePacket(securityPacket);
            remoteClient.Connect("212.24.57.34", 15779);
        }
        ///
        /// Called when proxy has been connected to remote server.
        ///

        void remote_Connected()
        {
            Console.WriteLine("Connected to the login server.");
        }
        ///
        /// Send packet to server.
        ///

        ///
        public void InjectServerPacket(PacketWriter packet)
        {
            PacketReader reader = new PacketReader(packet.GetPacket(), packet.Encrypted);            
            Console.WriteLine("[C->S]: " + reader.Opcode.ToString("X2"));
            remoteClient.Send(serverParser.Security.EncryptPacket(packet));
            if (ToAnalyze != null)
                ToAnalyze(reader, true);
        }
        ///
        /// Send packet to game.
        ///

        ///
        public void InjectGamePacket(PacketWriter packet)
        {
            PacketReader reader = new PacketReader(packet.GetPacket(), packet.Encrypted);            
            Console.WriteLine("[S->C]:\t" + reader.Opcode.ToString("X2"));
            localClient.Send(clientParser.Security.EncryptPacket(packet));
            if (ToAnalyze != null)
                ToAnalyze(reader, false);
        }
        ///
        /// Start listening for the incoming game connection.
        ///

        public void Start()
        {
            localClient.Listen();
        }
    }

    ///
    /// Proxy <-> login server based interface.
    ///

    class Clientless : IClient
    {
        public event Action ToAnalyze;
        public RemoteClient remoteClient { get; set; }
        public ServerParser serverParser { get; set; }
        private byte patchNumber = 0;
        System.Threading.Thread ping;

        public Clientless()
        {
            // Ping thread. Keeps the remote connection alive.
            ping = new System.Threading.Thread(PingWorker);

            // Server parser.
            serverParser = new ServerParser();
            serverParser.Security.PacketReceived += new Action(serverParser.ParsePacket);
            serverParser.RemoteSend += new Action(InjectServerPacket);
            serverParser.LocalSend += new Action(serverParser_LocalSend);
            serverParser.HandshakeDone += new Action(serverParser_HandshakeDone);

            // Remote client.
            remoteClient = new RemoteClient();
            remoteClient.Connected += new Action(remoteClient_Connected);
            remoteClient.NewDataReceived += new Action(serverParser.Security.DecryptPacket);
        }

        void serverParser_LocalSend(PacketWriter obj)
        {
            PacketReader reader = new PacketReader(obj.GetPacket(), obj.Encrypted);
            Console.WriteLine("[S->C]: " + reader.Opcode.ToString("X2") + "\t");
            switch ((Opcode)reader.Opcode)
            {
                case Opcode.AgentServer:
                    Console.WriteLine(reader.ReadString(Encoding.GetEncoding(1251))); // Gateway
                    PacketWriter infoAnswer = new PacketWriter(0x6100, false);
                    infoAnswer.Append(40); // Silkroad locale.
                    infoAnswer.AppendString("SR_Client", Encoding.ASCII); // Just a weird silkroad name (chinks...).
                    infoAnswer.Append(20); // SRO_Client version.
                    InjectServerPacket(infoAnswer);
                    break;
                case Opcode.PatchInformation:
                    {
                        patchNumber++;
                        if (patchNumber < 6)
                        {
                            if (ping.ThreadState == System.Threading.ThreadState.Running)                            
                                ping.Abort();
                            break;
                        }
                        else
                        {
                            patchNumber = 0;
                            InjectServerPacket(new PacketWriter((ushort)Opcode.ServerlistRequest));                            
                            ping.Start();
                        }
                        break;
                    }
            }            
            if (ToAnalyze != null)
                ToAnalyze(reader, false);
        }

        void remoteClient_Connected()
        {
            Console.WriteLine("Sever list has been connnected to the login server.");
        }

        void serverParser_HandshakeDone()
        {
            Console.WriteLine("Handshake has been initialized.");
            InjectServerPacket(new PacketWriter(0x9000));
            PacketWriter silkroadVersion = new PacketWriter(0x2001);
            silkroadVersion.AppendArray(new byte[] { 0x09, 0x00, 0x53, 0x52, 0x5f, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x00 });
            InjectServerPacket(silkroadVersion);
        }

        void PingWorker()
        {
            try
            {
                Console.WriteLine("Starting ping thread...");
                Random rnd = new Random(Environment.TickCount);
                while (true)
                {
                    System.Threading.Thread.Sleep(rnd.Next(4000, 7000));
                    InjectServerPacket(new PacketWriter((ushort)Opcode.Ping));                   
                }
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
                ping.Abort();               
            }
        }

        public void LoginRequest(string id, string pw, ushort serverID)
        {
            Console.WriteLine("Login request");
            PacketWriter writer = new PacketWriter((ushort)Opcode.LoginRequest);
            writer.Append(40);
            writer.AppendString(id, Encoding.ASCII);
            writer.AppendString(pw, Encoding.ASCII);
            writer.Append(serverID);
            InjectServerPacket(writer);
        }

        public void InjectServerPacket(PacketWriter packet)
        {
            PacketReader reader = new PacketReader(packet.GetPacket(), packet.Encrypted);            
            Console.WriteLine("[C->S]: " + reader.Opcode.ToString("X2") + "\t");
            remoteClient.Send(serverParser.Security.EncryptPacket(packet));        
            if (ToAnalyze != null)
                ToAnalyze(reader, true);
        }

        public void Start()
        {
            remoteClient.Connect("212.24.57.34", 15779);
        }
    }
}


Hello Kitty
vs
eMoStyLe




Hello EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 935
Puan : 241393
Rep Puanı : 18
Doğum tarihi : 28/11/89
Kayıt tarihi : 21/07/09
Yaş : 27
Nerden : EMO WorlD
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

Kullanıcı profilini gör http://emostyle.myforumpro.com

Sayfa başına dön Aşağa gitmek

Önceki başlık Sonraki başlık Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz