Example #1
0
        public void MapTest70022()
        {
            string path = @"D:\Clients\7.0.2.2";

            Version version = ExeInfo.GetFileVersion(Path.Combine(path, "client.exe"));

            TileData.Initialize(path);
            Map.Initialize(path, 0);

            MapInfo mi;

            foreach (LandTileTest lt in m_LandTileTests)
            {
                MacroEx.GetMapInfo(lt.Facet, lt.X, lt.Y, out mi);
                Assert.IsNotNull(mi.landTile, "LandTile is null.");
                Assert.AreEqual(mi.landTile.ID, lt.LandTileID, "LandTile doesn't match expected.");
                Assert.AreEqual(mi.landTile.Name, lt.LandTileName, "LandTile Name doesn't match expected.");
            }

            TileData.Dispose();
            Map.Dispose();
        }
Example #2
0
        public static bool SetAddresses(ClientInfo clientInfo, string fileName)
        {
            try
            {
                byte[] fileBytes   = File.ReadAllBytes(fileName);
                int    baseAddress = clientInfo.BaseAddress.ToInt32();
                clientInfo.Version   = ExeInfo.GetFileVersion(fileName);
                clientInfo.DateStamp = ExeInfo.GetStamp(fileBytes);
                if (clientInfo.Version == "0.0.0.0")
                {
                    clientInfo.Version = ExeInfo.DateToVersion(clientInfo.DateStamp);
                    if (clientInfo.Version == "")
                    {
                        string version;
                        if (!FindVersion(baseAddress, fileBytes, out version))
                        {
                            //return false;
                        }
                        clientInfo.Version = version;
                    }
                }

                if (!GetHookAddress(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetRecvAddress(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetSendAddress(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetReturnAddress1(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetCaveAddress(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetPlayerInfoPointer(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetClientPacketData(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetCursorAddress(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetServerSendAddress(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetPathFindAddress(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetGumpPointer(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }
                if (!GetLoginServerAddress(baseAddress, fileBytes, clientInfo))
                {
                    return(false);
                }

                clientInfo.IsValid = true;
                return(true);
            }
            catch { }
            return(false);
        }