├── 3rd ├── include │ ├── RakNet │ │ ├── AutopatcherPatchContext.h │ │ ├── AutopatcherRepositoryInterface.h │ │ ├── Base64Encoder.h │ │ ├── BitStream.h │ │ ├── CCRakNetSlidingWindow.h │ │ ├── CCRakNetUDT.h │ │ ├── CheckSum.h │ │ ├── CloudClient.h │ │ ├── CloudCommon.h │ │ ├── CloudServer.h │ │ ├── CommandParserInterface.h │ │ ├── ConnectionGraph2.h │ │ ├── ConsoleServer.h │ │ ├── DR_SHA1.h │ │ ├── DS_BPlusTree.h │ │ ├── DS_BinarySearchTree.h │ │ ├── DS_BytePool.h │ │ ├── DS_ByteQueue.h │ │ ├── DS_Hash.h │ │ ├── DS_Heap.h │ │ ├── DS_HuffmanEncodingTree.h │ │ ├── DS_HuffmanEncodingTreeFactory.h │ │ ├── DS_HuffmanEncodingTreeNode.h │ │ ├── DS_LinkedList.h │ │ ├── DS_List.h │ │ ├── DS_Map.h │ │ ├── DS_MemoryPool.h │ │ ├── DS_Multilist.h │ │ ├── DS_OrderedChannelHeap.h │ │ ├── DS_OrderedList.h │ │ ├── DS_Queue.h │ │ ├── DS_QueueLinkedList.h │ │ ├── DS_RangeList.h │ │ ├── DS_Table.h │ │ ├── DS_ThreadsafeAllocatingQueue.h │ │ ├── DS_Tree.h │ │ ├── DS_WeightedGraph.h │ │ ├── DataCompressor.h │ │ ├── DirectoryDeltaTransfer.h │ │ ├── DynDNS.h │ │ ├── EmailSender.h │ │ ├── EmptyHeader.h │ │ ├── EpochTimeToString.h │ │ ├── Export.h │ │ ├── FileList.h │ │ ├── FileListNodeContext.h │ │ ├── FileListTransfer.h │ │ ├── FileListTransferCBInterface.h │ │ ├── FileOperations.h │ │ ├── FormatString.h │ │ ├── FullyConnectedMesh2.h │ │ ├── GetTime.h │ │ ├── Getche.h │ │ ├── Gets.h │ │ ├── GridSectorizer.h │ │ ├── HTTPConnection.h │ │ ├── HTTPConnection2.h │ │ ├── IncrementalReadInterface.h │ │ ├── InternalPacket.h │ │ ├── Itoa.h │ │ ├── Kbhit.h │ │ ├── LinuxStrings.h │ │ ├── LocklessTypes.h │ │ ├── LogCommandParser.h │ │ ├── MTUSize.h │ │ ├── MessageFilter.h │ │ ├── MessageIdentifiers.h │ │ ├── NatPunchthroughClient.h │ │ ├── NatPunchthroughServer.h │ │ ├── NatTypeDetectionClient.h │ │ ├── NatTypeDetectionCommon.h │ │ ├── NatTypeDetectionServer.h │ │ ├── NativeFeatureIncludes.h │ │ ├── NativeFeatureIncludesOverrides.h │ │ ├── NativeTypes.h │ │ ├── NetworkIDManager.h │ │ ├── NetworkIDObject.h │ │ ├── PS3Includes.h │ │ ├── PS4Includes.h │ │ ├── PacketConsoleLogger.h │ │ ├── PacketFileLogger.h │ │ ├── PacketLogger.h │ │ ├── PacketOutputWindowLogger.h │ │ ├── PacketPool.h │ │ ├── PacketPriority.h │ │ ├── PacketizedTCP.h │ │ ├── PluginInterface2.h │ │ ├── RPC4Plugin.h │ │ ├── Rackspace.h │ │ ├── RakAlloca.h │ │ ├── RakAssert.h │ │ ├── RakMemoryOverride.h │ │ ├── RakNetCommandParser.h │ │ ├── RakNetDefines.h │ │ ├── RakNetDefinesOverrides.h │ │ ├── RakNetSmartPtr.h │ │ ├── RakNetSocket.h │ │ ├── RakNetSocket2.h │ │ ├── RakNetStatistics.h │ │ ├── RakNetTime.h │ │ ├── RakNetTransport2.h │ │ ├── RakNetTypes.h │ │ ├── RakNetVersion.h │ │ ├── RakPeer.h │ │ ├── RakPeerInterface.h │ │ ├── RakSleep.h │ │ ├── RakString.h │ │ ├── RakThread.h │ │ ├── RakWString.h │ │ ├── Rand.h │ │ ├── RandSync.h │ │ ├── ReadyEvent.h │ │ ├── RefCountedObj.h │ │ ├── RelayPlugin.h │ │ ├── ReliabilityLayer.h │ │ ├── ReplicaEnums.h │ │ ├── ReplicaManager3.h │ │ ├── Router2.h │ │ ├── SecureHandshake.h │ │ ├── SendToThread.h │ │ ├── SignaledEvent.h │ │ ├── SimpleMutex.h │ │ ├── SimpleTCPServer.h │ │ ├── SingleProducerConsumer.h │ │ ├── SocketDefines.h │ │ ├── SocketIncludes.h │ │ ├── SocketLayer.h │ │ ├── StatisticsHistory.h │ │ ├── StringCompressor.h │ │ ├── StringTable.h │ │ ├── SuperFastHash.h │ │ ├── TCPInterface.h │ │ ├── TableSerializer.h │ │ ├── TeamBalancer.h │ │ ├── TeamManager.h │ │ ├── TelnetTransport.h │ │ ├── ThreadPool.h │ │ ├── ThreadsafePacketLogger.h │ │ ├── TransportInterface.h │ │ ├── TwoWayAuthentication.h │ │ ├── UDPForwarder.h │ │ ├── UDPProxyClient.h │ │ ├── UDPProxyCommon.h │ │ ├── UDPProxyCoordinator.h │ │ ├── UDPProxyServer.h │ │ ├── VariableDeltaSerializer.h │ │ ├── VariableListDeltaTracker.h │ │ ├── VariadicSQLParser.h │ │ ├── VitaIncludes.h │ │ ├── WSAStartupSingleton.h │ │ ├── WindowsIncludes.h │ │ ├── XBox360Includes.h │ │ ├── _FindFirst.h │ │ └── gettimeofday.h │ ├── VMProtectSDK.h │ ├── cat │ │ ├── AllCodec.hpp │ │ ├── AllCommon.hpp │ │ ├── AllCrypt.hpp │ │ ├── AllFramework.hpp │ │ ├── AllGraphics.hpp │ │ ├── AllMath.hpp │ │ ├── AllTunnel.hpp │ │ ├── Config.hpp │ │ ├── LIBCAT.README.txt │ │ ├── Platform.hpp │ │ ├── Singleton.hpp │ │ ├── asm │ │ │ └── big_x64_asm.hpp │ │ ├── codec │ │ │ ├── ChatText.stats │ │ │ └── RangeCoder.hpp │ │ ├── crypt │ │ │ ├── SecureCompare.hpp │ │ │ ├── cookie │ │ │ │ └── CookieJar.hpp │ │ │ ├── hash │ │ │ │ ├── HMAC_MD5.hpp │ │ │ │ ├── ICryptHash.hpp │ │ │ │ └── Skein.hpp │ │ │ ├── pass │ │ │ │ └── Passwords.hpp │ │ │ ├── rand │ │ │ │ └── Fortuna.hpp │ │ │ ├── symmetric │ │ │ │ └── ChaCha.hpp │ │ │ └── tunnel │ │ │ │ ├── AuthenticatedEncryption.hpp │ │ │ │ ├── EasyHandshake.hpp │ │ │ │ ├── KeyAgreement.hpp │ │ │ │ ├── KeyAgreementInitiator.hpp │ │ │ │ ├── KeyAgreementResponder.hpp │ │ │ │ └── KeyMaker.hpp │ │ ├── db │ │ │ ├── BombayTable.hpp │ │ │ └── BombayTableIndex.hpp │ │ ├── gfx │ │ │ ├── LoadBitmap.hpp │ │ │ ├── LoadPNG.hpp │ │ │ ├── Matrix.hpp │ │ │ ├── Quaternion.hpp │ │ │ ├── Scalar.hpp │ │ │ └── Vector.hpp │ │ ├── hash │ │ │ └── MurmurHash2.hpp │ │ ├── io │ │ │ ├── AsyncBuffer.hpp │ │ │ ├── Base64.hpp │ │ │ ├── Logging.hpp │ │ │ ├── MMapFile.hpp │ │ │ ├── PackageManager.hpp │ │ │ ├── Settings.hpp │ │ │ └── ThreadPoolFiles.hpp │ │ ├── lang │ │ │ └── Strings.hpp │ │ ├── lib │ │ │ └── cat │ │ │ │ ├── big_x64.lib │ │ │ │ ├── big_x64.o │ │ │ │ └── big_x64.obj │ │ ├── math │ │ │ ├── BigMontgomery.hpp │ │ │ ├── BigPseudoMersenne.hpp │ │ │ ├── BigRTL.hpp │ │ │ ├── BigTwistedEdwards.hpp │ │ │ ├── BitMath.hpp │ │ │ └── Legs.hpp │ │ ├── net │ │ │ ├── DNSClient.hpp │ │ │ ├── Sockets.hpp │ │ │ ├── SphynxClient.hpp │ │ │ ├── SphynxCollexion.hpp │ │ │ ├── SphynxServer.hpp │ │ │ ├── SphynxTransport.hpp │ │ │ ├── ThreadPoolSockets.hpp │ │ │ ├── bsd │ │ │ │ ├── TCPClient.hpp │ │ │ │ ├── TCPConnection.hpp │ │ │ │ ├── TCPServer.hpp │ │ │ │ └── UDPEndpoint.hpp │ │ │ ├── generic │ │ │ │ ├── TCPClient.hpp │ │ │ │ ├── TCPConnection.hpp │ │ │ │ ├── TCPServer.hpp │ │ │ │ └── UDPEndpoint.hpp │ │ │ ├── linux │ │ │ │ ├── TCPClient.hpp │ │ │ │ ├── TCPConnection.hpp │ │ │ │ ├── TCPServer.hpp │ │ │ │ └── UDPEndpoint.hpp │ │ │ └── win │ │ │ │ ├── TCPClient.hpp │ │ │ │ ├── TCPConnection.hpp │ │ │ │ ├── TCPConnexion.hpp │ │ │ │ ├── TCPServer.hpp │ │ │ │ └── UDPEndpoint.hpp │ │ ├── parse │ │ │ ├── BitStream.hpp │ │ │ ├── BufferStream.hpp │ │ │ ├── BufferTok.hpp │ │ │ ├── FastDelegate.h │ │ │ └── MessageRouter.hpp │ │ ├── port │ │ │ ├── AlignedAlloc.hpp │ │ │ ├── EndianNeutral.hpp │ │ │ └── WindowsInclude.hpp │ │ ├── rand │ │ │ ├── IRandom.hpp │ │ │ ├── MersenneTwister.hpp │ │ │ └── StdRand.hpp │ │ ├── src │ │ │ ├── Framework.cpp │ │ │ ├── codec │ │ │ │ └── RangeCoder.cpp │ │ │ ├── crypt │ │ │ │ ├── SecureCompare.cpp │ │ │ │ ├── cookie │ │ │ │ │ └── CookieJar.cpp │ │ │ │ ├── hash │ │ │ │ │ ├── HMAC_MD5.cpp │ │ │ │ │ ├── Skein.cpp │ │ │ │ │ ├── Skein256.cpp │ │ │ │ │ └── Skein512.cpp │ │ │ │ ├── pass │ │ │ │ │ └── Passwords.cpp │ │ │ │ ├── privatekey │ │ │ │ │ └── ChaCha.cpp │ │ │ │ ├── rand │ │ │ │ │ ├── EntropyGeneric.cpp │ │ │ │ │ ├── EntropyLinux.cpp │ │ │ │ │ ├── EntropyWindows.cpp │ │ │ │ │ ├── EntropyWindowsCE.cpp │ │ │ │ │ └── Fortuna.cpp │ │ │ │ └── tunnel │ │ │ │ │ ├── AuthenticatedEncryption.cpp │ │ │ │ │ ├── EasyHandshake.cpp │ │ │ │ │ ├── KeyAgreement.cpp │ │ │ │ │ ├── KeyAgreementInitiator.cpp │ │ │ │ │ ├── KeyAgreementResponder.cpp │ │ │ │ │ └── KeyMaker.cpp │ │ │ ├── db │ │ │ │ ├── BombayTable.cpp │ │ │ │ └── BombayTableIndex.cpp │ │ │ ├── gfx │ │ │ │ ├── LoadBitmap.cpp │ │ │ │ ├── LoadPNG.cpp │ │ │ │ ├── Matrix.cpp │ │ │ │ ├── Quaternion.cpp │ │ │ │ ├── Scalar.cpp │ │ │ │ └── Vector.cpp │ │ │ ├── hash │ │ │ │ └── MurmurHash2.cpp │ │ │ ├── io │ │ │ │ ├── Base64.cpp │ │ │ │ ├── Logging.cpp │ │ │ │ ├── MMapFile.cpp │ │ │ │ ├── PackageManager.cpp │ │ │ │ ├── Settings.cpp │ │ │ │ └── ThreadPoolFiles.cpp │ │ │ ├── lang │ │ │ │ └── Strings.cpp │ │ │ ├── math │ │ │ │ ├── BigMontgomery.cpp │ │ │ │ ├── BigPseudoMersenne.cpp │ │ │ │ ├── BigRTL.cpp │ │ │ │ ├── BigTwistedEdwards.cpp │ │ │ │ ├── big_x64_elf.asm │ │ │ │ ├── big_x64_mscoff.asm │ │ │ │ ├── edward │ │ │ │ │ ├── addsub │ │ │ │ │ │ ├── PtAdd.cpp │ │ │ │ │ │ ├── PtDouble.cpp │ │ │ │ │ │ ├── PtDoubleZ1.cpp │ │ │ │ │ │ ├── PtNegate.cpp │ │ │ │ │ │ └── PtSubtract.cpp │ │ │ │ │ ├── io │ │ │ │ │ │ ├── PtFillRandomX.cpp │ │ │ │ │ │ ├── PtGenerate.cpp │ │ │ │ │ │ ├── PtNormalize.cpp │ │ │ │ │ │ ├── PtSolveAffineY.cpp │ │ │ │ │ │ ├── PtValidAffine.cpp │ │ │ │ │ │ ├── SaveAffineX.cpp │ │ │ │ │ │ └── SaveAffineXY.cpp │ │ │ │ │ └── mul │ │ │ │ │ │ ├── PtMultiply.cpp │ │ │ │ │ │ ├── PtMultiplyPrecomp.cpp │ │ │ │ │ │ ├── PtPrecompAddSub.cpp │ │ │ │ │ │ └── RefMul.cpp │ │ │ │ ├── mersenne │ │ │ │ │ ├── addsub │ │ │ │ │ │ ├── MrAdd.cpp │ │ │ │ │ │ ├── MrNegate.cpp │ │ │ │ │ │ └── MrSubtract.cpp │ │ │ │ │ ├── expm │ │ │ │ │ │ ├── MrInvert.cpp │ │ │ │ │ │ └── MrSquareRoot.cpp │ │ │ │ │ ├── mul │ │ │ │ │ │ ├── MrMultiply.cpp │ │ │ │ │ │ ├── MrMultiplyX.cpp │ │ │ │ │ │ └── MrSquare.cpp │ │ │ │ │ └── reduce │ │ │ │ │ │ ├── MrReduce.cpp │ │ │ │ │ │ └── MrReduceProduct.cpp │ │ │ │ ├── montgomery │ │ │ │ │ ├── addsub │ │ │ │ │ │ ├── MonAdd.cpp │ │ │ │ │ │ ├── MonNegate.cpp │ │ │ │ │ │ └── MonSubtract.cpp │ │ │ │ │ ├── expm │ │ │ │ │ │ ├── IsRabinMillerPrime.cpp │ │ │ │ │ │ └── MonExpMod.cpp │ │ │ │ │ ├── mul │ │ │ │ │ │ ├── MonMultiply.cpp │ │ │ │ │ │ └── MonSquare.cpp │ │ │ │ │ └── reduce │ │ │ │ │ │ ├── MonInput.cpp │ │ │ │ │ │ ├── MonOutput.cpp │ │ │ │ │ │ └── MonReduceProduct.cpp │ │ │ │ └── rtl │ │ │ │ │ ├── addsub │ │ │ │ │ ├── Add.cpp │ │ │ │ │ ├── Add1.cpp │ │ │ │ │ ├── AddX.cpp │ │ │ │ │ ├── Compare.cpp │ │ │ │ │ ├── Double.cpp │ │ │ │ │ ├── DoubleAdd.cpp │ │ │ │ │ ├── Negate.cpp │ │ │ │ │ ├── Shift.cpp │ │ │ │ │ ├── Subtract.cpp │ │ │ │ │ └── SubtractX.cpp │ │ │ │ │ ├── div │ │ │ │ │ ├── Divide.cpp │ │ │ │ │ ├── DivideAsm64.cpp │ │ │ │ │ ├── DivideGeneric.cpp │ │ │ │ │ ├── EatTrailingZeroes.cpp │ │ │ │ │ ├── ModularInverse.cpp │ │ │ │ │ ├── MulMod.cpp │ │ │ │ │ └── MultiplicativeInverse.cpp │ │ │ │ │ ├── io │ │ │ │ │ ├── Load.cpp │ │ │ │ │ ├── LoadString.cpp │ │ │ │ │ └── Save.cpp │ │ │ │ │ └── mul │ │ │ │ │ ├── CombaMul.cpp │ │ │ │ │ ├── Multiply.cpp │ │ │ │ │ ├── MultiplyX.cpp │ │ │ │ │ ├── MultiplyXAdd.cpp │ │ │ │ │ └── Square.cpp │ │ │ ├── net │ │ │ │ ├── DNSClient.cpp │ │ │ │ ├── Sockets.cpp │ │ │ │ ├── SphynxClient.cpp │ │ │ │ ├── SphynxServer.cpp │ │ │ │ ├── SphynxTransport.cpp │ │ │ │ ├── ThreadPoolSockets.cpp │ │ │ │ ├── bsd │ │ │ │ │ ├── ThreadPoolTCPClient.cpp │ │ │ │ │ ├── ThreadPoolTCPConnection.cpp │ │ │ │ │ ├── ThreadPoolTCPServer.cpp │ │ │ │ │ └── ThreadPoolUDPEndpoint.cpp │ │ │ │ ├── generic │ │ │ │ │ ├── ThreadPoolTCPClient.cpp │ │ │ │ │ ├── ThreadPoolTCPConnection.cpp │ │ │ │ │ ├── ThreadPoolTCPServer.cpp │ │ │ │ │ └── ThreadPoolUDPEndpoint.cpp │ │ │ │ ├── linux │ │ │ │ │ ├── ThreadPoolTCPClient.cpp │ │ │ │ │ ├── ThreadPoolTCPConnection.cpp │ │ │ │ │ ├── ThreadPoolTCPServer.cpp │ │ │ │ │ └── ThreadPoolUDPEndpoint.cpp │ │ │ │ └── win │ │ │ │ │ ├── TCPClient.cpp │ │ │ │ │ ├── TCPConnection.cpp │ │ │ │ │ ├── TCPConnexion.cpp │ │ │ │ │ ├── TCPServer.cpp │ │ │ │ │ └── UDPEndpoint.cpp │ │ │ ├── parse │ │ │ │ ├── BitStream.cpp │ │ │ │ ├── BufferTok.cpp │ │ │ │ └── MessageRouter.cpp │ │ │ ├── port │ │ │ │ ├── AlignedAlloc.cpp │ │ │ │ └── EndianNeutral.cpp │ │ │ ├── rand │ │ │ │ ├── MersenneTwister.cpp │ │ │ │ └── StdRand.cpp │ │ │ ├── threads │ │ │ │ ├── Mutex.cpp │ │ │ │ ├── RWLock.cpp │ │ │ │ ├── RegionAllocator.cpp │ │ │ │ ├── Thread.cpp │ │ │ │ ├── ThreadPool.cpp │ │ │ │ └── WaitableFlag.cpp │ │ │ └── time │ │ │ │ └── Clock.cpp │ │ ├── threads │ │ │ ├── Atomic.hpp │ │ │ ├── LocklessFIFO.hpp │ │ │ ├── Mutex.hpp │ │ │ ├── RWLock.hpp │ │ │ ├── RegionAllocator.hpp │ │ │ ├── Thread.hpp │ │ │ ├── ThreadPool.hpp │ │ │ └── WaitableFlag.hpp │ │ └── time │ │ │ └── Clock.hpp │ ├── curl │ │ ├── curl.h │ │ ├── curlbuild.h │ │ ├── curlrules.h │ │ ├── curlver.h │ │ ├── easy.h │ │ ├── mprintf.h │ │ ├── multi.h │ │ ├── stdcheaders.h │ │ └── typecheck-gcc.h │ ├── d3dsdk │ │ ├── D2D1.h │ │ ├── D2D1Helper.h │ │ ├── D2DBaseTypes.h │ │ ├── D2Derr.h │ │ ├── D3D10.h │ │ ├── D3D10_1.h │ │ ├── D3D10_1shader.h │ │ ├── D3D10effect.h │ │ ├── D3D10shader.h │ │ ├── D3D11.h │ │ ├── D3D11SDKLayers.h │ │ ├── D3D11Shader.h │ │ ├── D3DCSX.h │ │ ├── D3DX10.h │ │ ├── D3DX10core.h │ │ ├── D3DX10math.h │ │ ├── D3DX10math.inl │ │ ├── D3DX10mesh.h │ │ ├── D3DX10tex.h │ │ ├── D3DX11.h │ │ ├── D3DX11async.h │ │ ├── D3DX11core.h │ │ ├── D3DX11tex.h │ │ ├── D3DX_DXGIFormatConvert.inl │ │ ├── D3Dcommon.h │ │ ├── D3Dcompiler.h │ │ ├── DWrite.h │ │ ├── DXGI.h │ │ ├── DXGIFormat.h │ │ ├── DXGIType.h │ │ ├── Dcommon.h │ │ ├── DxErr.h │ │ ├── PIXPlugin.h │ │ ├── X3DAudio.h │ │ ├── XAPO.h │ │ ├── XAPOBase.h │ │ ├── XAPOFX.h │ │ ├── XAudio2.h │ │ ├── XAudio2fx.h │ │ ├── XDSP.h │ │ ├── XInput.h │ │ ├── audiodefs.h │ │ ├── comdecl.h │ │ ├── d3d10misc.h │ │ ├── d3d10sdklayers.h │ │ ├── d3d9.h │ │ ├── d3d9caps.h │ │ ├── d3d9types.h │ │ ├── d3dx10async.h │ │ ├── d3dx9.h │ │ ├── d3dx9anim.h │ │ ├── d3dx9core.h │ │ ├── d3dx9effect.h │ │ ├── d3dx9math.h │ │ ├── d3dx9math.inl │ │ ├── d3dx9mesh.h │ │ ├── d3dx9shader.h │ │ ├── d3dx9shape.h │ │ ├── d3dx9tex.h │ │ ├── d3dx9xof.h │ │ ├── dinput.h │ │ ├── dinputd.h │ │ ├── dsconf.h │ │ ├── dsetup.h │ │ ├── dsound.h │ │ ├── dxdiag.h │ │ ├── dxfile.h │ │ ├── dxsdkver.h │ │ ├── gameux.h │ │ ├── rmxfguid.h │ │ ├── rmxftmpl.h │ │ ├── rpcsal.h │ │ ├── xact3.h │ │ ├── xact3d3.h │ │ ├── xact3wb.h │ │ ├── xma2defs.h │ │ ├── xnamath.h │ │ ├── xnamathconvert.inl │ │ ├── xnamathmatrix.inl │ │ ├── xnamathmisc.inl │ │ └── xnamathvector.inl │ └── polarssl │ │ ├── aes.h │ │ ├── aesni.h │ │ ├── arc4.h │ │ ├── asn1.h │ │ ├── asn1write.h │ │ ├── base64.h │ │ ├── bignum.h │ │ ├── blowfish.h │ │ ├── bn_mul.h │ │ ├── camellia.h │ │ ├── ccm.h │ │ ├── certs.h │ │ ├── check_config.h │ │ ├── cipher.h │ │ ├── cipher_wrap.h │ │ ├── compat-1.2.h │ │ ├── config.h │ │ ├── ctr_drbg.h │ │ ├── debug.h │ │ ├── des.h │ │ ├── dhm.h │ │ ├── ecdh.h │ │ ├── ecdsa.h │ │ ├── ecp.h │ │ ├── entropy.h │ │ ├── entropy_poll.h │ │ ├── error.h │ │ ├── gcm.h │ │ ├── havege.h │ │ ├── hmac_drbg.h │ │ ├── md.h │ │ ├── md2.h │ │ ├── md4.h │ │ ├── md5.h │ │ ├── md_wrap.h │ │ ├── memory.h │ │ ├── memory_buffer_alloc.h │ │ ├── net.h │ │ ├── oid.h │ │ ├── openssl.h │ │ ├── padlock.h │ │ ├── pbkdf2.h │ │ ├── pem.h │ │ ├── pk.h │ │ ├── pk_wrap.h │ │ ├── pkcs11.h │ │ ├── pkcs12.h │ │ ├── pkcs5.h │ │ ├── platform.h │ │ ├── ripemd160.h │ │ ├── rsa.h │ │ ├── sha1.h │ │ ├── sha256.h │ │ ├── sha512.h │ │ ├── ssl.h │ │ ├── ssl_cache.h │ │ ├── ssl_ciphersuites.h │ │ ├── threading.h │ │ ├── timing.h │ │ ├── version.h │ │ ├── x509.h │ │ ├── x509_crl.h │ │ ├── x509_crt.h │ │ ├── x509_csr.h │ │ └── xtea.h └── lib │ ├── PolarSSL.lib │ ├── RakNetLibStatic.lib │ ├── VMProtectSDK32.lib │ ├── d3d9.lib │ ├── d3dx9.lib │ └── libcurl.lib ├── CMakeLists.txt ├── DBGen ├── CMakeLists.txt └── main.cpp ├── GHP ├── CMakeLists.txt ├── Detours │ ├── creatwth.cpp │ ├── detours.cpp │ ├── detours.h │ ├── detver.h │ ├── disasm.cpp │ ├── image.cpp │ ├── modules.cpp │ └── uimports.cpp ├── ghp_CORE.cpp ├── ghp_CORE.h ├── ghp_HOOK.cpp ├── ghp_HOOK.h ├── ghp_MAIN.cpp ├── ghp_NETBOX.cpp ├── ghp_NETBOX.h ├── ghp_SCAN.cpp ├── ghp_SCAN.h ├── ghp_SPLASH.cpp ├── ghp_SPLASH.h ├── ghp_UPDATER.cpp ├── ghp_UPDATER.h ├── resource.rc └── resource.rc.in ├── GHPServer ├── CMakeLists.txt ├── ServerCore.cpp ├── ServerCore.h ├── main.cpp ├── resource.rc └── resource.rc.in ├── GHPUpdater ├── CMakeLists.txt ├── main.cpp ├── resource.rc └── resource.rc.in ├── Hackblocker ├── CMakeLists.txt └── main.cpp ├── LicGen ├── CMakeLists.txt └── main.cpp ├── MasterServer ├── CMakeLists.txt ├── main.cpp └── main.h ├── README.md ├── Release ├── 0.Backup.bat ├── 0.Restore.bat ├── 1.Copy.bat ├── 2.GenMU.bat ├── 2.GenWARZ.bat ├── 3.CleanLic.bat ├── 4.GenUpdater.bat ├── 5.WZ_to_MU.bat ├── APIWhitelist.bin ├── APIWhitelist.txt ├── CheatWhitelist.txt ├── Config.xml ├── DBGen.exe ├── GHPServer.exe ├── GHPServer.ini ├── GHPServer_5.12.0_150131_full_RC.zip ├── GHPUpdater.exe ├── LicGen.exe ├── MasterServer.exe ├── VMProtectSDK32.dll ├── WZ_DBGen.exe ├── WZ_LicGen.exe ├── data │ ├── hwid │ │ └── Shiu.ini │ ├── info │ │ └── Shiu.ini │ ├── logs │ │ ├── hwid │ │ │ ├── 4441B2EE-F4BC0E75-8AF26213-8E4BCAD6-FE8BE0B1.log │ │ │ ├── 8C371146-20DA4634-AB632E81-F54E4105-6771716E.log │ │ │ └── 8CC3A4AD-36A46794-BD596480-B3A15592-1E638CA7.log │ │ ├── ip │ │ │ └── 127.0.0.1.log │ │ └── login │ │ │ └── Shiu.log │ └── ss │ │ └── Shiu │ │ ├── 2014_09_17_16_03_48_0.jpg │ │ └── 2014_09_17_16_03_48_1.jpg ├── db.bin ├── ghp.bin ├── index.html └── internal │ ├── LicData.ini │ ├── NET.KEY │ ├── PRV.KEY │ └── PUB.KEY ├── data ├── MU.ICO ├── close_1.bmp ├── close_2.bmp ├── close_3.bmp ├── gdserverico.ico ├── gdserverico.png ├── ghp.ico ├── ghpexico.ico └── ptinfo.bmp ├── ghp_CRYPTO ├── CMakeLists.txt ├── ghp_CRYPTO.cpp └── ghp_CRYPTO.h ├── ghp_NET ├── CMakeLists.txt ├── ghp_HTTPCLIENT.cpp ├── ghp_HTTPCLIENT.h ├── mongoose.c └── mongoose.h ├── ghp_UTILS ├── CMakeLists.txt ├── ghp_DB.cpp ├── ghp_DB.h ├── ghp_DEFS.h ├── ghp_ENCDEC.cpp ├── ghp_ENCDEC.h ├── ghp_FILE.cpp ├── ghp_FILE.h ├── ghp_LIC.cpp ├── ghp_LIC.h ├── ghp_LOG.cpp ├── ghp_LOG.h ├── ghp_MEMORY_PROTECTION.cpp ├── ghp_MEMORY_PROTECTION.h ├── ghp_MU.cpp ├── ghp_MU.h ├── ghp_PROTOCOL.h ├── ghp_STRUCTURED_FILE.cpp ├── ghp_STRUCTURED_FILE.h ├── ghp_SYSTEM.cpp ├── ghp_SYSTEM.h ├── hiberlite │ ├── BeanLoader.cpp │ ├── BeanLoader.h │ ├── BeanLoader_impl.hpp │ ├── BeanUpdater.cpp │ ├── BeanUpdater.h │ ├── BeanUpdater_impl.hpp │ ├── ChildKiller.cpp │ ├── ChildKiller.h │ ├── ChildKiller_impl.hpp │ ├── CppModel.cpp │ ├── CppModel.h │ ├── Database.cpp │ ├── Database.h │ ├── Database_tmpl_impl.hpp │ ├── ModelExtractor.cpp │ ├── ModelExtractor.h │ ├── ModelExtractor_impl.hpp │ ├── Registry.cpp │ ├── Registry.h │ ├── Registry_impl.hpp │ ├── SQLiteStmt.cpp │ ├── SQLiteStmt.h │ ├── UpdateVisitor_tmpl.hpp │ ├── Visitor.cpp │ ├── Visitor.h │ ├── Visitor_tmpl_impl.hpp │ ├── bean_ptr.h │ ├── bean_ptr_impl.hpp │ ├── common.h │ ├── db_error.h │ ├── hiberdefs.h │ ├── hiberlite.h │ ├── nvp.h │ ├── shared_res.cpp │ ├── shared_res.h │ ├── some_types.h │ ├── sqlite3.c │ └── sqlite3.h ├── jpeg-compressor │ ├── jpgd.cpp │ ├── jpgd.h │ ├── jpge.cpp │ └── jpge.h └── tinyxml2 │ ├── tinyxml2.cpp │ └── tinyxml2.h ├── ghp_WZAPI.hpp ├── include.h ├── include.h.in └── www ├── css ├── animation.css ├── fontello-codes.css ├── fontello-embedded.css ├── fontello-ie7-codes.css ├── fontello-ie7.css ├── fontello.css └── style.css ├── font ├── OpenSans-Bold.ttf ├── OpenSans-BoldItalic.ttf ├── OpenSans-ExtraBold.ttf ├── OpenSans-ExtraBoldItalic.ttf ├── OpenSans-Italic.ttf ├── OpenSans-Light.ttf ├── OpenSans-LightItalic.ttf ├── OpenSans-Regular.ttf ├── OpenSans-Semibold.ttf ├── OpenSans-SemiboldItalic.ttf ├── fontello.eot ├── fontello.svg ├── fontello.ttf └── fontello.woff ├── index.html └── js └── core.js /3rd/include/RakNet/AutopatcherPatchContext.h: -------------------------------------------------------------------------------- 1 | /// 2 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 3 | /// Usage of RakNet is subject to the appropriate license agreement. 4 | /// 5 | 6 | #ifndef __AUTOPATCHER_PATCH_CONTEXT_H 7 | #define __AUTOPATCHER_PATCH_CONTEXT_H 8 | 9 | enum PatchContext 10 | { 11 | PC_HASH_1_WITH_PATCH, 12 | PC_HASH_2_WITH_PATCH, 13 | PC_WRITE_FILE, 14 | PC_ERROR_FILE_WRITE_FAILURE, 15 | PC_ERROR_PATCH_TARGET_MISSING, 16 | PC_ERROR_PATCH_APPLICATION_FAILURE, 17 | PC_ERROR_PATCH_RESULT_CHECKSUM_FAILURE, 18 | PC_NOTICE_WILL_COPY_ON_RESTART, 19 | PC_NOTICE_FILE_DOWNLOADED, 20 | PC_NOTICE_FILE_DOWNLOADED_PATCH, 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /3rd/include/RakNet/Base64Encoder.h: -------------------------------------------------------------------------------- 1 | #ifndef __BASE_64_ENCODER_H 2 | #define __BASE_64_ENCODER_H 3 | 4 | #include "Export.h" 5 | 6 | extern "C" { 7 | /// \brief Returns how many bytes were written. 8 | // outputData should be at least the size of inputData * 2 + 6 9 | int Base64Encoding(const unsigned char *inputData, int dataLength, char *outputData); 10 | } 11 | 12 | extern "C" { 13 | const char *Base64Map(void); 14 | } 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /3rd/include/RakNet/CheckSum.h: -------------------------------------------------------------------------------- 1 | /// 2 | /// \file CheckSum.cpp 3 | /// \brief [Internal] CheckSum implementation from http://www.flounder.com/checksum.htm 4 | /// 5 | 6 | #ifndef __CHECKSUM_H 7 | #define __CHECKSUM_H 8 | 9 | #include "RakMemoryOverride.h" 10 | 11 | /// Generates and validates checksums 12 | class CheckSum 13 | { 14 | 15 | public: 16 | 17 | /// Default constructor 18 | 19 | CheckSum() 20 | { 21 | Clear(); 22 | } 23 | 24 | void Clear() 25 | { 26 | sum = 0; 27 | r = 55665; 28 | c1 = 52845; 29 | c2 = 22719; 30 | } 31 | 32 | void Add ( unsigned int w ); 33 | 34 | 35 | void Add ( unsigned short w ); 36 | 37 | void Add ( unsigned char* b, unsigned int length ); 38 | 39 | void Add ( unsigned char b ); 40 | 41 | unsigned int Get () 42 | { 43 | return sum; 44 | } 45 | 46 | protected: 47 | unsigned short r; 48 | unsigned short c1; 49 | unsigned short c2; 50 | unsigned int sum; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /3rd/include/RakNet/DS_BytePool.h: -------------------------------------------------------------------------------- 1 | /// \file DS_BytePool.h 2 | /// 3 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 4 | /// 5 | /// Usage of RakNet is subject to the appropriate license agreement. 6 | 7 | #ifndef __BYTE_POOL_H 8 | #define __BYTE_POOL_H 9 | 10 | #include "RakMemoryOverride.h" 11 | #include "DS_MemoryPool.h" 12 | #include "Export.h" 13 | #include "SimpleMutex.h" 14 | #include "RakAssert.h" 15 | 16 | // #define _DISABLE_BYTE_POOL 17 | // #define _THREADSAFE_BYTE_POOL 18 | 19 | namespace DataStructures 20 | { 21 | // Allocate some number of bytes from pools. Uses the heap if necessary. 22 | class RAK_DLL_EXPORT BytePool 23 | { 24 | public: 25 | BytePool(); 26 | ~BytePool(); 27 | // Should be at least 8 times bigger than 8192 28 | void SetPageSize(int size); 29 | unsigned char* Allocate(int bytesWanted, const char *file, unsigned int line); 30 | void Release(unsigned char *data, const char *file, unsigned int line); 31 | void Clear(const char *file, unsigned int line); 32 | protected: 33 | MemoryPool pool128; 34 | MemoryPool pool512; 35 | MemoryPool pool2048; 36 | MemoryPool pool8192; 37 | #ifdef _THREADSAFE_BYTE_POOL 38 | SimpleMutex mutex128; 39 | SimpleMutex mutex512; 40 | SimpleMutex mutex2048; 41 | SimpleMutex mutex8192; 42 | #endif 43 | }; 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /3rd/include/RakNet/DS_ByteQueue.h: -------------------------------------------------------------------------------- 1 | /// \file DS_ByteQueue.h 2 | /// \internal 3 | /// \brief Byte queue 4 | /// 5 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 6 | /// 7 | /// Usage of RakNet is subject to the appropriate license agreement. 8 | 9 | 10 | #ifndef __BYTE_QUEUE_H 11 | #define __BYTE_QUEUE_H 12 | 13 | #include "RakMemoryOverride.h" 14 | #include "Export.h" 15 | 16 | /// The namespace DataStructures was only added to avoid compiler errors for commonly named data structures 17 | /// As these data structures are stand-alone, you can use them outside of RakNet for your own projects if you wish. 18 | namespace DataStructures 19 | { 20 | class ByteQueue 21 | { 22 | public: 23 | ByteQueue(); 24 | ~ByteQueue(); 25 | void WriteBytes(const char *in, unsigned length, const char *file, unsigned int line); 26 | bool ReadBytes(char *out, unsigned maxLengthToRead, bool peek); 27 | unsigned GetBytesWritten(void) const; 28 | char* PeekContiguousBytes(unsigned int *outLength) const; 29 | void IncrementReadOffset(unsigned length); 30 | void DecrementReadOffset(unsigned length); 31 | void Clear(const char *file, unsigned int line); 32 | void Print(void); 33 | 34 | protected: 35 | char *data; 36 | unsigned readOffset, writeOffset, lengthAllocated; 37 | }; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /3rd/include/RakNet/DS_HuffmanEncodingTreeFactory.h: -------------------------------------------------------------------------------- 1 | /// \file DS_HuffmanEncodingTreeFactory.h 2 | /// \internal 3 | /// \brief Creates instances of the class HuffmanEncodingTree 4 | /// 5 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 6 | /// 7 | /// Usage of RakNet is subject to the appropriate license agreement. 8 | 9 | 10 | #ifndef __HUFFMAN_ENCODING_TREE_FACTORY 11 | #define __HUFFMAN_ENCODING_TREE_FACTORY 12 | 13 | #include "RakMemoryOverride.h" 14 | 15 | namespace RakNet { 16 | /// Forward declarations 17 | class HuffmanEncodingTree; 18 | 19 | /// \brief Creates instances of the class HuffmanEncodingTree 20 | /// \details This class takes a frequency table and given that frequence table, will generate an instance of HuffmanEncodingTree 21 | class HuffmanEncodingTreeFactory 22 | { 23 | public: 24 | /// Default constructor 25 | HuffmanEncodingTreeFactory(); 26 | 27 | /// \brief Reset the frequency table. 28 | /// \details You don't need to call this unless you want to reuse the class for a new tree 29 | void Reset( void ); 30 | 31 | /// \brief Pass an array of bytes to this to add those elements to the frequency table. 32 | /// \param[in] array the data to insert into the frequency table 33 | /// \param[in] size the size of the data to insert 34 | void AddToFrequencyTable( unsigned char *array, int size ); 35 | 36 | /// \brief Copies the frequency table to the array passed. Retrieve the frequency table. 37 | /// \param[in] _frequency The frequency table used currently 38 | void GetFrequencyTable( unsigned int _frequency[ 256 ] ); 39 | 40 | /// \brief Returns the frequency table as a pointer. 41 | /// \return the address of the frenquency table 42 | unsigned int * GetFrequencyTable( void ); 43 | 44 | /// \brief Generate a HuffmanEncodingTree. 45 | /// \details You can also use GetFrequencyTable and GenerateFromFrequencyTable in the tree itself 46 | /// \return The generated instance of HuffmanEncodingTree 47 | HuffmanEncodingTree * GenerateTree( void ); 48 | 49 | private: 50 | 51 | /// Frequency table 52 | unsigned int frequency[ 256 ]; 53 | }; 54 | 55 | } // namespace RakNet 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /3rd/include/RakNet/DS_HuffmanEncodingTreeNode.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief \b [Internal] A single node in the Huffman Encoding Tree. 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | 9 | #ifndef __HUFFMAN_ENCODING_TREE_NODE 10 | #define __HUFFMAN_ENCODING_TREE_NODE 11 | 12 | struct HuffmanEncodingTreeNode 13 | { 14 | unsigned char value; 15 | unsigned weight; 16 | HuffmanEncodingTreeNode *left; 17 | HuffmanEncodingTreeNode *right; 18 | HuffmanEncodingTreeNode *parent; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /3rd/include/RakNet/DataCompressor.h: -------------------------------------------------------------------------------- 1 | /// \file DataCompressor.h 2 | /// \brief DataCompressor does compression on a block of data. 3 | /// \details Not very good compression, but it's small and fast so is something you can use per-message at runtime. 4 | /// 5 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 6 | /// 7 | /// Usage of RakNet is subject to the appropriate license agreement. 8 | 9 | 10 | #ifndef __DATA_COMPRESSOR_H 11 | #define __DATA_COMPRESSOR_H 12 | 13 | #include "RakMemoryOverride.h" 14 | #include "DS_HuffmanEncodingTree.h" 15 | #include "Export.h" 16 | 17 | namespace RakNet 18 | { 19 | 20 | /// \brief Does compression on a block of data. Not very good compression, but it's small and fast so is something you can compute at runtime. 21 | class RAK_DLL_EXPORT DataCompressor 22 | { 23 | public: 24 | // GetInstance() and DestroyInstance(instance*) 25 | STATIC_FACTORY_DECLARATIONS(DataCompressor) 26 | 27 | static void Compress( unsigned char *userData, unsigned sizeInBytes, RakNet::BitStream * output ); 28 | static unsigned DecompressAndAllocate( RakNet::BitStream * input, unsigned char **output ); 29 | }; 30 | 31 | } // namespace RakNet 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /3rd/include/RakNet/EmptyHeader.h: -------------------------------------------------------------------------------- 1 | // This is here to remove Missing #include header? in the Unreal Engine 2 | -------------------------------------------------------------------------------- /3rd/include/RakNet/EpochTimeToString.h: -------------------------------------------------------------------------------- 1 | /// \file EpochTimeToString.h 2 | /// 3 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 4 | /// 5 | /// Usage of RakNet is subject to the appropriate license agreement. 6 | 7 | #ifndef __EPOCH_TIME_TO_STRING_H 8 | #define __EPOCH_TIME_TO_STRING_H 9 | 10 | #include "Export.h" 11 | 12 | RAK_DLL_EXPORT char * EpochTimeToString(long long time); 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /3rd/include/RakNet/Export.h: -------------------------------------------------------------------------------- 1 | #include "RakNetDefines.h" 2 | 3 | #if defined(_WIN32) && !(defined(__GNUC__) || defined(__GCCXML__)) && !defined(_RAKNET_LIB) && defined(_RAKNET_DLL) 4 | #define RAK_DLL_EXPORT __declspec(dllexport) 5 | #else 6 | #define RAK_DLL_EXPORT 7 | #endif 8 | 9 | #define STATIC_FACTORY_DECLARATIONS(x) static x* GetInstance(void); \ 10 | static void DestroyInstance( x *i); 11 | 12 | #define STATIC_FACTORY_DEFINITIONS(x,y) x* x::GetInstance(void) {return RakNet::OP_NEW( _FILE_AND_LINE_ );} \ 13 | void x::DestroyInstance( x *i) {RakNet::OP_DELETE(( y* ) i, _FILE_AND_LINE_);} 14 | -------------------------------------------------------------------------------- /3rd/include/RakNet/FileListNodeContext.h: -------------------------------------------------------------------------------- 1 | /// \file FileListNodeContext.h 2 | /// 3 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 4 | /// 5 | /// Usage of RakNet is subject to the appropriate license agreement. 6 | 7 | #ifndef __FILE_LIST_NODE_CONTEXT_H 8 | #define __FILE_LIST_NODE_CONTEXT_H 9 | 10 | #include "BitStream.h" 11 | 12 | struct FileListNodeContext 13 | { 14 | FileListNodeContext() {dataPtr=0; dataLength=0;} 15 | FileListNodeContext(unsigned char o, uint32_t f1, uint32_t f2, uint32_t f3) : op(o), flnc_extraData1(f1), flnc_extraData2(f2), flnc_extraData3(f3) {dataPtr=0; dataLength=0;} 16 | ~FileListNodeContext() {} 17 | 18 | unsigned char op; 19 | uint32_t flnc_extraData1; 20 | uint32_t flnc_extraData2; 21 | uint32_t flnc_extraData3; 22 | void *dataPtr; 23 | unsigned int dataLength; 24 | }; 25 | 26 | inline RakNet::BitStream& operator<<(RakNet::BitStream& out, FileListNodeContext& in) 27 | { 28 | out.Write(in.op); 29 | out.Write(in.flnc_extraData1); 30 | out.Write(in.flnc_extraData2); 31 | out.Write(in.flnc_extraData3); 32 | return out; 33 | } 34 | inline RakNet::BitStream& operator>>(RakNet::BitStream& in, FileListNodeContext& out) 35 | { 36 | in.Read(out.op); 37 | bool success = in.Read(out.flnc_extraData1); 38 | (void) success; 39 | assert(success); 40 | success = in.Read(out.flnc_extraData2); 41 | (void) success; 42 | assert(success); 43 | success = in.Read(out.flnc_extraData3); 44 | (void) success; 45 | assert(success); 46 | return in; 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /3rd/include/RakNet/FileOperations.h: -------------------------------------------------------------------------------- 1 | /// \file FileOperations.h 2 | /// 3 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 4 | /// 5 | /// Usage of RakNet is subject to the appropriate license agreement. 6 | 7 | #include "NativeFeatureIncludes.h" 8 | #if _RAKNET_SUPPORT_FileOperations==1 9 | 10 | #ifndef __FILE_OPERATIONS_H 11 | #define __FILE_OPERATIONS_H 12 | 13 | #include "Export.h" 14 | 15 | bool RAK_DLL_EXPORT WriteFileWithDirectories( const char *path, char *data, unsigned dataLength ); 16 | bool RAK_DLL_EXPORT IsSlash(unsigned char c); 17 | void RAK_DLL_EXPORT AddSlash( char *input ); 18 | void RAK_DLL_EXPORT QuoteIfSpaces(char *str); 19 | bool RAK_DLL_EXPORT DirectoryExists(const char *directory); 20 | unsigned int RAK_DLL_EXPORT GetFileLength(const char *path); 21 | 22 | #endif 23 | 24 | #endif // _RAKNET_SUPPORT_FileOperations 25 | -------------------------------------------------------------------------------- /3rd/include/RakNet/FormatString.h: -------------------------------------------------------------------------------- 1 | /// \file FormatString.h 2 | /// 3 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 4 | /// 5 | /// Usage of RakNet is subject to the appropriate license agreement. 6 | 7 | #ifndef __FORMAT_STRING_H 8 | #define __FORMAT_STRING_H 9 | 10 | #include "Export.h" 11 | 12 | extern "C" { 13 | char * FormatString(const char *format, ...); 14 | } 15 | // Threadsafe 16 | extern "C" { 17 | char * FormatStringTS(char *output, const char *format, ...); 18 | } 19 | 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /3rd/include/RakNet/GetTime.h: -------------------------------------------------------------------------------- 1 | /// \file GetTime.h 2 | /// \brief Returns the value from QueryPerformanceCounter. This is the function RakNet uses to represent time. This time won't match the time returned by GetTimeCount(). See http://www.jenkinssoftware.com/forum/index.php?topic=2798.0 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | 9 | #ifndef __GET_TIME_H 10 | #define __GET_TIME_H 11 | 12 | #include "Export.h" 13 | #include "RakNetTime.h" // For RakNet::TimeMS 14 | 15 | namespace RakNet 16 | { 17 | /// Same as GetTimeMS 18 | /// Holds the time in either a 32 or 64 bit variable, depending on __GET_TIME_64BIT 19 | RakNet::Time RAK_DLL_EXPORT GetTime( void ); 20 | 21 | /// Return the time as 32 bit 22 | /// \note The maximum delta between returned calls is 1 second - however, RakNet calls this constantly anyway. See NormalizeTime() in the cpp. 23 | RakNet::TimeMS RAK_DLL_EXPORT GetTimeMS( void ); 24 | 25 | /// Return the time as 64 bit 26 | /// \note The maximum delta between returned calls is 1 second - however, RakNet calls this constantly anyway. See NormalizeTime() in the cpp. 27 | RakNet::TimeUS RAK_DLL_EXPORT GetTimeUS( void ); 28 | 29 | /// a > b? 30 | extern RAK_DLL_EXPORT bool GreaterThan(RakNet::Time a, RakNet::Time b); 31 | /// a < b? 32 | extern RAK_DLL_EXPORT bool LessThan(RakNet::Time a, RakNet::Time b); 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /3rd/include/RakNet/Getche.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #if defined(_WIN32) 4 | #include /* getche() */ 5 | 6 | #else 7 | #include 8 | #include 9 | #include 10 | char getche(); 11 | #endif 12 | -------------------------------------------------------------------------------- /3rd/include/RakNet/Gets.h: -------------------------------------------------------------------------------- 1 | #ifndef __GETS__H_ 2 | #define __GETS__H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | char * Gets ( char * str, int num ); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /3rd/include/RakNet/IncrementalReadInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef __INCREMENTAL_READ_INTERFACE_H 2 | #define __INCREMENTAL_READ_INTERFACE_H 3 | 4 | #include "FileListNodeContext.h" 5 | #include "Export.h" 6 | 7 | namespace RakNet 8 | { 9 | 10 | class RAK_DLL_EXPORT IncrementalReadInterface 11 | { 12 | public: 13 | IncrementalReadInterface() {} 14 | virtual ~IncrementalReadInterface() {} 15 | 16 | /// Read part of a file into \a destination 17 | /// Return the number of bytes written. Return 0 when file is done. 18 | /// \param[in] filename Filename to read 19 | /// \param[in] startReadBytes What offset from the start of the file to read from 20 | /// \param[in] numBytesToRead How many bytes to read. This is also how many bytes have been allocated to preallocatedDestination 21 | /// \param[out] preallocatedDestination Write your data here 22 | /// \return The number of bytes read, or 0 if none 23 | virtual unsigned int GetFilePart( const char *filename, unsigned int startReadBytes, unsigned int numBytesToRead, void *preallocatedDestination, FileListNodeContext context); 24 | }; 25 | 26 | } // namespace RakNet 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /3rd/include/RakNet/Itoa.h: -------------------------------------------------------------------------------- 1 | #ifndef __RAK_ITOA_H 2 | #define __RAK_ITOA_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | char* Itoa( int value, char* result, int base ); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /3rd/include/RakNet/LinuxStrings.h: -------------------------------------------------------------------------------- 1 | #ifndef _GCC_WIN_STRINGS 2 | #define _GCC_WIN_STRINGS 3 | 4 | #if defined(__native_client__) 5 | #ifndef _stricmp 6 | int _stricmp(const char* s1, const char* s2); 7 | #endif 8 | int _strnicmp(const char* s1, const char* s2, size_t n); 9 | char *_strlwr(char * str ); 10 | #define _vsnprintf vsnprintf 11 | #else 12 | #if (defined(__GNUC__) || defined(__GCCXML__) || defined(__S3E__) ) && !defined(_WIN32) 13 | #ifndef _stricmp 14 | int _stricmp(const char* s1, const char* s2); 15 | #endif 16 | int _strnicmp(const char* s1, const char* s2, size_t n); 17 | // http://www.jenkinssoftware.com/forum/index.php?topic=5010.msg20920#msg20920 18 | // #ifndef _vsnprintf 19 | #define _vsnprintf vsnprintf 20 | // #endif 21 | #ifndef __APPLE__ 22 | char *_strlwr(char * str ); //this won't compile on OSX for some reason 23 | #endif 24 | 25 | 26 | 27 | #endif 28 | #endif 29 | 30 | #endif // _GCC_WIN_STRINGS 31 | -------------------------------------------------------------------------------- /3rd/include/RakNet/LocklessTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef __LOCKLESS_TYPES_H 2 | #define __LOCKLESS_TYPES_H 3 | 4 | #include "Export.h" 5 | #include "NativeTypes.h" 6 | #include "WindowsIncludes.h" 7 | #if defined(ANDROID) || defined(__S3E__) || defined(__APPLE__) 8 | // __sync_fetch_and_add not supported apparently 9 | #include "SimpleMutex.h" 10 | #endif 11 | 12 | namespace RakNet 13 | { 14 | 15 | class RAK_DLL_EXPORT LocklessUint32_t 16 | { 17 | public: 18 | LocklessUint32_t(); 19 | explicit LocklessUint32_t(uint32_t initial); 20 | // Returns variable value after changing it 21 | uint32_t Increment(void); 22 | // Returns variable value after changing it 23 | uint32_t Decrement(void); 24 | uint32_t GetValue(void) const {return value;} 25 | 26 | protected: 27 | #ifdef _WIN32 28 | volatile LONG value; 29 | #elif defined(ANDROID) || defined(__S3E__) || defined(__APPLE__) 30 | // __sync_fetch_and_add not supported apparently 31 | SimpleMutex mutex; 32 | uint32_t value; 33 | #else 34 | volatile uint32_t value; 35 | #endif 36 | }; 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /3rd/include/RakNet/MTUSize.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief \b [Internal] Defines the default maximum transfer unit. 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | 9 | #ifndef MAXIMUM_MTU_SIZE 10 | 11 | /// \li \em 17914 16 Mbit/Sec Token Ring 12 | /// \li \em 4464 4 Mbits/Sec Token Ring 13 | /// \li \em 4352 FDDI 14 | /// \li \em 1500. The largest Ethernet packet size \b recommended. This is the typical setting for non-PPPoE, non-VPN connections. The default value for NETGEAR routers, adapters and switches. 15 | /// \li \em 1492. The size PPPoE prefers. 16 | /// \li \em 1472. Maximum size to use for pinging. (Bigger packets are fragmented.) 17 | /// \li \em 1468. The size DHCP prefers. 18 | /// \li \em 1460. Usable by AOL if you don't have large email attachments, etc. 19 | /// \li \em 1430. The size VPN and PPTP prefer. 20 | /// \li \em 1400. Maximum size for AOL DSL. 21 | /// \li \em 576. Typical value to connect to dial-up ISPs. 22 | /// The largest value for an UDP datagram 23 | 24 | 25 | 26 | #define MAXIMUM_MTU_SIZE 1492 27 | 28 | 29 | #define MINIMUM_MTU_SIZE 400 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /3rd/include/RakNet/NativeFeatureIncludesOverrides.h: -------------------------------------------------------------------------------- 1 | // USER EDITABLE FILE 2 | // See NativeFeatureIncludes.h 3 | 4 | #ifndef __NATIVE_FEATURE_INCLDUES_OVERRIDES_H 5 | #define __NATIVE_FEATURE_INCLDUES_OVERRIDES_H 6 | 7 | #define LIBCAT_SECURITY 1 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /3rd/include/RakNet/NativeTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef __NATIVE_TYPES_H 2 | #define __NATIVE_TYPES_H 3 | 4 | #if defined(__GNUC__) || defined(__GCCXML__) || defined(__SNC__) || defined(__S3E__) 5 | #include 6 | #elif !defined(_STDINT_H) && !defined(_SN_STDINT_H) && !defined(_SYS_STDINT_H_) && !defined(_STDINT) && !defined(_MACHTYPES_H_) && !defined(_STDINT_H_) 7 | typedef unsigned char uint8_t; 8 | typedef unsigned short uint16_t; 9 | typedef unsigned __int32 uint32_t; 10 | typedef signed char int8_t; 11 | typedef signed short int16_t; 12 | typedef __int32 int32_t; 13 | #if defined(_MSC_VER) && _MSC_VER < 1300 14 | typedef unsigned __int64 uint64_t; 15 | typedef signed __int64 int64_t; 16 | #else 17 | typedef unsigned long long int uint64_t; 18 | typedef signed long long int64_t; 19 | #endif 20 | #endif 21 | 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /3rd/include/RakNet/PS3Includes.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /3rd/include/RakNet/PS4Includes.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /3rd/include/RakNet/PacketConsoleLogger.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief This will write all incoming and outgoing network messages to the log command parser, which can be accessed through Telnet 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | #include "NativeFeatureIncludes.h" 9 | #if _RAKNET_SUPPORT_LogCommandParser==1 && _RAKNET_SUPPORT_PacketLogger==1 10 | 11 | #ifndef __PACKET_CONSOLE_LOGGER_H_ 12 | #define __PACKET_CONSOLE_LOGGER_H_ 13 | 14 | #include "PacketLogger.h" 15 | 16 | namespace RakNet 17 | { 18 | /// Forward declarations 19 | class LogCommandParser; 20 | 21 | /// \ingroup PACKETLOGGER_GROUP 22 | /// \brief Packetlogger that logs to a remote command console 23 | class RAK_DLL_EXPORT PacketConsoleLogger : public PacketLogger 24 | { 25 | public: 26 | PacketConsoleLogger(); 27 | // Writes to the command parser used for logging, which is accessed through a secondary communication layer (such as Telnet or RakNet) - See ConsoleServer.h 28 | virtual void SetLogCommandParser(LogCommandParser *lcp); 29 | virtual void WriteLog(const char *str); 30 | protected: 31 | LogCommandParser *logCommandParser; 32 | }; 33 | 34 | } // namespace RakNet 35 | 36 | #endif 37 | 38 | #endif // _RAKNET_SUPPORT_* 39 | -------------------------------------------------------------------------------- /3rd/include/RakNet/PacketFileLogger.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief This will write all incoming and outgoing network messages to a file 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | #include "NativeFeatureIncludes.h" 9 | #if _RAKNET_SUPPORT_PacketLogger==1 10 | 11 | #ifndef __PACKET_FILE_LOGGER_H_ 12 | #define __PACKET_FILE_LOGGER_H_ 13 | 14 | #include "PacketLogger.h" 15 | #include 16 | 17 | namespace RakNet 18 | { 19 | 20 | /// \ingroup PACKETLOGGER_GROUP 21 | /// \brief Packetlogger that outputs to a file 22 | class RAK_DLL_EXPORT PacketFileLogger : public PacketLogger 23 | { 24 | public: 25 | PacketFileLogger(); 26 | virtual ~PacketFileLogger(); 27 | void StartLog(const char *filenamePrefix); 28 | virtual void WriteLog(const char *str); 29 | protected: 30 | FILE *packetLogFile; 31 | }; 32 | 33 | } // namespace RakNet 34 | 35 | #endif 36 | 37 | #endif // _RAKNET_SUPPORT_* 38 | -------------------------------------------------------------------------------- /3rd/include/RakNet/PacketOutputWindowLogger.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief This will write all incoming and outgoing network messages to a file 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | #include "NativeFeatureIncludes.h" 9 | #if _RAKNET_SUPPORT_PacketLogger==1 10 | 11 | #ifndef __PACKET_OUTPUT_WINDOW_LOGGER_H_ 12 | #define __PACKET_OUTPUT_WINDOW_LOGGER_H_ 13 | 14 | #include "PacketLogger.h" 15 | 16 | namespace RakNet 17 | { 18 | 19 | /// \ingroup PACKETLOGGER_GROUP 20 | /// \brief Packetlogger that outputs to the output window in the debugger. Windows only. 21 | class RAK_DLL_EXPORT PacketOutputWindowLogger : public PacketLogger 22 | { 23 | public: 24 | PacketOutputWindowLogger(); 25 | virtual ~PacketOutputWindowLogger(); 26 | virtual void WriteLog(const char *str); 27 | protected: 28 | }; 29 | 30 | } // namespace RakNet 31 | 32 | #endif 33 | 34 | #endif // _RAKNET_SUPPORT_* 35 | -------------------------------------------------------------------------------- /3rd/include/RakNet/PacketPool.h: -------------------------------------------------------------------------------- 1 | // REMOVEME -------------------------------------------------------------------------------- /3rd/include/RakNet/RakAlloca.h: -------------------------------------------------------------------------------- 1 | #if defined(__FreeBSD__) 2 | #include 3 | 4 | 5 | 6 | 7 | #elif defined ( __APPLE__ ) || defined ( __APPLE_CC__ ) 8 | #include 9 | #include 10 | #elif defined(_WIN32) 11 | #include 12 | #else 13 | #include 14 | // Alloca needed on Ubuntu apparently 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /3rd/include/RakNet/RakAssert.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "RakNetDefines.h" 3 | -------------------------------------------------------------------------------- /3rd/include/RakNet/RakNetDefinesOverrides.h: -------------------------------------------------------------------------------- 1 | // USER EDITABLE FILE 2 | 3 | -------------------------------------------------------------------------------- /3rd/include/RakNet/RakNetTime.h: -------------------------------------------------------------------------------- 1 | #ifndef __RAKNET_TIME_H 2 | #define __RAKNET_TIME_H 3 | 4 | #include "NativeTypes.h" 5 | #include "RakNetDefines.h" 6 | 7 | namespace RakNet { 8 | 9 | // Define __GET_TIME_64BIT if you want to use large types for GetTime (takes more bandwidth when you transmit time though!) 10 | // You would want to do this if your system is going to run long enough to overflow the millisecond counter (over a month) 11 | #if __GET_TIME_64BIT==1 12 | typedef uint64_t Time; 13 | typedef uint32_t TimeMS; 14 | typedef uint64_t TimeUS; 15 | #else 16 | typedef uint32_t Time; 17 | typedef uint32_t TimeMS; 18 | typedef uint64_t TimeUS; 19 | #endif 20 | 21 | } // namespace RakNet 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /3rd/include/RakNet/RakNetVersion.h: -------------------------------------------------------------------------------- 1 | #define RAKNET_VERSION "4.0802" 2 | #define RAKNET_VERSION_NUMBER 4.0802 3 | #define RAKNET_VERSION_NUMBER_INT 40802 4 | 5 | #define RAKNET_DATE "8/20/2013" 6 | 7 | // What compatible protocol version RakNet is using. When this value changes, it indicates this version of RakNet cannot connection to an older version. 8 | // ID_INCOMPATIBLE_PROTOCOL_VERSION will be returned on connection attempt in this case 9 | #define RAKNET_PROTOCOL_VERSION 6 10 | -------------------------------------------------------------------------------- /3rd/include/RakNet/RakSleep.h: -------------------------------------------------------------------------------- 1 | #ifndef __RAK_SLEEP_H 2 | #define __RAK_SLEEP_H 3 | 4 | #include "Export.h" 5 | 6 | void RAK_DLL_EXPORT RakSleep(unsigned int ms); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /3rd/include/RakNet/Rand.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief \b [Internal] Random number generator 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | 9 | 10 | #ifndef __RAND_H 11 | #define __RAND_H 12 | 13 | #include "Export.h" 14 | 15 | /// Initialise seed for Random Generator 16 | /// \note not threadSafe, use an instance of RakNetRandom if necessary per thread 17 | /// \param[in] seed The seed value for the random number generator. 18 | extern void RAK_DLL_EXPORT seedMT( unsigned int seed ); 19 | 20 | /// \internal 21 | /// \note not threadSafe, use an instance of RakNetRandom if necessary per thread 22 | extern unsigned int RAK_DLL_EXPORT reloadMT( void ); 23 | 24 | /// Gets a random unsigned int 25 | /// \note not threadSafe, use an instance of RakNetRandom if necessary per thread 26 | /// \return an integer random value. 27 | extern unsigned int RAK_DLL_EXPORT randomMT( void ); 28 | 29 | /// Gets a random float 30 | /// \note not threadSafe, use an instance of RakNetRandom if necessary per thread 31 | /// \return 0 to 1.0f, inclusive 32 | extern float RAK_DLL_EXPORT frandomMT( void ); 33 | 34 | /// Randomizes a buffer 35 | /// \note not threadSafe, use an instance of RakNetRandom if necessary per thread 36 | extern void RAK_DLL_EXPORT fillBufferMT( void *buffer, unsigned int bytes ); 37 | 38 | namespace RakNet { 39 | 40 | // Same thing as above functions, but not global 41 | class RAK_DLL_EXPORT RakNetRandom 42 | { 43 | public: 44 | RakNetRandom(); 45 | ~RakNetRandom(); 46 | void SeedMT( unsigned int seed ); 47 | unsigned int ReloadMT( void ); 48 | unsigned int RandomMT( void ); 49 | float FrandomMT( void ); 50 | void FillBufferMT( void *buffer, unsigned int bytes ); 51 | 52 | protected: 53 | unsigned int state[ 624 + 1 ]; 54 | unsigned int *next; 55 | int left; 56 | }; 57 | 58 | } // namespace RakNet 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /3rd/include/RakNet/RandSync.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief \b [Internal] Random number generator 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | 9 | 10 | #ifndef __RAND_SYNC_H 11 | #define __RAND_SYNC_H 12 | 13 | #include "Export.h" 14 | #include "Rand.h" 15 | #include "DS_Queue.h" 16 | #include "NativeTypes.h" 17 | 18 | namespace RakNet { 19 | 20 | class BitStream; 21 | 22 | class RAK_DLL_EXPORT RakNetRandomSync 23 | { 24 | public: 25 | RakNetRandomSync(); 26 | virtual ~RakNetRandomSync(); 27 | void SeedMT( uint32_t _seed ); 28 | void SeedMT( uint32_t _seed, uint32_t skipValues ); 29 | float FrandomMT( void ); 30 | unsigned int RandomMT( void ); 31 | uint32_t GetSeed( void ) const; 32 | uint32_t GetCallCount( void ) const; 33 | void SetCallCount( uint32_t i ); 34 | 35 | virtual void SerializeConstruction(RakNet::BitStream *constructionBitstream); 36 | virtual bool DeserializeConstruction(RakNet::BitStream *constructionBitstream); 37 | virtual void Serialize(RakNet::BitStream *outputBitstream); 38 | virtual void Deserialize(RakNet::BitStream *outputBitstream); 39 | 40 | protected: 41 | void Skip( uint32_t count ); 42 | DataStructures::Queue usedValues; 43 | uint32_t seed; 44 | uint32_t callCount; 45 | uint32_t usedValueBufferCount; 46 | RakNetRandom rnr; 47 | }; 48 | } // namespace RakNet 49 | 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /3rd/include/RakNet/RefCountedObj.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief \b Reference counted object. Very simple class for quick and dirty uses. 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | 9 | #ifndef __REF_COUNTED_OBJ_H 10 | #define __REF_COUNTED_OBJ_H 11 | 12 | #include "RakMemoryOverride.h" 13 | 14 | /// World's simplest class :) 15 | class RefCountedObj 16 | { 17 | public: 18 | RefCountedObj() {refCount=1;} 19 | virtual ~RefCountedObj() {} 20 | void AddRef(void) {refCount++;} 21 | void Deref(void) {if (--refCount==0) RakNet::OP_DELETE(this, _FILE_AND_LINE_);} 22 | int refCount; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /3rd/include/RakNet/ReplicaEnums.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief Contains enumerations used by the ReplicaManager system. This file is a lightweight header, so you can include it without worrying about linking in lots of other crap 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | 9 | #ifndef __REPLICA_ENUMS_H 10 | #define __REPLICA_ENUMS_H 11 | 12 | /// Replica interface flags, used to enable and disable function calls on the Replica object 13 | /// Passed to ReplicaManager::EnableReplicaInterfaces and ReplicaManager::DisableReplicaInterfaces 14 | enum 15 | { 16 | REPLICA_RECEIVE_DESTRUCTION=1<<0, 17 | REPLICA_RECEIVE_SERIALIZE=1<<1, 18 | REPLICA_RECEIVE_SCOPE_CHANGE=1<<2, 19 | REPLICA_SEND_CONSTRUCTION=1<<3, 20 | REPLICA_SEND_DESTRUCTION=1<<4, 21 | REPLICA_SEND_SCOPE_CHANGE=1<<5, 22 | REPLICA_SEND_SERIALIZE=1<<6, 23 | REPLICA_SET_ALL = 0xFF // Allow all of the above 24 | }; 25 | 26 | enum ReplicaReturnResult 27 | { 28 | /// This means call the function again later, with the same parameters 29 | REPLICA_PROCESS_LATER, 30 | /// This means we are done processing (the normal result to return) 31 | REPLICA_PROCESSING_DONE, 32 | /// This means cancel the processing - don't send any network messages and don't change the current state. 33 | REPLICA_CANCEL_PROCESS, 34 | /// Same as REPLICA_PROCESSING_DONE, where a message is sent, but does not clear the send bit. 35 | /// Useful for multi-part sends with different reliability levels. 36 | /// Only currently used by Replica::Serialize 37 | REPLICA_PROCESS_AGAIN, 38 | /// Only returned from the Replica::SendConstruction interface, means act as if the other system had this object but don't actually 39 | /// Send a construction packet. This way you will still send scope and serialize packets to that system 40 | REPLICA_PROCESS_IMPLICIT 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /3rd/include/RakNet/SecureHandshake.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// 3 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 4 | /// 5 | /// Usage of RakNet is subject to the appropriate license agreement. 6 | 7 | #ifndef SECURE_HANDSHAKE_H 8 | #define SECURE_HANDSHAKE_H 9 | 10 | #include "NativeFeatureIncludes.h" 11 | 12 | #if LIBCAT_SECURITY==1 13 | 14 | // If building a RakNet DLL, be sure to tweak the CAT_EXPORT macro meaning 15 | #if !defined(_RAKNET_LIB) && defined(_RAKNET_DLL) 16 | # define CAT_BUILD_DLL 17 | #else 18 | # define CAT_NEUTER_EXPORT 19 | #endif 20 | 21 | // Include DependentExtensions in your path to include this 22 | #include "cat/AllTunnel.hpp" 23 | 24 | #endif // LIBCAT_SECURITY 25 | 26 | #endif // SECURE_HANDSHAKE_H 27 | -------------------------------------------------------------------------------- /3rd/include/RakNet/SendToThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __SENDTO_THREAD 2 | #define __SENDTO_THREAD 3 | 4 | #include "RakNetDefines.h" 5 | 6 | #ifdef USE_THREADED_SEND 7 | 8 | #include "InternalPacket.h" 9 | #include "SocketLayer.h" 10 | #include "DS_ThreadsafeAllocatingQueue.h" 11 | #include "ThreadPool.h" 12 | 13 | namespace RakNet 14 | { 15 | class SendToThread 16 | { 17 | public: 18 | SendToThread(); 19 | ~SendToThread(); 20 | 21 | struct SendToThreadBlock 22 | { 23 | SOCKET s; 24 | SystemAddress systemAddress; 25 | unsigned short remotePortRakNetWasStartedOn_PS3; 26 | unsigned int extraSocketOptions; 27 | char data[MAXIMUM_MTU_SIZE]; 28 | unsigned short dataWriteOffset; 29 | }; 30 | 31 | static SendToThreadBlock* AllocateBlock(void); 32 | static void ProcessBlock(SendToThreadBlock* threadedSend); 33 | 34 | static void AddRef(void); 35 | static void Deref(void); 36 | static DataStructures::ThreadsafeAllocatingQueue objectQueue; 37 | protected: 38 | static int refCount; 39 | static ThreadPool threadPool; 40 | 41 | }; 42 | } 43 | 44 | 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /3rd/include/RakNet/SignaledEvent.h: -------------------------------------------------------------------------------- 1 | #ifndef __SIGNALED_EVENT_H 2 | #define __SIGNALED_EVENT_H 3 | 4 | 5 | 6 | #if defined(_WIN32) 7 | #include "WindowsIncludes.h" 8 | 9 | 10 | 11 | #else 12 | #include 13 | #include 14 | #include "SimpleMutex.h" 15 | 16 | 17 | 18 | 19 | #endif 20 | 21 | #include "Export.h" 22 | 23 | namespace RakNet 24 | { 25 | 26 | class RAK_DLL_EXPORT SignaledEvent 27 | { 28 | public: 29 | SignaledEvent(); 30 | ~SignaledEvent(); 31 | 32 | void InitEvent(void); 33 | void CloseEvent(void); 34 | void SetEvent(void); 35 | void WaitOnEvent(int timeoutMs); 36 | 37 | protected: 38 | #ifdef _WIN32 39 | HANDLE eventList; 40 | 41 | 42 | 43 | 44 | 45 | #else 46 | SimpleMutex isSignaledMutex; 47 | bool isSignaled; 48 | #if !defined(ANDROID) 49 | pthread_condattr_t condAttr; 50 | #endif 51 | pthread_cond_t eventList; 52 | pthread_mutex_t hMutex; 53 | pthread_mutexattr_t mutexAttr; 54 | #endif 55 | }; 56 | 57 | } // namespace RakNet 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /3rd/include/RakNet/SimpleMutex.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief \b [Internal] Encapsulates a mutex 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | 9 | #ifndef __SIMPLE_MUTEX_H 10 | #define __SIMPLE_MUTEX_H 11 | 12 | #include "RakMemoryOverride.h" 13 | 14 | 15 | #if defined(_WIN32) 16 | #include "WindowsIncludes.h" 17 | 18 | 19 | #else 20 | #include 21 | #include 22 | #endif 23 | #include "Export.h" 24 | 25 | namespace RakNet 26 | { 27 | 28 | /// \brief An easy to use mutex. 29 | /// 30 | /// I wrote this because the version that comes with Windows is too complicated and requires too much code to use. 31 | /// @remark Previously I used this everywhere, and in fact for a year or two RakNet was totally threadsafe. While doing profiling, I saw that this function was incredibly slow compared to the blazing performance of everything else, so switched to single producer / consumer everywhere. Now the user thread of RakNet is not threadsafe, but it's 100X faster than before. 32 | class RAK_DLL_EXPORT SimpleMutex 33 | { 34 | public: 35 | 36 | // Constructor 37 | SimpleMutex(); 38 | 39 | // Destructor 40 | ~SimpleMutex(); 41 | 42 | // Locks the mutex. Slow! 43 | void Lock(void); 44 | 45 | // Unlocks the mutex. 46 | void Unlock(void); 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | private: 55 | void Init(void); 56 | #ifdef _WIN32 57 | CRITICAL_SECTION criticalSection; /// Docs say this is faster than a mutex for single process access 58 | 59 | 60 | #else 61 | pthread_mutex_t hMutex; 62 | #endif 63 | // Not threadsafe 64 | // bool isInitialized; 65 | }; 66 | 67 | } // namespace RakNet 68 | 69 | #endif 70 | 71 | -------------------------------------------------------------------------------- /3rd/include/RakNet/SimpleTCPServer.h: -------------------------------------------------------------------------------- 1 | // Eraseme -------------------------------------------------------------------------------- /3rd/include/RakNet/SuperFastHash.h: -------------------------------------------------------------------------------- 1 | #ifndef __SUPER_FAST_HASH_H 2 | #define __SUPER_FAST_HASH_H 3 | 4 | #include 5 | #include "NativeTypes.h" 6 | 7 | // From http://www.azillionmonkeys.com/qed/hash.html 8 | // Author of main code is Paul Hsieh 9 | // I just added some convenience functions 10 | // Also note http://burtleburtle.net/bob/hash/doobs.html, which shows that this is 20% faster than the one on that page but has more collisions 11 | 12 | uint32_t SuperFastHash (const char * data, int length); 13 | uint32_t SuperFastHashIncremental (const char * data, int len, unsigned int lastHash ); 14 | uint32_t SuperFastHashFile (const char * filename); 15 | uint32_t SuperFastHashFilePtr (FILE *fp); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /3rd/include/RakNet/ThreadsafePacketLogger.h: -------------------------------------------------------------------------------- 1 | /// \file 2 | /// \brief Derivation of the packet logger to defer the call to WriteLog until the user thread. 3 | /// 4 | /// This file is part of RakNet Copyright 2003 Jenkins Software LLC 5 | /// 6 | /// Usage of RakNet is subject to the appropriate license agreement. 7 | 8 | #include "NativeFeatureIncludes.h" 9 | #if _RAKNET_SUPPORT_PacketLogger==1 10 | 11 | #ifndef __THREADSAFE_PACKET_LOGGER_H 12 | #define __THREADSAFE_PACKET_LOGGER_H 13 | 14 | #include "PacketLogger.h" 15 | #include "SingleProducerConsumer.h" 16 | 17 | namespace RakNet 18 | { 19 | 20 | /// \ingroup PACKETLOGGER_GROUP 21 | /// \brief Same as PacketLogger, but writes output in the user thread. 22 | class RAK_DLL_EXPORT ThreadsafePacketLogger : public PacketLogger 23 | { 24 | public: 25 | ThreadsafePacketLogger(); 26 | virtual ~ThreadsafePacketLogger(); 27 | 28 | virtual void Update(void); 29 | 30 | protected: 31 | virtual void AddToLog(const char *str); 32 | 33 | DataStructures::SingleProducerConsumer logMessages; 34 | }; 35 | 36 | } // namespace RakNet 37 | 38 | #endif 39 | 40 | #endif // _RAKNET_SUPPORT_* 41 | -------------------------------------------------------------------------------- /3rd/include/RakNet/VariadicSQLParser.h: -------------------------------------------------------------------------------- 1 | #ifndef __VARIADIC_SQL_PARSER_H 2 | #define __VARIADIC_SQL_PARSER_H 3 | 4 | #include "DS_List.h" 5 | 6 | #include 7 | 8 | namespace VariadicSQLParser 9 | { 10 | struct IndexAndType 11 | { 12 | unsigned int strIndex; 13 | unsigned int typeMappingIndex; 14 | }; 15 | const char* GetTypeMappingAtIndex(int i); 16 | void GetTypeMappingIndices( const char *format, DataStructures::List &indices ); 17 | // Given an SQL string with variadic arguments, allocate argumentBinary and argumentLengths, and hold the parameters in binary format 18 | // Last 2 parameters are out parameters 19 | void ExtractArguments( va_list argptr, const DataStructures::List &indices, char ***argumentBinary, int **argumentLengths ); 20 | void FreeArguments(const DataStructures::List &indices, char **argumentBinary, int *argumentLengths); 21 | } 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /3rd/include/RakNet/VitaIncludes.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /3rd/include/RakNet/WSAStartupSingleton.h: -------------------------------------------------------------------------------- 1 | #ifndef __WSA_STARTUP_SINGLETON_H 2 | #define __WSA_STARTUP_SINGLETON_H 3 | 4 | class WSAStartupSingleton 5 | { 6 | public: 7 | WSAStartupSingleton(); 8 | ~WSAStartupSingleton(); 9 | static void AddRef(void); 10 | static void Deref(void); 11 | 12 | protected: 13 | static int refCount; 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /3rd/include/RakNet/WindowsIncludes.h: -------------------------------------------------------------------------------- 1 | 2 | #if defined (WINDOWS_STORE_RT) 3 | #include 4 | #include 5 | #elif defined (_WIN32) 6 | #include 7 | #include 8 | #include 9 | 10 | // Must always include Winsock2.h before windows.h 11 | // or else: 12 | // winsock2.h(99) : error C2011: 'fd_set' : 'struct' type redefinition 13 | // winsock2.h(134) : warning C4005: 'FD_SET' : macro redefinition 14 | // winsock.h(83) : see previous definition of 'FD_SET' 15 | // winsock2.h(143) : error C2011: 'timeval' : 'struct' type redefinition 16 | // winsock2.h(199) : error C2011: 'hostent' : 'struct' type redefinition 17 | // winsock2.h(212) : error C2011: 'netent' : 'struct' type redefinition 18 | // winsock2.h(219) : error C2011: 'servent' : 'struct' type redefinition 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /3rd/include/RakNet/XBox360Includes.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /3rd/include/RakNet/_FindFirst.h: -------------------------------------------------------------------------------- 1 | /// 2 | /// Original file by the_viking, fixed by Rômulo Fernandes 3 | /// Should emulate windows finddata structure 4 | /// 5 | 6 | #ifndef GCC_FINDFIRST_H 7 | #define GCC_FINDFIRST_H 8 | 9 | #if (defined(__GNUC__) || defined(__ARMCC_VERSION) || defined(__GCCXML__) || defined(__S3E__) ) && !defined(__WIN32) 10 | 11 | #include 12 | 13 | #include "RakString.h" 14 | 15 | #define _A_NORMAL 0x00 // Normal file 16 | #define _A_RDONLY 0x01 // Read-only file 17 | #define _A_HIDDEN 0x02 // Hidden file 18 | #define _A_SYSTEM 0x04 // System file 19 | #define _A_VOLID 0x08 // Volume ID 20 | #define _A_SUBDIR 0x10 // Subdirectory 21 | #define _A_ARCH 0x20 // File changed since last archive 22 | #define FA_NORMAL 0x00 // Synonym of _A_NORMAL 23 | #define FA_RDONLY 0x01 // Synonym of _A_RDONLY 24 | #define FA_HIDDEN 0x02 // Synonym of _A_HIDDEN 25 | #define FA_SYSTEM 0x04 // Synonym of _A_SYSTEM 26 | #define FA_LABEL 0x08 // Synonym of _A_VOLID 27 | #define FA_DIREC 0x10 // Synonym of _A_SUBDIR 28 | #define FA_ARCH 0x20 // Synonym of _A_ARCH 29 | 30 | 31 | const unsigned STRING_BUFFER_SIZE = 512; 32 | 33 | typedef struct _finddata_t 34 | { 35 | char name[STRING_BUFFER_SIZE]; 36 | int attrib; 37 | unsigned long size; 38 | } _finddata; 39 | 40 | /** 41 | * Hold information about the current search 42 | */ 43 | typedef struct _findinfo_t 44 | { 45 | DIR* openedDir; 46 | RakNet::RakString filter; 47 | RakNet::RakString dirName; 48 | } _findinfo; 49 | 50 | long _findfirst(const char *name, _finddata_t *f); 51 | int _findnext(long h, _finddata_t *f); 52 | int _findclose(long h); 53 | 54 | #endif 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /3rd/include/RakNet/gettimeofday.h: -------------------------------------------------------------------------------- 1 | #ifndef __GET_TIME_OF_DAY_H 2 | #define __GET_TIME_OF_DAY_H 3 | 4 | #if defined(_WIN32) && !defined(__GNUC__) &&!defined(__GCCXML__) 5 | #include < time.h > 6 | struct timezone 7 | { 8 | int tz_minuteswest; /* minutes W of Greenwich */ 9 | int tz_dsttime; /* type of dst correction */ 10 | }; 11 | 12 | #if defined(WINDOWS_STORE_RT) 13 | struct timeval { 14 | long tv_sec; 15 | long tv_usec; 16 | }; 17 | #endif 18 | 19 | int gettimeofday(struct timeval *tv, struct timezone *tz); 20 | 21 | 22 | #else 23 | 24 | 25 | 26 | 27 | #include 28 | 29 | #include 30 | 31 | // Uncomment this if you need to 32 | /* 33 | // http://www.halcode.com/archives/2008/08/26/retrieving-system-time-gettimeofday/ 34 | struct timezone 35 | { 36 | int tz_minuteswest; 37 | int tz_dsttime; 38 | }; 39 | 40 | #ifdef __cplusplus 41 | 42 | void GetSystemTimeAsFileTime(FILETIME*); 43 | 44 | inline int gettimeofday(struct timeval* p, void* tz ) 45 | { 46 | union { 47 | long long ns100; // time since 1 Jan 1601 in 100ns units 48 | FILETIME ft; 49 | } now; 50 | 51 | GetSystemTimeAsFileTime( &(now.ft) ); 52 | p->tv_usec=(long)((now.ns100 / 10LL) % 1000000LL ); 53 | p->tv_sec= (long)((now.ns100-(116444736000000000LL))/10000000LL); 54 | return 0; 55 | } 56 | 57 | #else 58 | int gettimeofday(struct timeval* p, void* tz ); 59 | #endif 60 | */ 61 | 62 | #endif 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /3rd/include/cat/AllCodec.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | // Include all libcat Codec headers 30 | 31 | #include 32 | -------------------------------------------------------------------------------- /3rd/include/cat/AllCrypt.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | // Include all libcat Crypt headers 30 | 31 | #include 32 | 33 | #include 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | #include 40 | 41 | #include 42 | 43 | #include 44 | 45 | #include 46 | -------------------------------------------------------------------------------- /3rd/include/cat/AllGraphics.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | // Include all libcat Graphics headers 30 | 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | -------------------------------------------------------------------------------- /3rd/include/cat/AllMath.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | // Include all libcat Math headers 30 | 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | -------------------------------------------------------------------------------- /3rd/include/cat/AllTunnel.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | // Include all libcat Tunnel headers 30 | 31 | #include 32 | 33 | #include 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | #include 40 | 41 | #include 42 | -------------------------------------------------------------------------------- /3rd/include/cat/crypt/SecureCompare.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef CAT_SECURE_COMPARE_HPP 30 | #define CAT_SECURE_COMPARE_HPP 31 | 32 | #include 33 | 34 | namespace cat { 35 | 36 | 37 | // Binary comparison function that is resistant to timing attack 38 | // Note that memcmp() and strcmp() are both vulnerable 39 | // Returns true if they are equal 40 | bool SecureEqual(const void *A, const void *B, int bytes); 41 | 42 | 43 | } // namespace cat 44 | 45 | #endif // SECURE_COMPARE_HPP 46 | -------------------------------------------------------------------------------- /3rd/include/cat/crypt/tunnel/KeyMaker.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef CAT_KEY_MAKER_HPP 30 | #define CAT_KEY_MAKER_HPP 31 | 32 | #include 33 | #include 34 | 35 | namespace cat { 36 | 37 | 38 | class KeyMaker : public KeyAgreementCommon 39 | { 40 | public: 41 | bool GenerateKeyPair(BigTwistedEdwards *math, FortunaOutput *csprng, u8 *public_key, int public_bytes, u8 *private_key, int private_bytes); 42 | }; 43 | 44 | 45 | } // namespace cat 46 | 47 | #endif // CAT_KEY_MAKER_HPP 48 | -------------------------------------------------------------------------------- /3rd/include/cat/lib/cat/big_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/include/cat/lib/cat/big_x64.lib -------------------------------------------------------------------------------- /3rd/include/cat/lib/cat/big_x64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/include/cat/lib/cat/big_x64.o -------------------------------------------------------------------------------- /3rd/include/cat/lib/cat/big_x64.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/include/cat/lib/cat/big_x64.obj -------------------------------------------------------------------------------- /3rd/include/cat/math/BigTwistedEdwards.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/include/cat/math/BigTwistedEdwards.hpp -------------------------------------------------------------------------------- /3rd/include/cat/port/WindowsInclude.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef CAT_WINDOWS_INCLUDE_HPP 30 | #define CAT_WINDOWS_INCLUDE_HPP 31 | 32 | #undef WIN32_LEAN_AND_MEAN 33 | #define WIN32_LEAN_AND_MEAN 34 | 35 | #undef _WIN32_WINNT 36 | #define _WIN32_WINNT 0x0502 /* Windows XP SP2 or later */ 37 | 38 | #include 39 | 40 | #endif // CAT_WINDOWS_INCLUDE_HPP 41 | -------------------------------------------------------------------------------- /3rd/include/cat/src/gfx/Matrix.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | -------------------------------------------------------------------------------- /3rd/include/cat/src/gfx/Quaternion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | -------------------------------------------------------------------------------- /3rd/include/cat/src/gfx/Vector.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | -------------------------------------------------------------------------------- /3rd/include/cat/src/io/PackageManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/edward/addsub/PtNegate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | // Extended Twisted Edwards Negation Formula 33 | void BigTwistedEdwards::PtNegate(const Leg *in, Leg *out) 34 | { 35 | // -(X : Y : T : Z) = (-X : Y : -T : Z) 36 | MrNegate(in+XOFF, out+XOFF); 37 | Copy(in+YOFF, out+YOFF); 38 | MrNegate(in+TOFF, out+TOFF); 39 | Copy(in+ZOFF, out+ZOFF); 40 | } 41 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/edward/io/PtFillRandomX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | // Fill the X coordinate of the point with a random value 33 | void BigTwistedEdwards::PtFillRandomX(IRandom *prng, Leg *out) 34 | { 35 | // Generate an affine X coordinate point that is unbiased 36 | do prng->Generate(out+XOFF, RegBytes()); 37 | while (!Less(out+XOFF, GetModulus())); 38 | } 39 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/edward/io/PtNormalize.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | // Compute affine coordinates for (X,Y), set Z=1, and compute T = xy 33 | void BigTwistedEdwards::PtNormalize(const Leg *in, Leg *out) 34 | { 35 | // A = 1 / in.Z 36 | MrInvert(in+ZOFF, A); 37 | 38 | // out.X = A * in.X 39 | MrMultiply(in+XOFF, A, out+XOFF); 40 | MrReduce(out+XOFF); 41 | 42 | // out.Y = A * in.Y 43 | MrMultiply(in+YOFF, A, out+YOFF); 44 | MrReduce(out+YOFF); 45 | 46 | PtUnpack(out); 47 | } 48 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/mersenne/mul/MrMultiplyX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | using namespace cat; 32 | 33 | void CAT_FASTCALL BigPseudoMersenne::MrMultiplyX(const Leg *in_a, Leg in_b, Leg *out) 34 | { 35 | #if defined(CAT_USE_LEGS_ASM64) 36 | if (library_legs == 4) 37 | { 38 | bpm_mulx_4(modulus_c, in_a, in_b, out); 39 | return; 40 | } 41 | #endif 42 | 43 | Leg overflow = MultiplyX(in_a, in_b, out); 44 | 45 | MrReduceProductX(overflow, out); 46 | } 47 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/mersenne/mul/MrSquare.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | using namespace cat; 32 | 33 | void CAT_FASTCALL BigPseudoMersenne::MrSquare(const Leg *in, Leg *out) 34 | { 35 | #if defined(CAT_USE_LEGS_ASM64) 36 | if (library_legs == 4) 37 | { 38 | bpm_sqr_4(modulus_c, in, out); 39 | return; 40 | } 41 | #endif 42 | 43 | Leg *T_hi = Get(pm_regs - 2); 44 | Leg *T_lo = Get(pm_regs - 3); 45 | 46 | Square(in, T_lo); 47 | 48 | MrReduceProduct(T_hi, T_lo, out); 49 | } 50 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/mersenne/reduce/MrReduce.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | void CAT_FASTCALL BigPseudoMersenne::MrReduce(Leg *inout) 33 | { 34 | // Subtract the modulus once if the input is greater or equal to it 35 | for (int ii = 1; ii < library_legs; ++ii) 36 | if (~inout[ii]) return; 37 | 38 | if (inout[0] >= (0 - modulus_c)) 39 | AddX(inout, modulus_c); 40 | } 41 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/montgomery/addsub/MonAdd.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | void BigMontgomery::MonAdd(const Leg *in_a, const Leg *in_b, Leg *out) 33 | { 34 | // If the addition overflowed, subtract modulus 35 | if (Add(in_a, in_b, out)) 36 | while (Subtract(out, CachedModulus, out)); 37 | } 38 | 39 | void BigMontgomery::MonDouble(const Leg *in, Leg *out) 40 | { 41 | // If the doubling overflowed, subtract modulus 42 | if (Double(in, out)) 43 | while (Subtract(out, CachedModulus, out)); 44 | } 45 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/montgomery/addsub/MonNegate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | void BigMontgomery::MonNegate(const Leg *in, Leg *out) 33 | { 34 | // -x = p - x, and handle borrow out by adding modulus 35 | if (Subtract(CachedModulus, in, out)) 36 | while (Add(out, CachedModulus, out)); 37 | } 38 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/montgomery/addsub/MonSubtract.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | void BigMontgomery::MonSubtract(const Leg *in_a, const Leg *in_b, Leg *out) 33 | { 34 | // If the subtraction overflowed, add modulus 35 | if (Subtract(in_a, in_b, out)) 36 | while (Add(out, CachedModulus, out)); 37 | } 38 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/montgomery/mul/MonMultiply.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | void BigMontgomery::MonMultiply(const Leg *in_a, const Leg *in_b, Leg *out) 33 | { 34 | // Perform normal multiplication 35 | Multiply(in_a, in_b, TempProduct); 36 | 37 | // Followed by Montgomery reduction 38 | MonReduceProduct(TempProduct, out); 39 | } 40 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/montgomery/mul/MonSquare.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | void BigMontgomery::MonSquare(const Leg *in, Leg *out) 33 | { 34 | // Perform normal squaring 35 | Square(in, TempProduct); 36 | 37 | // Followed by Montgomery reduction 38 | MonReduceProduct(TempProduct, out); 39 | } 40 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/montgomery/reduce/MonInput.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | void BigMontgomery::MonInput(const Leg *in, Leg *out) 33 | { 34 | // out = in * R (mod p) 35 | CopyX(0, TempProduct); 36 | Copy(in, TempProductHi); 37 | DivideProduct(TempProduct, CachedModulus, TempProduct, out); 38 | } 39 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/montgomery/reduce/MonOutput.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | void BigMontgomery::MonOutput(const Leg *in, Leg *out) 33 | { 34 | // out = in * R^-1 (mod p) 35 | Copy(in, TempProduct); 36 | CopyX(0, TempProductHi); 37 | MonReduceProduct(TempProduct, out); 38 | 39 | // Result after reduction may still be too large by one modulus 40 | if (!Less(out, CachedModulus)) 41 | Subtract(out, CachedModulus, out); 42 | } 43 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/rtl/addsub/AddX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | u8 CAT_FASTCALL BigRTL::AddX(Leg *inout, Leg x) 33 | { 34 | // If the initial sum did not carry out, return 0 35 | if ((inout[0] += x) >= x) 36 | return 0; 37 | 38 | // Ripple the carry out as far as needed 39 | for (int ii = 1; ii < library_legs; ++ii) 40 | if (++inout[ii]) return 0; 41 | 42 | return 1; 43 | } 44 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/rtl/addsub/Negate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | void CAT_FASTCALL BigRTL::Negate(const Leg *in, Leg *out) 33 | { 34 | int ii; 35 | 36 | // Ripple the borrow in as far as needed 37 | for (ii = 0; ii < library_legs; ++ii) 38 | { 39 | Leg temp = ~in[ii] + 1; 40 | out[ii] = temp; 41 | 42 | if (temp) break; 43 | } 44 | 45 | // Invert remaining bits 46 | for (; ii < library_legs; ++ii) 47 | out[ii] = ~in[ii]; 48 | } 49 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/rtl/addsub/SubtractX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | u8 CAT_FASTCALL BigRTL::SubtractX(Leg *inout, Leg x) 33 | { 34 | Leg t = inout[0]; 35 | inout[0] = t - x; 36 | 37 | // If the initial difference did not borrow in, return 0 38 | if (t >= x) return 0; 39 | 40 | // Ripple the borrow in as far as needed 41 | for (int ii = 1; ii < library_legs; ++ii) 42 | if (inout[ii]--) return 0; 43 | 44 | return 1; 45 | } 46 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/rtl/div/MulMod.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | // r = a * b (mod m) 33 | void CAT_FASTCALL BigRTL::MulMod(const Leg *in_a, const Leg *in_b, const Leg *in_m, Leg *r) 34 | { 35 | Leg *p = Get(library_regs - 5); 36 | 37 | Multiply(in_a, in_b, p); 38 | DivideProduct(p, in_m, p, r); 39 | } 40 | -------------------------------------------------------------------------------- /3rd/include/cat/src/math/rtl/mul/MultiplyX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | Leg CAT_FASTCALL BigRTL::MultiplyX(const Leg *in_a, Leg in_b, Leg *out) 33 | { 34 | return MultiplyX(library_legs, in_a, in_b, out); 35 | } 36 | 37 | Leg CAT_FASTCALL BigRTL::MultiplyX(int legs, const Leg *in_a, Leg in_b, Leg *output) 38 | { 39 | Leg p_hi; 40 | 41 | CAT_LEG_MUL(in_a[0], in_b, p_hi, output[0]); 42 | 43 | for (int ii = 1; ii < legs; ++ii) 44 | CAT_LEG_MULADD(in_a[ii], in_b, p_hi, p_hi, output[ii]); 45 | 46 | return p_hi; 47 | } 48 | -------------------------------------------------------------------------------- /3rd/include/cat/src/parse/MessageRouter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | 33 | void MessageRouter::Set(u8 opcode, const MessageHandler &handler) 34 | { 35 | handlers[opcode] = handler; 36 | } 37 | 38 | void MessageRouter::Clear(u8 opcode) 39 | { 40 | handlers[opcode].clear(); 41 | } 42 | 43 | void MessageRouter::Invoke(u8 opcode, BitStream &msg) 44 | { 45 | if (handlers[opcode]) 46 | { 47 | handlers[opcode](msg); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /3rd/include/cat/src/port/EndianNeutral.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of LibCat nor the names of its contributors may be used 13 | to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | using namespace cat; 31 | 32 | #if defined(CAT_ENDIAN_UNKNOWN) 33 | 34 | RuntimeEndianDetector Endianness::detector; 35 | 36 | static u8 endian_detection_array[4] = {1, 2, 3, 4}; 37 | 38 | RuntimeEndianDetector::RuntimeEndianDetector() 39 | { 40 | u8 *ptr8 = endian_detection_array; 41 | u32 *ptr32 = reinterpret_cast( ptr8 ); 42 | 43 | _little_endian = (*ptr32 == 0x04030201); 44 | _big_endian = (*ptr32 == 0x01020304); 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /3rd/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDC_HEADERS_H 2 | #define __STDC_HEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | size_t fread (void *, size_t, size_t, FILE *); 28 | size_t fwrite (const void *, size_t, size_t, FILE *); 29 | 30 | int strcasecmp(const char *, const char *); 31 | int strncasecmp(const char *, const char *, size_t); 32 | 33 | #endif /* __STDC_HEADERS_H */ 34 | -------------------------------------------------------------------------------- /3rd/include/d3dsdk/D3DX10.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx10.h 6 | // Content: D3DX10 utility library 7 | // 8 | ////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifdef __D3DX10_INTERNAL__ 11 | #error Incorrect D3DX10 header used 12 | #endif 13 | 14 | #ifndef __D3DX10_H__ 15 | #define __D3DX10_H__ 16 | 17 | 18 | // Defines 19 | #include 20 | #include 21 | 22 | #define D3DX10_DEFAULT ((UINT) -1) 23 | #define D3DX10_FROM_FILE ((UINT) -3) 24 | #define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3) 25 | 26 | #ifndef D3DX10INLINE 27 | #ifdef _MSC_VER 28 | #if (_MSC_VER >= 1200) 29 | #define D3DX10INLINE __forceinline 30 | #else 31 | #define D3DX10INLINE __inline 32 | #endif 33 | #else 34 | #ifdef __cplusplus 35 | #define D3DX10INLINE inline 36 | #else 37 | #define D3DX10INLINE 38 | #endif 39 | #endif 40 | #endif 41 | 42 | 43 | 44 | // Includes 45 | #include "d3d10.h" 46 | #include "d3dx10.h" 47 | #include "d3dx10math.h" 48 | #include "d3dx10core.h" 49 | #include "d3dx10tex.h" 50 | #include "d3dx10mesh.h" 51 | #include "d3dx10async.h" 52 | 53 | 54 | // Errors 55 | #define _FACDD 0x876 56 | #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) 57 | 58 | enum _D3DX10_ERR { 59 | D3DX10_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900), 60 | D3DX10_ERR_INVALID_MESH = MAKE_DDHRESULT(2901), 61 | D3DX10_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902), 62 | D3DX10_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903), 63 | D3DX10_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904), 64 | D3DX10_ERR_INVALID_DATA = MAKE_DDHRESULT(2905), 65 | D3DX10_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906), 66 | D3DX10_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907), 67 | D3DX10_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908), 68 | }; 69 | 70 | 71 | #endif //__D3DX10_H__ 72 | 73 | -------------------------------------------------------------------------------- /3rd/include/d3dsdk/D3DX11.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx11.h 6 | // Content: D3DX11 utility library 7 | // 8 | ////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifdef __D3DX11_INTERNAL__ 11 | #error Incorrect D3DX11 header used 12 | #endif 13 | 14 | #ifndef __D3DX11_H__ 15 | #define __D3DX11_H__ 16 | 17 | 18 | // Defines 19 | #include 20 | #include 21 | 22 | #ifdef ALLOW_THROWING_NEW 23 | #include 24 | #endif 25 | 26 | #define D3DX11_DEFAULT ((UINT) -1) 27 | #define D3DX11_FROM_FILE ((UINT) -3) 28 | #define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3) 29 | 30 | #ifndef D3DX11INLINE 31 | #ifdef _MSC_VER 32 | #if (_MSC_VER >= 1200) 33 | #define D3DX11INLINE __forceinline 34 | #else 35 | #define D3DX11INLINE __inline 36 | #endif 37 | #else 38 | #ifdef __cplusplus 39 | #define D3DX11INLINE inline 40 | #else 41 | #define D3DX11INLINE 42 | #endif 43 | #endif 44 | #endif 45 | 46 | 47 | 48 | // Includes 49 | #include "d3d11.h" 50 | #include "d3dx11.h" 51 | #include "d3dx11core.h" 52 | #include "d3dx11tex.h" 53 | #include "d3dx11async.h" 54 | 55 | 56 | // Errors 57 | #define _FACDD 0x876 58 | #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) 59 | 60 | enum _D3DX11_ERR { 61 | D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900), 62 | D3DX11_ERR_INVALID_MESH = MAKE_DDHRESULT(2901), 63 | D3DX11_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902), 64 | D3DX11_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903), 65 | D3DX11_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904), 66 | D3DX11_ERR_INVALID_DATA = MAKE_DDHRESULT(2905), 67 | D3DX11_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906), 68 | D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907), 69 | D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908), 70 | }; 71 | 72 | 73 | #endif //__D3DX11_H__ 74 | 75 | -------------------------------------------------------------------------------- /3rd/include/d3dsdk/dxsdkver.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * 4 | * File: dxsdkver.h 5 | * Content: DirectX SDK Version Include File 6 | * 7 | ****************************************************************************/ 8 | 9 | #ifndef _DXSDKVER_H_ 10 | #define _DXSDKVER_H_ 11 | 12 | #define _DXSDK_PRODUCT_MAJOR 9 13 | #define _DXSDK_PRODUCT_MINOR 29 14 | #define _DXSDK_BUILD_MAJOR 1962 15 | #define _DXSDK_BUILD_MINOR 0 16 | 17 | #endif // _DXSDKVER_H_ 18 | 19 | -------------------------------------------------------------------------------- /3rd/include/polarssl/cipher_wrap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file cipher_wrap.h 3 | * 4 | * \brief Cipher wrappers. 5 | * 6 | * \author Adriaan de Jong 7 | * 8 | * Copyright (C) 2006-2013, Brainspark B.V. 9 | * 10 | * This file is part of PolarSSL (http://www.polarssl.org) 11 | * Lead Maintainer: Paul Bakker 12 | * 13 | * All rights reserved. 14 | * 15 | * This program is free software; you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation; either version 2 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * This program is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along 26 | * with this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 28 | */ 29 | #ifndef POLARSSL_CIPHER_WRAP_H 30 | #define POLARSSL_CIPHER_WRAP_H 31 | 32 | #if !defined(POLARSSL_CONFIG_FILE) 33 | #include "config.h" 34 | #else 35 | #include POLARSSL_CONFIG_FILE 36 | #endif 37 | #include "cipher.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | typedef struct 44 | { 45 | cipher_type_t type; 46 | const cipher_info_t *info; 47 | } cipher_definition_t; 48 | 49 | extern const cipher_definition_t cipher_definitions[]; 50 | 51 | extern int supported_ciphers[]; 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* POLARSSL_CIPHER_WRAP_H */ 58 | -------------------------------------------------------------------------------- /3rd/include/polarssl/memory.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file memory.h 3 | * 4 | * \brief Memory allocation layer (Deprecated to platform layer) 5 | * 6 | * Copyright (C) 2006-2014, Brainspark B.V. 7 | * 8 | * This file is part of PolarSSL (http://www.polarssl.org) 9 | * Lead Maintainer: Paul Bakker 10 | * 11 | * All rights reserved. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with this program; if not, write to the Free Software Foundation, Inc., 25 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 26 | */ 27 | #ifndef POLARSSL_MEMORY_H 28 | #define POLARSSL_MEMORY_H 29 | 30 | #if !defined(POLARSSL_CONFIG_FILE) 31 | #include "config.h" 32 | #else 33 | #include POLARSSL_CONFIG_FILE 34 | #endif 35 | 36 | #include 37 | 38 | #if defined(POLARSSL_MEMORY_C) && !defined(POLARSSL_PLATFORM_MEMORY) 39 | #define POLARSSL_PLATFORM_MEMORY 40 | #endif 41 | 42 | #include "platform.h" 43 | #include "memory_buffer_alloc.h" 44 | 45 | int memory_set_own( void * (*malloc_func)( size_t ), 46 | void (*free_func)( void * ) ) 47 | { 48 | return platform_set_malloc_free( malloc_func, free_func ); 49 | } 50 | 51 | 52 | #endif /* memory.h */ 53 | -------------------------------------------------------------------------------- /3rd/include/polarssl/pk_wrap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file pk.h 3 | * 4 | * \brief Public Key abstraction layer: wrapper functions 5 | * 6 | * Copyright (C) 2006-2013, Brainspark B.V. 7 | * 8 | * This file is part of PolarSSL (http://www.polarssl.org) 9 | * Lead Maintainer: Paul Bakker 10 | * 11 | * All rights reserved. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License along 24 | * with this program; if not, write to the Free Software Foundation, Inc., 25 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 26 | */ 27 | 28 | #ifndef POLARSSL_PK_WRAP_H 29 | #define POLARSSL_PK_WRAP_H 30 | 31 | #if !defined(POLARSSL_CONFIG_FILE) 32 | #include "config.h" 33 | #else 34 | #include POLARSSL_CONFIG_FILE 35 | #endif 36 | 37 | #include "pk.h" 38 | 39 | /* Container for RSA-alt */ 40 | typedef struct 41 | { 42 | void *key; 43 | pk_rsa_alt_decrypt_func decrypt_func; 44 | pk_rsa_alt_sign_func sign_func; 45 | pk_rsa_alt_key_len_func key_len_func; 46 | } rsa_alt_context; 47 | 48 | #if defined(POLARSSL_RSA_C) 49 | extern const pk_info_t rsa_info; 50 | #endif 51 | 52 | #if defined(POLARSSL_ECP_C) 53 | extern const pk_info_t eckey_info; 54 | extern const pk_info_t eckeydh_info; 55 | #endif 56 | 57 | #if defined(POLARSSL_ECDSA_C) 58 | extern const pk_info_t ecdsa_info; 59 | #endif 60 | 61 | extern const pk_info_t rsa_alt_info; 62 | 63 | #endif /* POLARSSL_PK_WRAP_H */ 64 | -------------------------------------------------------------------------------- /3rd/lib/PolarSSL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/lib/PolarSSL.lib -------------------------------------------------------------------------------- /3rd/lib/RakNetLibStatic.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/lib/RakNetLibStatic.lib -------------------------------------------------------------------------------- /3rd/lib/VMProtectSDK32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/lib/VMProtectSDK32.lib -------------------------------------------------------------------------------- /3rd/lib/d3d9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/lib/d3d9.lib -------------------------------------------------------------------------------- /3rd/lib/d3dx9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/lib/d3dx9.lib -------------------------------------------------------------------------------- /3rd/lib/libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/3rd/lib/libcurl.lib -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Solução 4 | project(GHP5) 5 | 6 | # Definições 7 | set(CMAKE_MFC_FLAG 1) 8 | 9 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT /MP") 10 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd /MP") 11 | 12 | add_definitions(-DUNICODE -D_UNICODE) 13 | add_definitions(-DCURL_STATICLIB) 14 | 15 | set(GHP_CORE_VERSION_MAJOR 5) 16 | set(GHP_CORE_VERSION_MINOR 12) 17 | set(GHP_CORE_RELEASE_MAJOR 0) 18 | set(GHP_SRV_VERSION_MAJOR 5) 19 | set(GHP_SRV_VERSION_MINOR 12) 20 | set(GHP_SRV_RELEASE_MAJOR 0) 21 | 22 | # Opções 23 | option (R_WARZ "Compila as ferramentas para usar no WarZ" OFF) 24 | option (R_MUONLINE "Compila as ferramentas para usar no MuOnline" OFF) 25 | option (D_INJECT_DEBUG_LOGIN "Injeta o login Shiu como debug no sistema de USER_ID" OFF) 26 | 27 | # Gera o H 28 | configure_file ( 29 | "${PROJECT_SOURCE_DIR}/include.h.in" 30 | "${PROJECT_SOURCE_DIR}/include.h" 31 | ) 32 | 33 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) 34 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) 35 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) 36 | 37 | # Diretórios do H 38 | include_directories(${PROJECT_SOURCE_DIR}/3rd/include) 39 | 40 | # Diretórios de LIBS 41 | link_directories(${PROJECT_SOURCE_DIR}/3rd/lib) 42 | link_directories(${PROJECT_BINARY_DIR}/lib) 43 | 44 | # Projetos da solução 45 | add_subdirectory(ghp_CRYPTO) 46 | add_subdirectory(ghp_NET) 47 | add_subdirectory(ghp_UTILS) 48 | 49 | add_subdirectory(Hackblocker) 50 | add_subdirectory(MasterServer) 51 | add_subdirectory(DBGen) 52 | add_subdirectory(LicGen) 53 | add_subdirectory(GHPUpdater) 54 | add_subdirectory(GHPServer) 55 | add_subdirectory(GHP) -------------------------------------------------------------------------------- /DBGen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(DBGen) 5 | 6 | add_executable(DBGen main.cpp) 7 | 8 | if(R_WARZ) 9 | set_target_properties(DBGen PROPERTIES PREFIX "WZ_") 10 | endif(R_WARZ) -------------------------------------------------------------------------------- /DBGen/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/DBGen/main.cpp -------------------------------------------------------------------------------- /GHP/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(GHP) 5 | 6 | # Gera o RC 7 | configure_file ( 8 | "${PROJECT_SOURCE_DIR}/resource.rc.in" 9 | "${PROJECT_SOURCE_DIR}/resource.rc" 10 | ) 11 | 12 | add_library(GHP SHARED 13 | ghp_MAIN.cpp 14 | ghp_CORE.cpp ghp_CORE.h 15 | ghp_NETBOX.cpp ghp_NETBOX.h 16 | ghp_HOOK.cpp ghp_HOOK.h 17 | ghp_SCAN.cpp ghp_SCAN.h 18 | ghp_SPLASH.cpp ghp_SPLASH.h 19 | ghp_UPDATER.cpp ghp_UPDATER.h 20 | resource.rc 21 | Detours/creatwth.cpp Detours/detours.cpp Detours/disasm.cpp Detours/image.cpp Detours/modules.cpp 22 | ) 23 | 24 | source_group("Detours" FILES Detours/creatwth.cpp Detours/detours.cpp Detours/disasm.cpp Detours/image.cpp Detours/modules.cpp) 25 | 26 | set_target_properties(GHP PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS") 27 | 28 | if(R_WARZ) 29 | set_target_properties(GHP PROPERTIES PREFIX "WZ_") 30 | endif(R_WARZ) -------------------------------------------------------------------------------- /GHP/Detours/detver.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Common version parameters. 4 | // 5 | // Microsoft Research Detours Package, Version 3.0 Build_316. 6 | // 7 | // Copyright (c) Microsoft Corporation. All rights reserved. 8 | // 9 | 10 | #ifndef DETOURS_STRINGIFY 11 | #define DETOURS_STRINGIFY(x) DETOURS_STRINGIFY_(x) 12 | #define DETOURS_STRINGIFY_(x) #x 13 | #endif 14 | 15 | #define VER_FILEFLAGSMASK 0x3fL 16 | #define VER_FILEFLAGS 0x0L 17 | #define VER_FILEOS 0x00040004L 18 | #define VER_FILETYPE 0x00000002L 19 | #define VER_FILESUBTYPE 0x00000000L 20 | 21 | #define VER_DETOURS_BITS DETOUR_STRINGIFY(DETOURS_BITS) 22 | -------------------------------------------------------------------------------- /GHP/ghp_CORE.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/GHP/ghp_CORE.cpp -------------------------------------------------------------------------------- /GHP/ghp_CORE.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_CORE_H_ 2 | #define _GHP_CORE_H_ 3 | 4 | #include "..\include.h" 5 | #include "ghp_HOOK.h" 6 | #include "..\ghp_UTILS\ghp_LOG.h" 7 | #include "..\ghp_UTILS\ghp_LIC.h" 8 | #include "..\ghp_UTILS\ghp_DB.h" 9 | 10 | enum GHP_ERRORS 11 | { 12 | ERROR_INVALID_LIC, 13 | ERROR_INVALID_DB, 14 | ERROR_WHILE_HOOKING, 15 | ERROR_INSUFFICIENT_PRIVILEGES, 16 | ERROR_WHILE_CONNECTING_TO_SERVER, 17 | ERROR_DISCONNECTED_FROM_SERVER, 18 | ERROR_CORRUPTED_PACKET, 19 | ERROR_STOPPED_WORKING, 20 | ERROR_PROCESS_SCAN, 21 | ERROR_CHEAT_FOUND, 22 | ERROR_WHILE_CREATING_THREAD, 23 | ERROR_MEMORY_PROTECTED_WAS_CORRUPTED, 24 | ERROR_CRC_INVALID, 25 | ERROR_SPEED_SCAN, 26 | ERROR_TIMER_CHECK, 27 | ERROR_INVALID_API_KEY, 28 | ERROR_GHP_BIN, 29 | ERROR_WHITELIST, 30 | ERROR_DECRYPT_FAILED 31 | }; 32 | 33 | extern HANDLE hGHP; 34 | 35 | extern ghp_UTILS::Log ghpLog; 36 | extern ghp_UTILS::Lic * ghpLic; 37 | extern ghp_UTILS::DB * ghpDB; 38 | 39 | extern ghp_UTILS::DataChunk GameSerial; 40 | extern std::string GameLogin; 41 | extern std::string LastGameLogin; 42 | extern std::list hwids; 43 | extern std::vector crc; 44 | extern std::vector ghpsrv_hacks; 45 | 46 | extern DWORD lastLoop, mainThread; 47 | extern bool loadlock; 48 | #ifdef R_WARZ 49 | extern LPDIRECT3DDEVICE9 d3ddev; 50 | #endif 51 | 52 | extern DWORD WINAPI GHPCore(LPVOID lpParam); 53 | 54 | extern void Start(); 55 | extern void Stop(); 56 | extern void Error(USHORT id, USHORT code, DWORD error_code = 0); 57 | 58 | #endif -------------------------------------------------------------------------------- /GHP/ghp_HOOK.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/GHP/ghp_HOOK.cpp -------------------------------------------------------------------------------- /GHP/ghp_HOOK.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_HOOK_H_ 2 | #define _GHP_HOOK_H_ 3 | 4 | #include "..\include.h" 5 | 6 | extern DWORD lastCore, lastNET; 7 | extern UINT HookAPI(); 8 | 9 | extern DWORD (WINAPI * ori_timeGetTime) (); 10 | extern VOID (WINAPI * ori_ExitProcess) (UINT uExitCode); 11 | 12 | #endif -------------------------------------------------------------------------------- /GHP/ghp_NETBOX.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/GHP/ghp_NETBOX.cpp -------------------------------------------------------------------------------- /GHP/ghp_NETBOX.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_NETBOX_H_ 2 | #define _GHP_NETBOX_H_ 3 | 4 | #include "..\include.h" 5 | #include "..\ghp_UTILS\ghp_PROTOCOL.h" 6 | 7 | extern DWORD lastPing; 8 | extern bool SerialReceived; 9 | 10 | extern void SendInfo(UCHAR header, std::string info); 11 | 12 | extern DWORD WINAPI NETBoxThread(LPVOID lpParam); 13 | extern void SendPacket(LPVOID Packet, UINT size, bool SendNow = false); 14 | 15 | extern void ShutdownNETBox(); 16 | 17 | #endif -------------------------------------------------------------------------------- /GHP/ghp_SCAN.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/GHP/ghp_SCAN.cpp -------------------------------------------------------------------------------- /GHP/ghp_SCAN.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_SCAN_H_ 2 | #define _GHP_SCAN_H_ 3 | 4 | #include "..\include.h" 5 | #include "ghp_HOOK.h" 6 | 7 | extern void ProcessScan(); 8 | extern void HiddenScan(); 9 | extern void SpeedScan(); 10 | 11 | #endif -------------------------------------------------------------------------------- /GHP/ghp_SPLASH.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/GHP/ghp_SPLASH.cpp -------------------------------------------------------------------------------- /GHP/ghp_SPLASH.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_SPLASH_H_ 2 | #define _GHP_SPLASH_H_ 3 | 4 | #include "..\include.h" 5 | #include "ghp_CORE.h" 6 | #include "ghp_UPDATER.h" 7 | #include "..\ghp_UTILS\ghp_FILE.h" 8 | 9 | //void extern StartSplash(); 10 | 11 | #endif -------------------------------------------------------------------------------- /GHP/ghp_UPDATER.cpp: -------------------------------------------------------------------------------- 1 | #include "ghp_UPDATER.h" 2 | 3 | char * updater_sha1 = ""; 4 | 5 | UINT updater_size = 4; 6 | 7 | UCHAR updater_data[] = { 0x00, 0x00, 0x00, 0x00 }; -------------------------------------------------------------------------------- /GHP/ghp_UPDATER.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_UPDATER_H_ 2 | #define _GHP_UPDATER_H_ 3 | 4 | #include "..\include.h" 5 | 6 | extern char * updater_sha1; 7 | extern UINT updater_size; 8 | extern UCHAR updater_data[]; 9 | 10 | #endif -------------------------------------------------------------------------------- /GHP/resource.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | MUICON Icon "..\\..\\data\\mu.ico" 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION 5,12,0,0 7 | PRODUCTVERSION 5,12,0,0 8 | FILEOS VOS__WINDOWS32 9 | FILETYPE VFT_DLL 10 | BEGIN 11 | BLOCK "StringFileInfo" 12 | BEGIN 13 | BLOCK "040904E4" 14 | BEGIN 15 | VALUE "CompanyName", "Game Hack Protector" 16 | VALUE "FileDescription", "GHP [Client]" 17 | VALUE "FileVersion", "5.12.0" 18 | VALUE "InternalName", "GHP [Client]" 19 | VALUE "LegalCopyright", "Game Hack Protector" 20 | VALUE "LegalTrademarks", "Game Hack Protector" 21 | VALUE "OriginalFilename", "GHP.dll" 22 | VALUE "ProductName", "GHP" 23 | VALUE "ProductVersion", "5.12.0" 24 | END 25 | END 26 | 27 | BLOCK "VarFileInfo" 28 | BEGIN 29 | VALUE "Translation", 0x0409, 0x04E4 30 | END 31 | END 32 | -------------------------------------------------------------------------------- /GHP/resource.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | MUICON Icon "..\\..\\data\\mu.ico" 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION @GHP_CORE_VERSION_MAJOR@,@GHP_CORE_VERSION_MINOR@,@GHP_CORE_RELEASE_MAJOR@,0 7 | PRODUCTVERSION @GHP_CORE_VERSION_MAJOR@,@GHP_CORE_VERSION_MINOR@,@GHP_CORE_RELEASE_MAJOR@,0 8 | FILEOS VOS__WINDOWS32 9 | FILETYPE VFT_DLL 10 | BEGIN 11 | BLOCK "StringFileInfo" 12 | BEGIN 13 | BLOCK "040904E4" 14 | BEGIN 15 | VALUE "CompanyName", "Game Hack Protector" 16 | VALUE "FileDescription", "GHP [Client]" 17 | VALUE "FileVersion", "@GHP_CORE_VERSION_MAJOR@.@GHP_CORE_VERSION_MINOR@.@GHP_CORE_RELEASE_MAJOR@" 18 | VALUE "InternalName", "GHP [Client]" 19 | VALUE "LegalCopyright", "Game Hack Protector" 20 | VALUE "LegalTrademarks", "Game Hack Protector" 21 | VALUE "OriginalFilename", "GHP.dll" 22 | VALUE "ProductName", "GHP" 23 | VALUE "ProductVersion", "@GHP_CORE_VERSION_MAJOR@.@GHP_CORE_VERSION_MINOR@.@GHP_CORE_RELEASE_MAJOR@" 24 | END 25 | END 26 | 27 | BLOCK "VarFileInfo" 28 | BEGIN 29 | VALUE "Translation", 0x0409, 0x04E4 30 | END 31 | END -------------------------------------------------------------------------------- /GHPServer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(GHPServer) 5 | 6 | # Gera o RC 7 | configure_file ( 8 | "${PROJECT_SOURCE_DIR}/resource.rc.in" 9 | "${PROJECT_SOURCE_DIR}/resource.rc" 10 | ) 11 | 12 | add_executable(GHPServer WIN32 13 | main.cpp 14 | ServerCore.cpp ServerCore.h 15 | resource.rc 16 | ) -------------------------------------------------------------------------------- /GHPServer/ServerCore.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/GHPServer/ServerCore.cpp -------------------------------------------------------------------------------- /GHPServer/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/GHPServer/main.cpp -------------------------------------------------------------------------------- /GHPServer/resource.rc: -------------------------------------------------------------------------------- 1 | #include 2 | MAINICON Icon "..\\..\\data\\gdserverico.ico" 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION 5,12,0,0 6 | PRODUCTVERSION 5,12,0,0 7 | FILEOS VOS__WINDOWS32 8 | FILETYPE VFT_APP 9 | BEGIN 10 | BLOCK "StringFileInfo" 11 | BEGIN 12 | BLOCK "040904E4" 13 | BEGIN 14 | VALUE "CompanyName", "Game Hack Protector" 15 | VALUE "FileDescription", "GHP [Server]" 16 | VALUE "FileVersion", "5.12.0" 17 | VALUE "InternalName", "GHP [Server]" 18 | VALUE "LegalCopyright", "Game Hack Protector" 19 | VALUE "LegalTrademarks", "Game Hack Protector" 20 | VALUE "OriginalFilename", "GHPServer.exe" 21 | VALUE "ProductName", "GHPServer" 22 | VALUE "ProductVersion", "5.12.0" 23 | END 24 | END 25 | 26 | BLOCK "VarFileInfo" 27 | BEGIN 28 | VALUE "Translation", 0x0409, 0x04E4 29 | END 30 | END 31 | -------------------------------------------------------------------------------- /GHPServer/resource.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | MAINICON Icon "..\\..\\data\\gdserverico.ico" 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION @GHP_SRV_VERSION_MAJOR@,@GHP_SRV_VERSION_MINOR@,@GHP_SRV_RELEASE_MAJOR@,0 6 | PRODUCTVERSION @GHP_SRV_VERSION_MAJOR@,@GHP_SRV_VERSION_MINOR@,@GHP_SRV_RELEASE_MAJOR@,0 7 | FILEOS VOS__WINDOWS32 8 | FILETYPE VFT_APP 9 | BEGIN 10 | BLOCK "StringFileInfo" 11 | BEGIN 12 | BLOCK "040904E4" 13 | BEGIN 14 | VALUE "CompanyName", "Game Hack Protector" 15 | VALUE "FileDescription", "GHP [Server]" 16 | VALUE "FileVersion", "@GHP_SRV_VERSION_MAJOR@.@GHP_SRV_VERSION_MINOR@.@GHP_SRV_RELEASE_MAJOR@" 17 | VALUE "InternalName", "GHP [Server]" 18 | VALUE "LegalCopyright", "Game Hack Protector" 19 | VALUE "LegalTrademarks", "Game Hack Protector" 20 | VALUE "OriginalFilename", "GHPServer.exe" 21 | VALUE "ProductName", "GHPServer" 22 | VALUE "ProductVersion", "@GHP_SRV_VERSION_MAJOR@.@GHP_SRV_VERSION_MINOR@.@GHP_SRV_RELEASE_MAJOR@" 23 | END 24 | END 25 | 26 | BLOCK "VarFileInfo" 27 | BEGIN 28 | VALUE "Translation", 0x0409, 0x04E4 29 | END 30 | END -------------------------------------------------------------------------------- /GHPUpdater/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(GHPUpdater) 5 | 6 | # Gera o RC 7 | configure_file ( 8 | "${PROJECT_SOURCE_DIR}/resource.rc.in" 9 | "${PROJECT_SOURCE_DIR}/resource.rc" 10 | ) 11 | 12 | add_executable(GHPUpdater WIN32 13 | main.cpp 14 | resource.rc 15 | ) -------------------------------------------------------------------------------- /GHPUpdater/resource.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | MAINICON Icon "..\\..\\data\\ghp.ico" 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION 5,12,0,0 7 | PRODUCTVERSION 5,12,0,0 8 | FILEOS VOS__WINDOWS32 9 | FILETYPE VFT_APP 10 | BEGIN 11 | BLOCK "StringFileInfo" 12 | BEGIN 13 | BLOCK "040904E4" 14 | BEGIN 15 | VALUE "CompanyName", "Game Hack Protector" 16 | VALUE "FileDescription", "GHP [Updater]" 17 | VALUE "FileVersion", "5.12.0" 18 | VALUE "InternalName", "GHP [Updater]" 19 | VALUE "LegalCopyright", "Game Hack Protector" 20 | VALUE "LegalTrademarks", "Game Hack Protector" 21 | VALUE "OriginalFilename", "GHP.bin" 22 | VALUE "ProductName", "GHPUpdater" 23 | VALUE "ProductVersion", "5.12.0" 24 | END 25 | END 26 | 27 | BLOCK "VarFileInfo" 28 | BEGIN 29 | VALUE "Translation", 0x0409, 0x04E4 30 | END 31 | END 32 | -------------------------------------------------------------------------------- /GHPUpdater/resource.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | MAINICON Icon "..\\..\\data\\ghp.ico" 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION @GHP_CORE_VERSION_MAJOR@,@GHP_CORE_VERSION_MINOR@,@GHP_CORE_RELEASE_MAJOR@,0 7 | PRODUCTVERSION @GHP_CORE_VERSION_MAJOR@,@GHP_CORE_VERSION_MINOR@,@GHP_CORE_RELEASE_MAJOR@,0 8 | FILEOS VOS__WINDOWS32 9 | FILETYPE VFT_APP 10 | BEGIN 11 | BLOCK "StringFileInfo" 12 | BEGIN 13 | BLOCK "040904E4" 14 | BEGIN 15 | VALUE "CompanyName", "Game Hack Protector" 16 | VALUE "FileDescription", "GHP [Updater]" 17 | VALUE "FileVersion", "@GHP_CORE_VERSION_MAJOR@.@GHP_CORE_VERSION_MINOR@.@GHP_CORE_RELEASE_MAJOR@" 18 | VALUE "InternalName", "GHP [Updater]" 19 | VALUE "LegalCopyright", "Game Hack Protector" 20 | VALUE "LegalTrademarks", "Game Hack Protector" 21 | VALUE "OriginalFilename", "GHP.bin" 22 | VALUE "ProductName", "GHPUpdater" 23 | VALUE "ProductVersion", "@GHP_CORE_VERSION_MAJOR@.@GHP_CORE_VERSION_MINOR@.@GHP_CORE_RELEASE_MAJOR@" 24 | END 25 | END 26 | 27 | BLOCK "VarFileInfo" 28 | BEGIN 29 | VALUE "Translation", 0x0409, 0x04E4 30 | END 31 | END -------------------------------------------------------------------------------- /Hackblocker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(Hackblocker) 5 | 6 | add_executable(Hackblocker main.cpp) -------------------------------------------------------------------------------- /Hackblocker/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Hackblocker/main.cpp -------------------------------------------------------------------------------- /LicGen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(LicGen) 5 | 6 | add_executable(LicGen main.cpp) 7 | 8 | if(R_WARZ) 9 | set_target_properties(LicGen PROPERTIES PREFIX "WZ_") 10 | endif(R_WARZ) -------------------------------------------------------------------------------- /LicGen/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/LicGen/main.cpp -------------------------------------------------------------------------------- /MasterServer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(MasterServer) 5 | 6 | add_executable(MasterServer main.cpp main.h) -------------------------------------------------------------------------------- /MasterServer/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/MasterServer/main.cpp -------------------------------------------------------------------------------- /MasterServer/main.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAIN_H_ 2 | #define _MAIN_H_ 3 | 4 | #include "..\include.h" 5 | #include "..\ghp_NET\mongoose.h" 6 | #include "..\ghp_UTILS\ghp_LOG.h" 7 | #include "..\ghp_UTILS\ghp_SYSTEM.h" 8 | #include "..\ghp_UTILS\tinyxml2\tinyxml2.h" 9 | #include "..\ghp_UTILS\hiberlite\hiberlite.h" 10 | 11 | #define ADMIN_KEY "ZdDSP2EXXnRDNWbfpEqSHvpv" 12 | #define SUB_KEY "UO9OG6K3VK" 13 | 14 | class Server 15 | { 16 | friend class hiberlite::access; 17 | template 18 | void hibernate(Archive & ar) 19 | { 20 | ar & HIBERLITE_NVP(c_ref); 21 | ar & HIBERLITE_NVP(srvname); 22 | ar & HIBERLITE_NVP(srvip); 23 | ar & HIBERLITE_NVP(expire); 24 | ar & HIBERLITE_NVP(players); 25 | } 26 | public: 27 | std::string c_ref; 28 | std::string srvname; 29 | std::string srvip; 30 | std::string expire; 31 | int players; 32 | }; HIBERLITE_EXPORT_CLASS(Server) 33 | 34 | class Cliente 35 | { 36 | friend class hiberlite::access; 37 | template 38 | void hibernate(Archive & ar) 39 | { 40 | ar & HIBERLITE_NVP(name); 41 | ar & HIBERLITE_NVP(email); 42 | ar & HIBERLITE_NVP(servers); 43 | } 44 | public: 45 | std::string name; 46 | std::string email; 47 | std::vector servers; 48 | }; HIBERLITE_EXPORT_CLASS(Cliente) 49 | 50 | #endif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hackshield 2 | 反外挂带CRC校验 3 | -------------------------------------------------------------------------------- /Release/0.Backup.bat: -------------------------------------------------------------------------------- 1 | del GHP_backup.dll 2 | del WZ_GHP_backup.dll 3 | ren GHP.dll GHP_backup.dll 4 | ren WZ_GHP.dll WZ_GHP_backup.dll -------------------------------------------------------------------------------- /Release/0.Restore.bat: -------------------------------------------------------------------------------- 1 | del GHP.dll 2 | del WZ_GHP.dll 3 | ren GHP_backup.dll GHP.dll 4 | ren WZ_GHP_backup.dll WZ_GHP.dll -------------------------------------------------------------------------------- /Release/1.Copy.bat: -------------------------------------------------------------------------------- 1 | xcopy "Z:\GHP 5\Projeto\bin\Release\*.*" "Z:\GHP 5\Release\" /Y -------------------------------------------------------------------------------- /Release/2.GenMU.bat: -------------------------------------------------------------------------------- 1 | LicGen.exe 2 | DBGen.exe -------------------------------------------------------------------------------- /Release/2.GenWARZ.bat: -------------------------------------------------------------------------------- 1 | WZ_LicGen.exe 2 | WZ_DBGen.exe -------------------------------------------------------------------------------- /Release/3.CleanLic.bat: -------------------------------------------------------------------------------- 1 | del NET.KEY 2 | del PRV.KEY 3 | del PUB.KEY 4 | LicData.ini -------------------------------------------------------------------------------- /Release/4.GenUpdater.bat: -------------------------------------------------------------------------------- 1 | GHPUpdater.exe -generate 2 | xcopy "Z:\GHP 5\Release\ghp_UPDATER.cpp" "Z:\GHP 5\GHP\" /Y 3 | del ghp_UPDATER.cpp -------------------------------------------------------------------------------- /Release/5.WZ_to_MU.bat: -------------------------------------------------------------------------------- 1 | del GHP.dll 2 | ren WZ_GHP.dll GHP.dll -------------------------------------------------------------------------------- /Release/APIWhitelist.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/APIWhitelist.bin -------------------------------------------------------------------------------- /Release/APIWhitelist.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 -------------------------------------------------------------------------------- /Release/CheatWhitelist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/CheatWhitelist.txt -------------------------------------------------------------------------------- /Release/Config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | false 9 | false 10 | false 11 | 300 12 | 0 13 | 0 14 | 0 15 | 0 16 | 0 17 | 0 18 | 0 19 | 1 20 | 1 21 | A 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Release/DBGen.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/DBGen.exe -------------------------------------------------------------------------------- /Release/GHPServer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/GHPServer.exe -------------------------------------------------------------------------------- /Release/GHPServer.ini: -------------------------------------------------------------------------------- 1 | [BIND] 2 | ghpserver=55507 3 | webserver=55508 4 | max_connections=1000 5 | 6 | [AUTH] 7 | user=admin 8 | password=1234 9 | 10 | [CFG] 11 | lang=pt 12 | acc_multisession=0 13 | hwid_multisession=0 14 | 15 | [AUTOBAN] 16 | acc=0 17 | hwid=0 18 | ip=0 19 | 20 | [SS] 21 | quality=25 22 | grayscale=0 23 | auto_ss_interval=0 24 | 25 | [MU] 26 | serial=0000000000000000 27 | 28 | [API] 29 | force_api=0 30 | call_api=0 31 | status_notify= 32 | acc_ban_url= -------------------------------------------------------------------------------- /Release/GHPServer_5.12.0_150131_full_RC.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/GHPServer_5.12.0_150131_full_RC.zip -------------------------------------------------------------------------------- /Release/GHPUpdater.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/GHPUpdater.exe -------------------------------------------------------------------------------- /Release/LicGen.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/LicGen.exe -------------------------------------------------------------------------------- /Release/MasterServer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/MasterServer.exe -------------------------------------------------------------------------------- /Release/VMProtectSDK32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/VMProtectSDK32.dll -------------------------------------------------------------------------------- /Release/WZ_DBGen.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/WZ_DBGen.exe -------------------------------------------------------------------------------- /Release/WZ_LicGen.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/WZ_LicGen.exe -------------------------------------------------------------------------------- /Release/data/hwid/Shiu.ini: -------------------------------------------------------------------------------- 1 | [hwids] 2 | count=3 3 | 1=4441B2EE-F4BC0E75-8AF26213-8E4BCAD6-FE8BE0B1 4 | 2=8CC3A4AD-36A46794-BD596480-B3A15592-1E638CA7 5 | 3=8C371146-20DA4634-AB632E81-F54E4105-6771716E 6 | -------------------------------------------------------------------------------- /Release/data/info/Shiu.ini: -------------------------------------------------------------------------------- 1 | [info] 2 | lastlogin=1411451108 3 | -------------------------------------------------------------------------------- /Release/data/logs/hwid/4441B2EE-F4BC0E75-8AF26213-8E4BCAD6-FE8BE0B1.log: -------------------------------------------------------------------------------- 1 | [17/09/2014 - 14:13:59] HWID banned: Bloqueado pelo administrador - 4441B2EE-F4BC0E75-8AF26213-8E4BCAD6-FE8BE0B1 2 | [17/09/2014 - 14:19:23] HWID banned: Bloqueado pelo administrador - 4441B2EE-F4BC0E75-8AF26213-8E4BCAD6-FE8BE0B1 3 | [17/09/2014 - 16:04:03] HACK detected: C:\Program Files (x86)\Cheat Engine 6.4\Cheat Engine.exe 4 | -------------------------------------------------------------------------------- /Release/data/logs/hwid/8C371146-20DA4634-AB632E81-F54E4105-6771716E.log: -------------------------------------------------------------------------------- 1 | [17/09/2014 - 14:13:59] HWID banned: Bloqueado pelo administrador - 8C371146-20DA4634-AB632E81-F54E4105-6771716E 2 | [17/09/2014 - 14:19:23] HWID banned: Bloqueado pelo administrador - 8C371146-20DA4634-AB632E81-F54E4105-6771716E 3 | [17/09/2014 - 16:04:03] HACK detected: C:\Program Files (x86)\Cheat Engine 6.4\Cheat Engine.exe 4 | -------------------------------------------------------------------------------- /Release/data/logs/hwid/8CC3A4AD-36A46794-BD596480-B3A15592-1E638CA7.log: -------------------------------------------------------------------------------- 1 | [17/09/2014 - 14:13:59] HWID banned: Bloqueado pelo administrador - 8CC3A4AD-36A46794-BD596480-B3A15592-1E638CA7 2 | [17/09/2014 - 14:19:23] HWID banned: Bloqueado pelo administrador - 8CC3A4AD-36A46794-BD596480-B3A15592-1E638CA7 3 | [17/09/2014 - 16:04:03] HACK detected: C:\Program Files (x86)\Cheat Engine 6.4\Cheat Engine.exe 4 | -------------------------------------------------------------------------------- /Release/data/logs/ip/127.0.0.1.log: -------------------------------------------------------------------------------- 1 | [17/09/2014 - 16:04:03] HACK detected: C:\Program Files (x86)\Cheat Engine 6.4\Cheat Engine.exe 2 | [23/09/2014 - 00:51:51] HACK detected: Z:\GHP 5\Release\mu.exe 3 | -------------------------------------------------------------------------------- /Release/data/logs/login/Shiu.log: -------------------------------------------------------------------------------- 1 | [17/09/2014 - 16:04:03] HACK detected: C:\Program Files (x86)\Cheat Engine 6.4\Cheat Engine.exe 2 | -------------------------------------------------------------------------------- /Release/data/ss/Shiu/2014_09_17_16_03_48_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/data/ss/Shiu/2014_09_17_16_03_48_0.jpg -------------------------------------------------------------------------------- /Release/data/ss/Shiu/2014_09_17_16_03_48_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/data/ss/Shiu/2014_09_17_16_03_48_1.jpg -------------------------------------------------------------------------------- /Release/db.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/db.bin -------------------------------------------------------------------------------- /Release/ghp.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/ghp.bin -------------------------------------------------------------------------------- /Release/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/index.html -------------------------------------------------------------------------------- /Release/internal/LicData.ini: -------------------------------------------------------------------------------- 1 | [data] 2 | name=Internal 3 | ip=127.0.0.1 4 | link=http://127.0.0.1/ghp/erro.php?id=%d&code=%d 5 | c_ref=4957850A-6EC5CC28-D43C9C6B-381CF3FF-04187389 6 | apikey=0xF43F33E9 7 | time_1=0x556E8356 8 | time_2=0x9CE8545F 9 | -------------------------------------------------------------------------------- /Release/internal/NET.KEY: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/Release/internal/NET.KEY -------------------------------------------------------------------------------- /Release/internal/PUB.KEY: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAj1rYaxLo2ohUaNc10nIf 3 | lt8xLBAcq9y+Zhtb6pTGC4sgA97SXsibxb6bxET/LGSO6/w4R23Yf4uAohzQPtB9 4 | qC9JrR+BIofu0icxKXLe1GswcRK0HdZdyXb8RcHNjyLnRD57O83rwipM1nynF1rj 5 | fUkAoXF33JZoYvXuGbeH3xlZpz2tZZVGzeJODNLo/+rGjAufhxke7F6iMeh7zV4g 6 | 8KDtmrpAMx7rcwded5P3KA5DmbMyqkoxBQH+V0BQdmwUxso/n7ii7XkagjGPiQo7 7 | tE1D114Of2JOXS6upSfid6x8k6fTF9v9z8UZXmzKy9jW2XyDykqxC7BpdQP6+rfr 8 | GZfS0hu6RdX2r3Q2hwVBpQggNgQGmN0IWe8+TIVTIVoYDNfG9G6lqQoJgGxNocAY 9 | PbzpEEb5ezvfGJ8X4EMoiNcrKCSRh72erSAGwAtgoXIfxcFUusYYF5qlK4xGd1z3 10 | Ujaqnfd5SbCQgBqW8pIRsKrcev4wsE9Atf7pxNTlc6YrBB9TtYbtQHtdnW2efm3h 11 | RY+Srj0i2ECnlWcNnluI/JaxF4jCvRa9UBCb0O+nJ2BQRGjhLkB8dQ11RXgpsfcw 12 | TLQ1cog4qX4OAMA/UbwUcRB99xlEUtOGy62/qyZaYL/3v8R3ciofq0z8YoVqi9kN 13 | GHEl226wfwtGYm97Nb2CY+kCAwEAAQ== 14 | -----END PUBLIC KEY----- 15 | -------------------------------------------------------------------------------- /data/MU.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/data/MU.ICO -------------------------------------------------------------------------------- /data/close_1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/data/close_1.bmp -------------------------------------------------------------------------------- /data/close_2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/data/close_2.bmp -------------------------------------------------------------------------------- /data/close_3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/data/close_3.bmp -------------------------------------------------------------------------------- /data/gdserverico.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/data/gdserverico.ico -------------------------------------------------------------------------------- /data/gdserverico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/data/gdserverico.png -------------------------------------------------------------------------------- /data/ghp.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/data/ghp.ico -------------------------------------------------------------------------------- /data/ghpexico.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/data/ghpexico.ico -------------------------------------------------------------------------------- /data/ptinfo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/data/ptinfo.bmp -------------------------------------------------------------------------------- /ghp_CRYPTO/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(ghp_CRYPTO) 5 | 6 | add_library(ghp_CRYPTO STATIC 7 | ghp_CRYPTO.cpp ghp_CRYPTO.h 8 | ) 9 | 10 | #TARGET_LINK_LIBRARIES(ghp_CRYPTO ghp_CRYPTO) -------------------------------------------------------------------------------- /ghp_CRYPTO/ghp_CRYPTO.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/ghp_CRYPTO/ghp_CRYPTO.cpp -------------------------------------------------------------------------------- /ghp_CRYPTO/ghp_CRYPTO.h: -------------------------------------------------------------------------------- 1 | #include "..\include.h" 2 | #include "..\ghp_UTILS\ghp_DEFS.h" 3 | 4 | #include "polarssl\config.h" 5 | #include "polarssl\pk.h" 6 | #include "polarssl\entropy.h" 7 | #include "polarssl\ctr_drbg.h" 8 | #include "polarssl\sha1.h" 9 | 10 | #pragma comment (lib, "PolarSSL.lib") 11 | #pragma comment (lib, "RakNetLibStatic.lib") 12 | 13 | namespace ghp_CRYPTO 14 | { 15 | /*extern inline DWORD EncryptDWORD(DWORD value); 16 | extern inline DWORD DecryptDWORD(DWORD value); 17 | extern bool GenerateRaketNetKeys(UCHAR * publickey, UCHAR * privatekey); 18 | extern bool GenerateRSAKey(std::string Peer, std::string * publickey, std::string * privatekey); 19 | extern bool GetFileSignature(std::wstring FileName, std::string PrivateKey, std::string Peer, ghp_UTILS::DataChunk * signature); 20 | extern bool SignFile(std::wstring FileName, std::string PrivateKey, std::string Peer); 21 | extern bool RemoveSignatureFromDataChunk(ghp_UTILS::DataChunk * memory, ghp_UTILS::DataChunk * signature); 22 | extern bool VerifyDataChunkSignature(ghp_UTILS::DataChunk * memory, ghp_UTILS::DataChunk * signature, std::string PublicKey, std::string Peer); 23 | extern bool VerifyFileSignature(std::wstring FileName, ghp_UTILS::DataChunk * signature, std::string PublicKey, std::string Peer); 24 | extern bool EncFileAES(std::wstring FileNameIn, std::wstring FileNameOut, UCHAR * key); 25 | extern bool DecAES(ghp_UTILS::DataChunk * in, ghp_UTILS::DataChunk * out, UCHAR * key); 26 | extern bool DecFileAESToMemory(std::wstring FileName, ghp_UTILS::DataChunk * memory, UCHAR * key);*/ 27 | extern std::string CalculeSHA1(ghp_UTILS::DataChunk * memory); 28 | extern std::string GetFormatedSHA1(ghp_UTILS::DataChunk * memory); 29 | extern bool CalculeFileSHA1(std::wstring FileName, UCHAR * hash); 30 | } -------------------------------------------------------------------------------- /ghp_NET/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(ghp_NET) 5 | 6 | add_library(ghp_NET STATIC 7 | mongoose.c mongoose.h 8 | ghp_HTTPCLIENT.cpp ghp_HTTPCLIENT.h 9 | ) 10 | 11 | #TARGET_LINK_LIBRARIES(ghp_NET ghp_NET) -------------------------------------------------------------------------------- /ghp_NET/ghp_HTTPCLIENT.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/ghp_NET/ghp_HTTPCLIENT.cpp -------------------------------------------------------------------------------- /ghp_NET/ghp_HTTPCLIENT.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_HTTPCLIENT_H_ 2 | #define _GHP_HTTPCLIENT_H_ 3 | 4 | #include "..\include.h" 5 | #include "..\ghp_UTILS\ghp_DEFS.h" 6 | #include 7 | 8 | #pragma comment (lib, "libcurl.lib") 9 | 10 | namespace ghp_NET 11 | { 12 | enum HTTP_STATUS 13 | { 14 | HTTP_STATUS_NONE = 0, 15 | HTTP_STATUS_DOWNLOADING 16 | }; 17 | 18 | class HTTPClient 19 | { 20 | private: 21 | HTTP_STATUS status; 22 | 23 | bool GetURL(std::string URL, ghp_UTILS::DataChunk * data); 24 | public: 25 | HTTPClient(); 26 | ~HTTPClient(); 27 | 28 | bool GetURLToFile(std::string URL, std::wstring FileName); 29 | bool GetURLToString(std::string URL, std::string * string); 30 | bool GetURLToDataChunk(std::string URL, ghp_UTILS::DataChunk * data); 31 | 32 | std::string SafeURL(std::string url); 33 | HTTP_STATUS Status(); 34 | float GetCompletion(); 35 | }; 36 | } 37 | 38 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | # Nome do projeto 4 | project(ghp_UTILS) 5 | 6 | add_library(ghp_UTILS STATIC 7 | ghp_DB.cpp ghp_DB.h 8 | ghp_DEFS.h 9 | ghp_ENCDEC.cpp ghp_ENCDEC.h 10 | ghp_FILE.cpp ghp_FILE.h 11 | ghp_LIC.cpp ghp_LIC.h 12 | ghp_LOG.cpp ghp_LOG.h 13 | ghp_MU.cpp ghp_MU.h 14 | ghp_PROTOCOL.h 15 | ghp_STRUCTURED_FILE.cpp ghp_STRUCTURED_FILE.h 16 | ghp_MEMORY_PROTECTION.cpp ghp_MEMORY_PROTECTION.h 17 | ghp_SYSTEM.cpp ghp_SYSTEM.h 18 | jpeg-compressor/jpge.cpp jpeg-compressor/jpge.h 19 | jpeg-compressor/jpgd.cpp jpeg-compressor/jpgd.h 20 | hiberlite/BeanLoader.cpp hiberlite/BeanUpdater.cpp hiberlite/ChildKiller.cpp hiberlite/CppModel.cpp hiberlite/Database.cpp 21 | hiberlite/ModelExtractor.cpp hiberlite/Registry.cpp hiberlite/shared_res.cpp hiberlite/SQLiteStmt.cpp hiberlite/Visitor.cpp hiberlite/sqlite3.c 22 | tinyxml2/tinyxml2.cpp tinyxml2/tinyxml2.h 23 | ) 24 | 25 | source_group("JPGE" FILES 26 | jpeg-compressor/jpge.cpp jpeg-compressor/jpge.h 27 | jpeg-compressor/jpgd.cpp jpeg-compressor/jpgd.h 28 | ) 29 | 30 | source_group("TinyXML2" FILES 31 | tinyxml2/tinyxml2.cpp tinyxml2/tinyxml2.h 32 | ) 33 | 34 | source_group("hiberlite" FILES 35 | hiberlite/BeanLoader.cpp hiberlite/BeanUpdater.cpp hiberlite/ChildKiller.cpp hiberlite/CppModel.cpp hiberlite/Database.cpp 36 | hiberlite/ModelExtractor.cpp hiberlite/Registry.cpp hiberlite/shared_res.cpp hiberlite/SQLiteStmt.cpp hiberlite/Visitor.cpp hiberlite/sqlite3.c 37 | ) 38 | 39 | #TARGET_LINK_LIBRARIES(ghp_UTILS ghp_UTILS) -------------------------------------------------------------------------------- /ghp_UTILS/ghp_DB.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/ghp_UTILS/ghp_DB.cpp -------------------------------------------------------------------------------- /ghp_UTILS/ghp_DB.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_DB_H_ 2 | #define _GHP_DB_H_ 3 | 4 | #include "..\include.h" 5 | #include "ghp_STRUCTURED_FILE.h" 6 | 7 | namespace ghp_UTILS 8 | { 9 | class DB 10 | { 11 | private: 12 | std::vector db; 13 | public: 14 | bool ImportFromStructuredFile(StructuredFile * structured); 15 | 16 | UINT GetEntryCount(); 17 | Database GetEntry(UINT index); 18 | }; 19 | } 20 | 21 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/ghp_DEFS.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/ghp_UTILS/ghp_DEFS.h -------------------------------------------------------------------------------- /ghp_UTILS/ghp_ENCDEC.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_ENCDEC_H_ 2 | #define _GHP_ENCDEC_H_ 3 | 4 | #include "..\include.h" 5 | 6 | ////////////////////////////////////////////////////////////////////////////////////// 7 | //----------------------------User Functions------------------------------------------ 8 | extern int DecryptC3asClient(unsigned char*Dest,unsigned char*Src,int Len); 9 | extern int EncryptC3asClient(unsigned char*Dest,unsigned char*Src,int Len); 10 | extern int DecryptC3asServer(unsigned char*Dest,unsigned char*Src,int Len); 11 | extern int EncryptC3asServer(unsigned char*Dest,unsigned char*Src,int Len); 12 | extern int LoadKeys(unsigned const char * buf, unsigned long*Where); 13 | extern void DecXor32(unsigned char*Buff,int SizeOfHeader,int Len); 14 | extern void EncXor32(unsigned char*Buff,int SizeOfHeader,int Len); 15 | extern void EncDecLogin(unsigned char*Buff,int Len); 16 | //-----------------------------internal functions------------------------------------- 17 | extern int DecryptC3(unsigned char*Dest,unsigned char*Src,int Len,unsigned long*Keys); 18 | extern int EncryptC3(unsigned char*Dest,unsigned char*Src,int Len,unsigned long*Keys); 19 | extern int DecC3Bytes(unsigned char*Dest,unsigned char*Src,unsigned long*Keys); 20 | extern void EncC3Bytes(unsigned char*Dest,unsigned char*Src,int Len,unsigned long*Keys); 21 | extern int HashBuffer(unsigned char*Dest,int Param10,unsigned char*Src,int Param18,int Param1c); 22 | extern void ShiftBuffer(unsigned char*Buff,int Len,int ShiftLen); 23 | 24 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/ghp_FILE.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/ghp_UTILS/ghp_FILE.cpp -------------------------------------------------------------------------------- /ghp_UTILS/ghp_FILE.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_FILE_H_ 2 | #define _GHP_FILE_H_ 3 | 4 | #include "ghp_DEFS.h" 5 | 6 | namespace ghp_UTILS 7 | { 8 | extern bool LoadFileData(std::wstring FileName, DataChunk * chunk); 9 | extern bool WriteFileData(std::wstring FileName, DataChunk * chunk, UINT BytesToWrite = 0, bool Append = false); 10 | extern bool WriteFileDataChunkBlock(std::wstring FileName, DataChunk * data, bool Append = false); 11 | extern bool ReadDataChunkBlock(DataChunk * dataChunkIn, DataChunk * dataChunkOut); 12 | extern bool WriteFileStringBlock(std::wstring FileName, std::string data, bool Append = false); 13 | extern bool ReadStringBlock(DataChunk * memory, std::string * string); 14 | } 15 | 16 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/ghp_LIC.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/ghp_UTILS/ghp_LIC.cpp -------------------------------------------------------------------------------- /ghp_UTILS/ghp_LIC.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_LIC_H_ 2 | #define _GHP_LIC_H_ 3 | 4 | #include "..\include.h" 5 | #include "ghp_FILE.h" 6 | #include "..\ghp_CRYPTO\ghp_CRYPTO.h" 7 | 8 | namespace ghp_UTILS 9 | { 10 | class Lic 11 | { 12 | private: 13 | std::string name, ip, link, pubkey; 14 | DWORD apikey, time_1, time_2, ghpserver_raknet, ghpserver_web; 15 | DataChunk raknetpubkey, dllSignature; 16 | bool valid, m_loaded; 17 | public: 18 | Lic(); 19 | Lic(std::string Name, std::string IP, std::string Link, DWORD APIKey, DWORD Time_1, DWORD Time_2, DWORD GHPServer_Raknet, DWORD GHPServer_Web, std::string PubKey, UCHAR RakNetPubKey[64]); 20 | 21 | bool IsLoaded() 22 | { 23 | return m_loaded; 24 | } 25 | 26 | std::string GetNAME(); 27 | std::string GetIP(); 28 | std::string GetLINK(); 29 | std::string GetPUBKEY(); 30 | DWORD GetAPIKey(); 31 | DWORD GetTime1(); 32 | DWORD GetTime2(); 33 | DWORD GetGHPServerRaknet(); 34 | DWORD GetGHPServerWeb(); 35 | UCHAR * GetRakNetPUBKEY(); 36 | 37 | bool LoadFromFile(std::wstring FileName, UCHAR * key); 38 | bool SaveToFile(std::wstring FileName, std::string PrivateKey); 39 | }; 40 | } 41 | 42 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/ghp_LOG.cpp: -------------------------------------------------------------------------------- 1 | #include "ghp_LOG.h" 2 | 3 | namespace ghp_UTILS 4 | { 5 | Log::Log(std::wstring FileName, bool Append) 6 | { 7 | if (!Append) 8 | DeleteFileW(FileName.c_str()); 9 | 10 | filename = FileName; 11 | } 12 | 13 | void Log::LineOut(bool appendDateTime, char * data, ...) 14 | { 15 | DataChunk dateTime, logData, newLine; 16 | 17 | if (!dateTime.Init(1024) || !logData.Init(1024) || !newLine.Init(NEWLINE, 2)) 18 | { 19 | dateTime.FreeAll(); 20 | logData.FreeAll(); 21 | newLine.FreeAll(); 22 | return; 23 | } 24 | 25 | // Interpreta os argumentos 26 | va_list args; 27 | va_start(args, data); 28 | int len = vsprintf_s((char*)logData.data, logData.size, data, args); 29 | va_end(args); 30 | 31 | // Adiciona data e hora no log 32 | if (appendDateTime) 33 | { 34 | struct tm today; 35 | time_t ltime; 36 | time(<ime); 37 | localtime_s(&today, <ime); 38 | 39 | int dateTimeLen = sprintf_s((char*)dateTime.data, dateTime.size, "[%02d/%02d/%04d - %02d:%02d:%02d] ", today.tm_mday, today.tm_mon + 1, today.tm_year + 1900, today.tm_hour, today.tm_min, today.tm_sec); 40 | WriteFileData(filename.c_str(), &dateTime, dateTimeLen, true); 41 | } 42 | 43 | // Escreve log e nova linha no arquivo 44 | WriteFileData(filename.c_str(), &logData, len, true); 45 | WriteFileData(filename.c_str(), &newLine, 0, true); 46 | 47 | dateTime.FreeAll(); 48 | logData.FreeAll(); 49 | newLine.FreeAll(); 50 | } 51 | } -------------------------------------------------------------------------------- /ghp_UTILS/ghp_LOG.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_LOG_H_ 2 | #define _GHP_LOG_H_ 3 | 4 | #include "ghp_FILE.h" 5 | 6 | namespace ghp_UTILS 7 | { 8 | static char NEWLINE[] = { 0x0D, 0x0A }; 9 | 10 | class Log 11 | { 12 | private: 13 | std::wstring filename; 14 | public: 15 | Log(std::wstring FileName, bool Append = false); 16 | 17 | void LineOut(bool appendDateTime, char * data, ...); 18 | }; 19 | } 20 | 21 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/ghp_MEMORY_PROTECTION.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/ghp_UTILS/ghp_MEMORY_PROTECTION.cpp -------------------------------------------------------------------------------- /ghp_UTILS/ghp_MEMORY_PROTECTION.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_MEMORY_PROTECTION_H_ 2 | #define _GHP_MEMORY_PROTECTION_H_ 3 | 4 | #include "..\include.h" 5 | 6 | namespace ghp_UTILS 7 | { 8 | typedef struct tMemoryEntry 9 | { 10 | LPVOID addr; 11 | UINT size; 12 | std::vector memory; 13 | 14 | tMemoryEntry(LPVOID Addr, UINT Size, UCHAR * buffer) 15 | { 16 | addr = Addr; 17 | size = Size; 18 | memory.clear(); 19 | 20 | for (UINT i = 0; i < Size; i++) 21 | { 22 | memory.push_back(buffer[i]); 23 | } 24 | } 25 | } MemoryEntry; 26 | 27 | class MemoryProtection 28 | { 29 | private: 30 | std::vector entries; 31 | 32 | bool GetMemory(LPVOID Addr, UINT Size, UCHAR * outBuffer); 33 | public: 34 | MemoryProtection(); 35 | 36 | bool Add(LPVOID Addr, UINT Size); 37 | bool AddAPI(std::wstring DLL, std::string API, UINT Size); 38 | USHORT Check(); 39 | }; 40 | } 41 | 42 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/ghp_MU.cpp: -------------------------------------------------------------------------------- 1 | #include "ghp_MU.h" 2 | 3 | #include "ghp_ENCDEC.h" 4 | 5 | namespace ghp_UTILS 6 | { 7 | bool IsSerialPacket(UCHAR * Packet) 8 | { 9 | if (Packet[0] == 0xC3) 10 | { 11 | if (Packet[1] == 0x44 || Packet[1] == 0x65) 12 | return true; 13 | else 14 | return false; 15 | } 16 | else 17 | return false; 18 | } 19 | 20 | std::string SetSerialAndGetLogin(UCHAR * Packet, int len, std::string Serial) 21 | { 22 | VMProtectBeginUltra("SetSerialAndGetLogin"); 23 | char login[11]; 24 | memset(login, 0x00, sizeof(login)); 25 | 26 | int OriginalSize = (int)Packet[1]; 27 | int DecSize = (OriginalSize-2) * 8 / 11; 28 | int EncSize = (DecSize + 2) * 11 / 8; 29 | 30 | UCHAR * OrgBuffer = new UCHAR[OriginalSize]; 31 | UCHAR * DecBuffer = new UCHAR[DecSize]; 32 | UCHAR * EncBuffer = new UCHAR[EncSize]; 33 | 34 | // Copia a packet para o buffer 35 | memcpy_s(OrgBuffer, OriginalSize, Packet, OriginalSize); 36 | 37 | // Decrypta a packet 38 | DecryptC3asServer(DecBuffer, OrgBuffer + 2, OriginalSize - 2); 39 | DecXor32(DecBuffer + 1, 2, DecSize - 1); 40 | 41 | // Salva o login no buffer 42 | EncDecLogin(DecBuffer + 3, 10); // Descripta 43 | memcpy_s(login, 11, DecBuffer + 3, 10); 44 | EncDecLogin(DecBuffer + 3, 10); // Encripta 45 | 46 | // Seta o serial 47 | if (Packet[1] == 0x44) 48 | { 49 | memcpy_s(DecBuffer + 32, 17, Serial.c_str(), 16); 50 | } 51 | else if (Packet[1] == 0x65) 52 | { 53 | memcpy_s(DecBuffer + 52, 17, Serial.c_str(), 16); 54 | } 55 | 56 | // Encrypta a packet 57 | EncXor32(DecBuffer + 1, 2, DecSize - 1); 58 | EncryptC3asClient(EncBuffer + 2, DecBuffer, DecSize); 59 | 60 | // Fixa o header 61 | EncBuffer[0] = 0xC3; 62 | EncBuffer[1] = (UCHAR) EncSize; 63 | 64 | // Copia a packet para a memoria 65 | if (EncSize == len) 66 | memcpy_s(Packet, len, EncBuffer, EncSize); 67 | 68 | delete [] EncBuffer; 69 | delete [] DecBuffer; 70 | delete [] OrgBuffer; 71 | 72 | VMProtectEnd(); 73 | return login; 74 | } 75 | } -------------------------------------------------------------------------------- /ghp_UTILS/ghp_MU.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_MU_H_ 2 | #define _GHP_MU_H_ 3 | 4 | #include "..\include.h" 5 | 6 | namespace ghp_UTILS 7 | { 8 | extern bool IsSerialPacket(UCHAR * Packet); 9 | extern std::string SetSerialAndGetLogin(UCHAR * Packet, int len, std::string Serial); 10 | } 11 | 12 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/ghp_STRUCTURED_FILE.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/ghp_UTILS/ghp_STRUCTURED_FILE.cpp -------------------------------------------------------------------------------- /ghp_UTILS/ghp_STRUCTURED_FILE.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_STRUCTURED_FILE_H_ 2 | #define _GHP_STRUCTURED_FILE_H_ 3 | 4 | #include "..\include.h" 5 | #include "ghp_DEFS.h" 6 | 7 | namespace ghp_UTILS 8 | { 9 | class StructuredFile 10 | { 11 | private: 12 | UINT length, size; 13 | DataChunk data; 14 | public: 15 | UINT GetLength(); 16 | UINT GetSize(); 17 | 18 | bool Get(UINT index, UINT DstLen, LPVOID DstBuffer); 19 | bool Set(UINT ArrayLength, UINT ArraySize, LPVOID ArrayData); 20 | 21 | bool LoadFromMemory(DataChunk * memory, std::string PublicKey, UCHAR * key); 22 | 23 | bool LoadFromFile(std::wstring FileName, std::string PublicKey, UCHAR * key); 24 | bool SaveToFile(std::wstring FileName, std::string PrivateKey, UCHAR * key); 25 | }; 26 | } 27 | 28 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/ghp_SYSTEM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/ghp_UTILS/ghp_SYSTEM.cpp -------------------------------------------------------------------------------- /ghp_UTILS/ghp_SYSTEM.h: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_SYSTEM_H_ 2 | #define _GHP_SYSTEM_H_ 3 | 4 | #include "..\include.h" 5 | #include "..\ghp_CRYPTO\ghp_CRYPTO.h" 6 | #include "ghp_DEFS.h" 7 | 8 | namespace ghp_UTILS 9 | { 10 | extern bool PrivEnable(std::wstring PrivilegeName); 11 | extern bool HaveAdminPrivileges(); 12 | extern std::list GetHWIDs(); 13 | extern void GetAllFiles(std::vector &files, std::wstring directory); 14 | #ifdef R_WARZ 15 | extern std::vector GetScreenshot(int quality, int grayscale, LPDIRECT3DDEVICE9 dev); 16 | #else 17 | extern std::vector GetScreenshot(int quality, int grayscale); 18 | #endif 19 | } 20 | 21 | #endif -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/BeanLoader.cpp: -------------------------------------------------------------------------------- 1 | #include "hiberlite.h" 2 | 3 | namespace hiberlite{ 4 | 5 | BeanLoader::BeanLoader() : AVisitor(&actor, LOADING) 6 | {} 7 | 8 | } //namespace hiberlite 9 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/BeanLoader.h: -------------------------------------------------------------------------------- 1 | #ifndef BeanLoader_H 2 | #define BeanLoader_H 3 | 4 | namespace hiberlite{ 5 | 6 | class LoadBean { 7 | public: 8 | template 9 | inline void notifyInitWalk(AV& av); 10 | 11 | template 12 | inline void notifyDoneWalk(AV& av); 13 | 14 | template 15 | inline void act(AV& av, db_atom atom){ 16 | int col_indx=locateCol(av.getScope().prefix()); 17 | atom.loadValue(stmt.top().first, col_indx); 18 | } 19 | 20 | template 21 | inline void act(AV& av, collection_nvp nvp ); 22 | 23 | protected: 24 | std::stack< std::pair > stmt; 25 | 26 | inline int locateCol(std::string name){ 27 | SQLiteSelect& sel=stmt.top().first; 28 | unsigned int n=sel.column_count(); 29 | for(unsigned int i=0;i 37 | { 38 | public: 39 | BeanLoader(); 40 | 41 | template 42 | C* loadBean(bean_key k); 43 | 44 | protected: 45 | LoadBean actor; 46 | 47 | private: 48 | }; 49 | 50 | } //namespace hiberlite 51 | 52 | #endif // BeanLoader_H 53 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/BeanLoader_impl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BeanLoader_IMPL_HPP_INCLUDED 2 | #define BeanLoader_IMPL_HPP_INCLUDED 3 | 4 | namespace hiberlite{ 5 | 6 | template 7 | void LoadBean::notifyInitWalk(AV& av) 8 | { 9 | while(!stmt.empty()) 10 | stmt.pop(); 11 | 12 | sqlid_t curId=av.getRootId(); 13 | 14 | std::string query="SELECT * FROM "+av.getScope().table() 15 | +" WHERE "+HIBERLITE_PRIMARY_KEY_COLUMN+"="+Transformer::toSQLiteValue(curId)+";"; 16 | 17 | SQLiteSelect sel(av.getConnection(), query); 18 | if(!sel.step()) 19 | throw database_error("id not found in the database"); 20 | stmt.push( std::make_pair(sel,curId) ); 21 | } 22 | 23 | template 24 | void LoadBean::notifyDoneWalk(AV& av) 25 | { 26 | while(!stmt.empty()) 27 | stmt.pop(); 28 | } 29 | 30 | template 31 | void LoadBean::act(AV& av, collection_nvp nvp ) 32 | { 33 | av.diveTable(nvp.name); 34 | std::string tab=av.getScope().table(); 35 | std::vector children=Database::dbSelectChildIds(av.getConnection(), tab, stmt.top().second); 36 | nvp.stream.startLoadFromDb(); 37 | 38 | for(size_t i=0;i(0)); 41 | 42 | std::string query="SELECT * FROM "+tab 43 | +" WHERE "+HIBERLITE_PRIMARY_KEY_COLUMN+"="+Transformer::toSQLiteValue(children[i])+";"; 44 | SQLiteSelect sel(av.getConnection(), query); 45 | if(!sel.step()) 46 | throw database_error("id not found in the database"); 47 | stmt.push( std::make_pair(sel,children[i]) ); 48 | 49 | sql_nvp el("item", *entry); 50 | av & el; 51 | 52 | stmt.pop(); 53 | nvp.stream.putNext(*entry); 54 | destroy(*this, entry, static_cast(0)); 55 | } 56 | av.pop(); 57 | } 58 | 59 | template 60 | C* BeanLoader::loadBean(bean_key key) 61 | { 62 | C* bean; 63 | construct(*this, &bean, static_cast(0)); 64 | startWalk(*bean, key); 65 | return bean; 66 | } 67 | 68 | } //namespace hiberlite 69 | 70 | #endif // BEANUPDATER_IMPL_HPP_INCLUDED 71 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/BeanUpdater_impl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BEANUPDATER_IMPL_HPP_INCLUDED 2 | #define BEANUPDATER_IMPL_HPP_INCLUDED 3 | 4 | namespace hiberlite{ 5 | 6 | template 7 | inline void RowScope::addAssignment(const std::string name, db_atom& atom){ 8 | int id=FirstAtom+static_cast(atoms.size()); 9 | 10 | addSimpleAssign(name, "?"+Transformer::toSQLiteValue(id) ); 11 | 12 | db_atom* x=new db_atom(atom); 13 | atoms.push_back(x); 14 | } 15 | 16 | template 17 | void UpdateBean::notifyInitWalk(AV& av) 18 | { 19 | startRow(av.getScope().table(), av.getRootId(), Database::NULL_ID,0); 20 | } 21 | 22 | template 23 | void UpdateBean::notifyDoneWalk(AV& av) 24 | { 25 | commitRow(av.getConnection(), av.getRootId()); 26 | } 27 | 28 | template 29 | void UpdateBean::act(AV& av, collection_nvp nvp ){ 30 | 31 | sqlid_t index=0; 32 | S& stream=nvp.stream; 33 | 34 | av.diveTable(nvp.name); 35 | std::string tab=av.getScope().table(); 36 | while(!stream.done()){ 37 | E& el=stream.getNext(); 38 | sqlid_t entry_id=Database::allocId(av.getConnection(), tab); 39 | 40 | startRow(tab,entry_id, curRow()->id,index); 41 | sql_nvp el_nvp("item",el); 42 | av & el_nvp; 43 | commitRow(av.getConnection(), entry_id); 44 | index++; 45 | } 46 | av.pop(); 47 | } 48 | 49 | template 50 | void BeanUpdater::update(bean_key key, C& bean) 51 | { 52 | startWalk( bean, key ); 53 | } 54 | 55 | } //namespace hiberlite 56 | 57 | #endif // BEANUPDATER_IMPL_HPP_INCLUDED 58 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/ChildKiller.cpp: -------------------------------------------------------------------------------- 1 | #include "hiberlite.h" 2 | 3 | namespace hiberlite{ 4 | 5 | ChildKiller::ChildKiller() : AVisitor(&actor, DELETING) 6 | {} 7 | 8 | } //namespace hiberlite 9 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/ChildKiller.h: -------------------------------------------------------------------------------- 1 | #ifndef CHILDKILLER_H 2 | #define CHILDKILLER_H 3 | 4 | namespace hiberlite{ 5 | 6 | class KillChildren{ 7 | public: 8 | template 9 | inline void notifyInitWalk(AV& av); 10 | 11 | template 12 | inline void notifyDoneWalk(AV& av); 13 | 14 | template 15 | inline void act(AV& av, db_atom nvp ){} 16 | 17 | template 18 | inline void act(AV& av, collection_nvp nvp ); 19 | 20 | protected: 21 | std::stack rowId; 22 | }; 23 | 24 | class ChildKiller : AVisitor 25 | { 26 | public: 27 | ChildKiller(); 28 | 29 | template 30 | void killChildren(bean_key k, C& bean); 31 | 32 | protected: 33 | KillChildren actor; 34 | 35 | private: 36 | }; 37 | 38 | } //namespace hiberlite 39 | 40 | #endif // CHILDKILLER_H 41 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/ChildKiller_impl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CHILDKILLER_IMPL_HPP_INCLUDED 2 | #define CHILDKILLER_IMPL_HPP_INCLUDED 3 | 4 | namespace hiberlite{ 5 | 6 | template 7 | void KillChildren::notifyInitWalk(AV& av) 8 | { 9 | rowId=std::stack(); 10 | rowId.push(av.getRootId()); 11 | } 12 | 13 | template 14 | void KillChildren::notifyDoneWalk(AV& av) 15 | { 16 | } 17 | 18 | template 19 | void KillChildren::act(AV& av, collection_nvp nvp ) 20 | { 21 | av.diveTable(nvp.name); 22 | std::string tab=av.getScope().table(); 23 | std::vector children=Database::dbSelectChildIds(av.getConnection(), tab, rowId.top()); 24 | for(size_t i=0;i(0)); 27 | rowId.push(children[i]); 28 | sql_nvp el("item",*entry); 29 | av & el; 30 | rowId.pop(); 31 | destroy(*this, entry, static_cast(0)); 32 | } 33 | av.pop(); 34 | 35 | Database::dbDeleteRows(av.getConnection(),tab,HIBERLITE_PARENTID_COLUMN,rowId.top()); 36 | } 37 | 38 | template 39 | void ChildKiller::killChildren(bean_key key, C& bean) 40 | { 41 | startWalk(bean, key); 42 | } 43 | 44 | } //namespace hiberlite 45 | 46 | 47 | #endif // BEANUPDATER_IMPL_HPP_INCLUDED 48 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/CppModel.cpp: -------------------------------------------------------------------------------- 1 | #include "hiberlite.h" 2 | 3 | namespace hiberlite{ 4 | 5 | void Model::add(Table t) 6 | { 7 | if( find(t.name)!=end() ) 8 | throw std::logic_error("table ["+t.name+"] already exists"); 9 | HIBERLITE_HL_DBG_DO( std::cout << "model add table " << t.name << std::endl; ) 10 | insert( std::pair(t.name,t) ); 11 | } 12 | 13 | Table::Table() 14 | { 15 | add(Column(HIBERLITE_PRIMARY_KEY_COLUMN,HIBERLITE_PRIMARY_KEY_STORAGE_TYPE)); 16 | } 17 | 18 | void Table::add(Column c) 19 | { 20 | HIBERLITE_HL_DBG_DO( std::cout << "table " << name << " add column " << c.name << " : " << c.storage_type << std::endl; ) 21 | columns[c.name]=c; 22 | } 23 | 24 | bool Table::contains(std::string colname) 25 | { 26 | return columns.find(colname)!=columns.end(); 27 | } 28 | 29 | std::string Scope::name_column(std::string name) 30 | { 31 | if(prefix().size()) 32 | return prefix()+"_"+name; 33 | else 34 | return name; 35 | } 36 | 37 | std::string Scope::full() 38 | { 39 | if(prefix().size()) 40 | return table()+"_"+prefix(); 41 | else 42 | return table(); 43 | } 44 | 45 | } //namespace hiberlite 46 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/CppModel.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPMODEL_H 2 | #define CPPMODEL_H 3 | 4 | namespace hiberlite{ 5 | 6 | class Scope{ 7 | public: 8 | std::string _table, _prefix; 9 | int prefix_depth; 10 | 11 | inline Scope(std::string t, std::string p): _table(t) 12 | , _prefix(p) 13 | ,prefix_depth(0) 14 | {} 15 | inline Scope() : prefix_depth(0) {} 16 | 17 | inline std::string table() { return _table; } 18 | inline std::string prefix() { return _prefix; } 19 | 20 | std::string name_column(std::string name); 21 | std::string full(); 22 | }; 23 | 24 | class Column{ 25 | public: 26 | inline Column(std::string _n="", std::string _s="") : name(_n), storage_type(_s) {} 27 | std::string name; 28 | std::string storage_type; 29 | }; 30 | 31 | class Table{ 32 | public: 33 | Table(); 34 | std::string name; 35 | std::map columns; 36 | void add(Column c); 37 | bool contains(std::string colname); 38 | }; 39 | 40 | class Model : public std::map { 41 | public: 42 | void add(Table t); 43 | }; 44 | 45 | }//namespace hiberlite 46 | 47 | #endif // CPPMODEL_H 48 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/ModelExtractor.cpp: -------------------------------------------------------------------------------- 1 | #include "hiberlite.h" 2 | 3 | namespace hiberlite{ 4 | 5 | ModelExtractor::ModelExtractor() : AVisitor(&actor, MODEL) 6 | {} 7 | 8 | Model ExtractModel::getModel() { 9 | return model; 10 | } 11 | 12 | Model ModelExtractor::getModel() { 13 | return actor.getModel(); 14 | } 15 | 16 | } //namespace hiberlite 17 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/ModelExtractor.h: -------------------------------------------------------------------------------- 1 | #ifndef MODELEXTRACTOR_H 2 | #define MODELEXTRACTOR_H 3 | 4 | namespace hiberlite{ 5 | 6 | class ExtractModel{ 7 | public: 8 | Model getModel(); 9 | 10 | template 11 | inline void notifyInitWalk(AV& av){ 12 | model[av.getScope().table()].name=av.getScope().table(); 13 | } 14 | 15 | template 16 | inline void notifyDoneWalk(AV& av){} 17 | 18 | template 19 | inline void act(AV& av, db_atom atom) { 20 | putColumn(av, atom.sqliteStorageClass()); 21 | } 22 | 23 | template 24 | inline void act(AV& av, collection_nvp nvp ); 25 | 26 | protected: 27 | template 28 | inline void putColumn(AV& av, std::string storage) 29 | { 30 | Scope scope=av.getScope(); 31 | putNamedColumn(scope.table(), scope.prefix(), storage); 32 | } 33 | 34 | inline void putNamedColumn(std::string table, std::string colname, std::string storClass){ 35 | model[ table ].name=table; 36 | if( model[table].contains( colname ) ) 37 | throw std::logic_error(colname+": column name is in use"); 38 | model[ table ].add( Column(colname,storClass) ); 39 | } 40 | 41 | Model model; 42 | }; 43 | 44 | class ModelExtractor : AVisitor{ 45 | public: 46 | ModelExtractor(); 47 | template 48 | void extractModel(shared_connection _con); 49 | Model getModel(); 50 | 51 | protected: 52 | ExtractModel actor; 53 | }; 54 | 55 | } //namespace hiberlite 56 | 57 | #endif // MODELEXTRACTOR_H 58 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/ModelExtractor_impl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MODELEXTRACTOR_IMPL_HPP_INCLUDED 2 | #define MODELEXTRACTOR_IMPL_HPP_INCLUDED 3 | 4 | namespace hiberlite{ 5 | 6 | template 7 | void ExtractModel::act(AV& av, collection_nvp nvp ) 8 | { 9 | E* entry; 10 | construct(av, &entry, static_cast(0)); 11 | av.diveTable(nvp.name); 12 | 13 | putNamedColumn(av.getScope().table(), HIBERLITE_PARENTID_COLUMN, HIBERLITE_ID_STORAGE_CLASS); 14 | putNamedColumn(av.getScope().table(), HIBERLITE_ENTRY_INDEX_COLUMN, HIBERLITE_ID_STORAGE_CLASS); 15 | 16 | sql_nvp el("item",*entry); 17 | av & el; 18 | av.pop(); 19 | destroy(*this, entry, static_cast(0)); 20 | } 21 | 22 | template 23 | void ModelExtractor::extractModel(shared_connection _con) 24 | { 25 | C* bean; 26 | construct(*this, &bean, static_cast(0)); 27 | bean_key key(_con, Database::NULL_ID); 28 | startWalk(*bean, key); 29 | destroy(*this, bean, static_cast(0)); 30 | } 31 | 32 | } //namespace hiberlite 33 | 34 | #endif // MODELEXTRACTOR_IMPL_HPP_INCLUDED 35 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/Registry.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "hiberlite.h" 3 | 4 | namespace hiberlite{ 5 | 6 | //template 7 | //std::map< bean_key, bean_ptr > Registry::beans=std::map< bean_key, bean_ptr >(); 8 | 9 | } //namespace hiberlite 10 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/Registry.h: -------------------------------------------------------------------------------- 1 | #ifndef REGISTRY_H_INCLUDED 2 | #define REGISTRY_H_INCLUDED 3 | 4 | namespace hiberlite{ 5 | 6 | class Database; 7 | 8 | template class bean_ptr; 9 | template class Registry; 10 | template class real_bean; 11 | 12 | template 13 | class rb_pair : public shared_cnt_obj_pair< real_bean > { 14 | protected: 15 | friend class Registry; 16 | 17 | inline rb_pair(real_bean* rbean); 18 | 19 | public: 20 | inline bean_key get_key(); 21 | inline virtual ~rb_pair(); 22 | }; 23 | 24 | 25 | template 26 | class Registry{ 27 | protected: 28 | friend class rb_pair; 29 | 30 | static std::map* > rbpairs; 31 | 32 | static void notifyRBDies(rb_pair* r); 33 | 34 | public: 35 | static bean_ptr get(const bean_key key); 36 | static bool has(const bean_key key); 37 | 38 | static bean_ptr createBeanPtr(bean_key key, C* obj); 39 | }; 40 | 41 | template 42 | std::map< bean_key, rb_pair* > Registry::rbpairs; 43 | 44 | } //namespace hiberlite 45 | 46 | #endif // REGISTRY_H_INCLUDED 47 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/Registry_impl.hpp: -------------------------------------------------------------------------------- 1 | namespace hiberlite{ 2 | 3 | template 4 | rb_pair::~rb_pair() 5 | { 6 | Registry::notifyRBDies(this); 7 | } 8 | 9 | template 10 | rb_pair::rb_pair(real_bean* rbean) : shared_cnt_obj_pair< real_bean >(rbean) 11 | { 12 | } 13 | 14 | template 15 | bean_key rb_pair::get_key() 16 | { 17 | return shared_cnt_obj_pair< real_bean >::res->get_key(); 18 | } 19 | 20 | template 21 | bean_ptr Registry::createBeanPtr(bean_key key, C* obj) 22 | { 23 | if(key.id==Database::NULL_ID) 24 | return bean_ptr(key,NULL); 25 | 26 | real_bean* rb=new real_bean(key,obj); 27 | rb_pair* para=new rb_pair(rb); 28 | 29 | if( rbpairs.find(key)!=rbpairs.end() ) 30 | throw std::logic_error("bean already exists"); 31 | 32 | rbpairs[key]=para; 33 | 34 | bean_ptr ans(key, para); 35 | return ans; 36 | } 37 | 38 | template 39 | bean_ptr Registry::get(const bean_key key) 40 | { 41 | typename std::map* >::iterator it; 42 | it=rbpairs.find(key); 43 | if(it==rbpairs.end()) 44 | return createBeanPtr(key,NULL); 45 | else 46 | return bean_ptr(key, it->second); 47 | } 48 | 49 | template 50 | bool Registry::has(const bean_key key) 51 | { 52 | return rbpairs.find(key)!=rbpairs.end(); 53 | } 54 | 55 | template 56 | void Registry::notifyRBDies(rb_pair* r){ 57 | rbpairs.erase(r->get_key()); 58 | } 59 | 60 | } // namespace hiberlite 61 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/SQLiteStmt.h: -------------------------------------------------------------------------------- 1 | #ifndef SQLITESTMT_H 2 | #define SQLITESTMT_H 3 | 4 | namespace hiberlite{ 5 | 6 | class statement_ptr{ 7 | public: 8 | inline statement_ptr(sqlite3_stmt* st) : obj(st) {} 9 | inline ~statement_ptr() { sqlite3_finalize(obj); } 10 | 11 | sqlite3_stmt* get_stmt() { return obj; } 12 | private: 13 | sqlite3_stmt* obj; 14 | 15 | inline statement_ptr(const statement_ptr& st); 16 | inline statement_ptr& operator=(const statement_ptr& st); 17 | }; 18 | 19 | typedef shared_res shared_stmt; 20 | 21 | class SQLiteSelect 22 | { 23 | public: 24 | SQLiteSelect(shared_connection con, std::string query); 25 | 26 | bool step(); 27 | 28 | virtual ~SQLiteSelect(); 29 | 30 | const void* get_blob(int iCol); 31 | int get_bytes(int iCol); 32 | double get_double(int iCol); 33 | int get_int(int iCol); 34 | sqlid_t get_int64(int iCol); 35 | const unsigned char *get_text(int iCol); 36 | int get_type(int iCol); 37 | int column_count(); 38 | std::string get_name(int N); 39 | 40 | protected: 41 | bool active; 42 | shared_stmt statement; 43 | shared_connection con; 44 | private: 45 | }; 46 | 47 | } //namespace hiberlite 48 | 49 | #endif // SQLITESTMT_H 50 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/UpdateVisitor_tmpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INSERVISITOR_TMPL_HPP_INCLUDED 2 | #define INSERVISITOR_TMPL_HPP_INCLUDED 3 | 4 | namespace hiberlite{ 5 | 6 | } //namespace hiberlite 7 | 8 | 9 | #endif // INSERVISITOR_TMPL_HPP_INCLUDED 10 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/Visitor.cpp: -------------------------------------------------------------------------------- 1 | #include "hiberlite.h" 2 | 3 | namespace hiberlite { 4 | 5 | } //namespace hiberlite 6 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/bean_ptr.h: -------------------------------------------------------------------------------- 1 | #ifndef BEAN_PTR_H_INCLUDED 2 | #define BEAN_PTR_H_INCLUDED 3 | 4 | namespace hiberlite{ 5 | 6 | class Database; 7 | class access; 8 | 9 | template 10 | class Registry; 11 | 12 | template 13 | class shared_res; 14 | 15 | template 16 | class real_bean : noncopyable { 17 | public: 18 | inline C* operator->(); 19 | inline C* get(); 20 | 21 | ~real_bean(); 22 | 23 | bean_key get_key() const { return key; } 24 | 25 | void save(); 26 | 27 | void destroy(); 28 | bool destroyed() const { return forgotten; } 29 | 30 | protected: 31 | inline void loadLazy(); 32 | 33 | bean_key key; 34 | C* obj; 35 | bool forgotten; 36 | 37 | private: 38 | friend class Registry; 39 | real_bean(const bean_key _key, C* _obj); //only Registry can create the real_bean 40 | }; 41 | 42 | template 43 | class bean_ptr : public shared_res< real_bean > 44 | { 45 | friend class hiberlite::access; 46 | template 47 | void hibernate(Archive & ar); 48 | 49 | friend class Registry; 50 | bean_ptr(bean_key k, rb_pair* rbpair); 51 | 52 | sqlid_t tmp_id; 53 | 54 | public: 55 | bean_ptr(bean_key k); 56 | 57 | bean_ptr(); 58 | 59 | operator bool() const; 60 | 61 | bean_ptr(const bean_ptr& other); 62 | bean_ptr& operator=(const bean_ptr& other); 63 | 64 | void save(); 65 | void destroy(); 66 | 67 | bool destroyed() { 68 | return shared_res< real_bean >::get_object()->destroyed(); 69 | } 70 | 71 | inline sqlid_t get_id(); 72 | inline C& operator*(); 73 | inline C* operator->(); 74 | }; 75 | 76 | }//namespace hiberlite 77 | 78 | #endif // BEAN_PTR_H_INCLUDED 79 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/common.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_H_ 2 | #define COMMON_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include "sqlite3.h" 13 | 14 | namespace hiberlite{ 15 | 16 | class noncopyable 17 | { 18 | protected: 19 | noncopyable() {} 20 | ~noncopyable() {} 21 | private: 22 | noncopyable( const noncopyable& ); 23 | const noncopyable operator=( const noncopyable& ); 24 | 25 | }; 26 | 27 | typedef sqlite_int64 sqlid_t; 28 | 29 | } //namespace hiberlite 30 | 31 | #define HIBERLITE_HL_DBG_DO(x) ; 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/db_error.h: -------------------------------------------------------------------------------- 1 | #ifndef DB_ERROR_H_INCLUDED 2 | #define DB_ERROR_H_INCLUDED 3 | 4 | namespace hiberlite{ 5 | 6 | class database_error : public std::runtime_error{ 7 | public: 8 | inline database_error(const char* msg) : std::runtime_error(msg) {} 9 | inline database_error(std::string msg) : std::runtime_error(msg) {} 10 | inline static void database_assert(int result, shared_connection con){ 11 | if(result==SQLITE_OK) 12 | return; 13 | throw database_error( sqlite3_errmsg(con->getSQLite3Ptr()) ); 14 | } 15 | }; 16 | 17 | } //namespace hiberlite 18 | 19 | #endif // DB_ERROR_H_INCLUDED 20 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/hiberdefs.h: -------------------------------------------------------------------------------- 1 | #ifndef HIBERDEFS_H_INCLUDED 2 | #define HIBERDEFS_H_INCLUDED 3 | 4 | #if (defined _MSC_VER && _MSC_VER< 1600) 5 | //#include 6 | #define HIBERLITE_NVP(Field) hiberlite::sql_nvp< BOOST_TYPEOF(Field) >(#Field,Field) 7 | #else 8 | #define HIBERLITE_NVP(Field) hiberlite::sql_nvp< decltype(Field) >(#Field,Field) 9 | #endif 10 | #define HIBERLITE_BASE_CLASS(ClName) hiberlite::sql_nvp< ClName >(#ClName,*((ClName*)this) ) 11 | 12 | #define HIBERLITE_EXPORT_CLASS(ClName) \ 13 | namespace hiberlite{ \ 14 | template<> \ 15 | std::string Database::getClassName() \ 16 | { return #ClName; }} 17 | 18 | //#define HIBERLITE_COLLECTION(Field) hiberlite::collection_nvp(#Field, Field, Field.begin(), Field.end()) 19 | //#define HIBERLITE_ARRAY(Field,N) hiberlite::collection_nvp(#Field, *Field, *(Field+N)) 20 | 21 | #define HIBERLITE_PRIMARY_KEY_COLUMN "hiberlite_id" 22 | #define HIBERLITE_PARENTID_COLUMN "hiberlite_parent_id" 23 | #define HIBERLITE_ENTRY_INDEX_COLUMN "hiberlite_entry_indx" 24 | #define HIBERLITE_ID_STORAGE_CLASS "INTEGER" 25 | 26 | #define HIBERLITE_PRIMARY_KEY_STORAGE_TYPE "PRIMARYKEY" 27 | 28 | #endif // HIBERDEFS_H_INCLUDED 29 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/hiberlite.h: -------------------------------------------------------------------------------- 1 | #ifndef _HIBERLITE_H_ 2 | #define _HIBERLITE_H_ 3 | 4 | #include "sqlite3.h" 5 | 6 | #include "common.h" 7 | #include "shared_res.h" 8 | #include "hiberdefs.h" 9 | #include "nvp.h" 10 | 11 | #include "db_error.h" 12 | 13 | #include "SQLiteStmt.h" 14 | 15 | #include "CppModel.h" 16 | 17 | #include "Registry.h" 18 | #include "bean_ptr.h" 19 | 20 | #include "Visitor.h" 21 | #include "ModelExtractor.h" 22 | #include "BeanUpdater.h" 23 | #include "ChildKiller.h" 24 | #include "BeanLoader.h" 25 | 26 | #include "Database.h" 27 | 28 | 29 | #include "Registry_impl.hpp" 30 | #include "bean_ptr_impl.hpp" 31 | #include "Database_tmpl_impl.hpp" 32 | 33 | #include "Visitor_tmpl_impl.hpp" 34 | #include "ModelExtractor_impl.hpp" 35 | #include "BeanUpdater_impl.hpp" 36 | #include "ChildKiller_impl.hpp" 37 | #include "BeanLoader_impl.hpp" 38 | 39 | #include "some_types.h" 40 | 41 | #endif //_HIBERLITE_H_ 42 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/nvp.h: -------------------------------------------------------------------------------- 1 | #ifndef _NVP_H_ 2 | #define _NVP_H_ 3 | 4 | #include "common.h" 5 | 6 | namespace hiberlite{ 7 | 8 | template 9 | class sql_nvp{ 10 | public: 11 | std::string name; 12 | C& value; 13 | std::string search_key; 14 | 15 | sql_nvp(std::string _name, C& _value, std::string search="") : name(_name), value(_value), search_key(search) {} 16 | }; 17 | 18 | template 19 | class collection_nvp{ 20 | public: 21 | std::string name; 22 | Stream stream; 23 | collection_nvp(std::string _name, Stream _s) : name(_name), stream(_s) {} 24 | }; 25 | 26 | class abstract_atom{ 27 | public: 28 | virtual void bindValue(sqlite3_stmt* stmt, int col)=0; 29 | inline virtual ~abstract_atom() {} 30 | }; 31 | 32 | template 33 | class db_atom : public abstract_atom{ 34 | public: 35 | C& val; 36 | db_atom(C& x) : val(x) {} 37 | inline virtual ~db_atom() {} 38 | 39 | inline std::string sqliteStorageClass(); 40 | 41 | template 42 | void loadValue(Stmt& res, Arg& arg); 43 | 44 | inline virtual void bindValue(sqlite3_stmt* stmt, int col); 45 | }; 46 | 47 | } //namespace hiberlite 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /ghp_UTILS/hiberlite/shared_res.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "hiberlite.h" 3 | 4 | namespace hiberlite{ 5 | 6 | bean_key::bean_key() 7 | { 8 | id=Database::NULL_ID; 9 | } 10 | 11 | } //namespace hiberlite 12 | -------------------------------------------------------------------------------- /ghp_WZAPI.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _GHP_WZAPI_HPP_ 2 | #define _GHP_WZAPI_HPP_ 3 | 4 | #include 5 | 6 | #ifdef WO_SERVER 7 | #include "CkHttp.h" 8 | #include "CkHttpResponse.h" 9 | #include "CkHttpRequest.h" 10 | #endif 11 | 12 | typedef VOID (* GHPSetParam) (DWORD APIKey, UINT id, UCHAR * buffer, UINT size); 13 | typedef VOID (* GHPGetParam) (DWORD APIKey, UINT id, UCHAR * buffer, UINT size); 14 | 15 | inline bool GHP_Load() 16 | { 17 | if (LoadLibraryA("GHP.dll") != NULL) 18 | return true; 19 | else 20 | return false; 21 | } 22 | 23 | inline bool GHP_SetCustomerID(DWORD APIKey, DWORD Time1, DWORD Time2, DWORD CustomerID) 24 | { 25 | HMODULE hGHP = GetModuleHandleA("GHP.dll"); 26 | if(hGHP != NULL) 27 | { 28 | GHPSetParam SetParam = (GHPSetParam)GetProcAddress(hGHP, "GHPSetParam"); 29 | GHPGetParam GetParam = (GHPGetParam)GetProcAddress(hGHP, "GHPGetParam"); 30 | 31 | if (SetParam != NULL && GetParam != NULL) 32 | { 33 | DWORD MyTime, GHPTime, diffTime; 34 | 35 | MyTime = timeGetTime(); 36 | GetParam(APIKey, 0, (UCHAR*)&GHPTime, sizeof(GHPTime)); 37 | 38 | GHPTime ^= Time1; 39 | GHPTime -= Time2; 40 | 41 | diffTime = GHPTime - MyTime; 42 | 43 | if (diffTime > 2000) 44 | return false; 45 | 46 | char buff[32]; 47 | memset(buff, 0, 32); 48 | _itoa_s((int)CustomerID, buff, 10); 49 | SetParam(APIKey, 0, (UCHAR*)buff, 32); 50 | return true; 51 | } 52 | else 53 | return false; 54 | } 55 | else 56 | return false; 57 | } 58 | 59 | #ifdef WO_SERVER 60 | inline bool GHP_CheckPlayer(DWORD CustomerID, const char * SRV_IP, long SRV_PORT, const char * C_REF) 61 | { 62 | char buff[32]; 63 | sprintf_s(buff, 32, "%d", CustomerID); 64 | 65 | CkHttp http; 66 | CkHttpResponse * resp = NULL; 67 | CkHttpRequest req; 68 | req.AddParam("pl_status", buff); 69 | req.AddParam("key", C_REF); 70 | 71 | resp = http.SynchronousRequest(SRV_IP, SRV_PORT, false, req); 72 | 73 | if (strcmp(resp->bodyStr(), "1") != 0) 74 | return false; 75 | else 76 | return true; 77 | } 78 | #endif 79 | 80 | #endif -------------------------------------------------------------------------------- /www/css/fontello-codes.css: -------------------------------------------------------------------------------- 1 | 2 | .icon-search:before { content: '\e800'; } /* '' */ 3 | .icon-user:before { content: '\e801'; } /* '' */ 4 | .icon-cog:before { content: '\e802'; } /* '' */ 5 | .icon-logout:before { content: '\e803'; } /* '' */ 6 | .icon-ok-circle:before { content: '\e804'; } /* '' */ 7 | .icon-cancel-circle:before { content: '\e805'; } /* '' */ 8 | .icon-block:before { content: '\e806'; } /* '' */ -------------------------------------------------------------------------------- /www/css/fontello-ie7-codes.css: -------------------------------------------------------------------------------- 1 | 2 | .icon-search { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 3 | .icon-user { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 4 | .icon-cog { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 5 | .icon-logout { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 6 | .icon-ok-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 7 | .icon-cancel-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 8 | .icon-block { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } -------------------------------------------------------------------------------- /www/css/fontello-ie7.css: -------------------------------------------------------------------------------- 1 | [class^="icon-"], [class*=" icon-"] { 2 | font-family: 'fontello'; 3 | font-style: normal; 4 | font-weight: normal; 5 | 6 | /* fix buttons height */ 7 | line-height: 1em; 8 | 9 | /* you can be more comfortable with increased icons size */ 10 | /* font-size: 120%; */ 11 | } 12 | 13 | .icon-search { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 14 | .icon-user { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 15 | .icon-cog { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 16 | .icon-logout { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 17 | .icon-ok-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 18 | .icon-cancel-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } 19 | .icon-block { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } -------------------------------------------------------------------------------- /www/css/fontello.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'fontello'; 3 | src: url('../font/fontello.eot?72953684'); 4 | src: url('../font/fontello.eot?72953684#iefix') format('embedded-opentype'), 5 | url('../font/fontello.woff?72953684') format('woff'), 6 | url('../font/fontello.ttf?72953684') format('truetype'), 7 | url('../font/fontello.svg?72953684#fontello') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */ 12 | /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */ 13 | /* 14 | @media screen and (-webkit-min-device-pixel-ratio:0) { 15 | @font-face { 16 | font-family: 'fontello'; 17 | src: url('../font/fontello.svg?72953684#fontello') format('svg'); 18 | } 19 | } 20 | */ 21 | 22 | [class^="icon-"]:before, [class*=" icon-"]:before { 23 | font-family: "fontello"; 24 | font-style: normal; 25 | font-weight: normal; 26 | speak: none; 27 | 28 | display: inline-block; 29 | text-decoration: inherit; 30 | width: 1em; 31 | margin-right: .2em; 32 | text-align: center; 33 | /* opacity: .8; */ 34 | 35 | /* For safety - reset parent styles, that can break glyph codes*/ 36 | font-variant: normal; 37 | text-transform: none; 38 | 39 | /* fix buttons height, for twitter bootstrap */ 40 | line-height: 1em; 41 | 42 | /* Animation center compensation - margins should be symmetric */ 43 | /* remove if not needed */ 44 | margin-left: .2em; 45 | 46 | /* you can be more comfortable with increased icons size */ 47 | /* font-size: 120%; */ 48 | 49 | /* Uncomment for 3D effect */ 50 | /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ 51 | } 52 | 53 | .icon-search:before { content: '\e800'; } /* '' */ 54 | .icon-user:before { content: '\e801'; } /* '' */ 55 | .icon-cog:before { content: '\e802'; } /* '' */ 56 | .icon-logout:before { content: '\e803'; } /* '' */ 57 | .icon-ok-circle:before { content: '\e804'; } /* '' */ 58 | .icon-cancel-circle:before { content: '\e805'; } /* '' */ 59 | .icon-block:before { content: '\e806'; } /* '' */ -------------------------------------------------------------------------------- /www/font/OpenSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-Bold.ttf -------------------------------------------------------------------------------- /www/font/OpenSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-BoldItalic.ttf -------------------------------------------------------------------------------- /www/font/OpenSans-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-ExtraBold.ttf -------------------------------------------------------------------------------- /www/font/OpenSans-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /www/font/OpenSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-Italic.ttf -------------------------------------------------------------------------------- /www/font/OpenSans-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-Light.ttf -------------------------------------------------------------------------------- /www/font/OpenSans-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-LightItalic.ttf -------------------------------------------------------------------------------- /www/font/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /www/font/OpenSans-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-Semibold.ttf -------------------------------------------------------------------------------- /www/font/OpenSans-SemiboldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/OpenSans-SemiboldItalic.ttf -------------------------------------------------------------------------------- /www/font/fontello.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/fontello.eot -------------------------------------------------------------------------------- /www/font/fontello.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/fontello.ttf -------------------------------------------------------------------------------- /www/font/fontello.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fucan/hackshield/b9666ad6eecaa88ec12fb79e80796d4deed3e24e/www/font/fontello.woff -------------------------------------------------------------------------------- /www/js/core.js: -------------------------------------------------------------------------------- 1 | function CheckMenu(idToCheck, newID) 2 | { 3 | if ($("#" + idToCheck).hasClass("menu-item-selected")) 4 | { 5 | $("#sub" + idToCheck).slideUp("fast", function() { 6 | $("#" + idToCheck).removeClass("menu-item-selected"); 7 | 8 | if (idToCheck != newID) 9 | { 10 | $("#" + newID).toggleClass("menu-item-selected"); 11 | $("#sub" + newID).slideDown("fast"); 12 | } 13 | }); 14 | return true; 15 | } 16 | return false; 17 | } 18 | 19 | function CheckSubmenu(idToCheck, newID) 20 | { 21 | if ($("#" + idToCheck).hasClass("submenu-item-selected")) 22 | { 23 | if (idToCheck != newID) 24 | { 25 | $("#" + idToCheck).removeClass("submenu-item-selected"); 26 | $("#" + newID).toggleClass("submenu-item-selected"); 27 | } 28 | return true; 29 | } 30 | return false; 31 | } 32 | 33 | function MenuClick(id) 34 | { 35 | var status = false; 36 | 37 | if(!status && CheckMenu("menu-item-player", id)) 38 | status = true; 39 | if(!status && CheckMenu("menu-item-banned", id)) 40 | status = true; 41 | if(!status && CheckMenu("menu-item-options", id)) 42 | status = true; 43 | 44 | if(!status) 45 | { 46 | 47 | $("#" + id).toggleClass("menu-item-selected"); 48 | $("#sub" + id).slideDown("fast"); 49 | } 50 | } 51 | 52 | function SubmenuClick(id) 53 | { 54 | var status = false; 55 | 56 | if(!status && CheckSubmenu("submenu-item-players-on", id)) 57 | status = true; 58 | if(!status && CheckSubmenu("submenu-item-all-players", id)) 59 | status = true; 60 | if(!status && CheckSubmenu("submenu-item-banned-account", id)) 61 | status = true; 62 | if(!status && CheckSubmenu("submenu-item-banned-ip", id)) 63 | status = true; 64 | if(!status && CheckSubmenu("submenu-item-banned-hwid", id)) 65 | status = true; 66 | 67 | if(!status) 68 | $("#" + id).toggleClass("submenu-item-selected"); 69 | } --------------------------------------------------------------------------------