mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-19 20:26:14 +08:00
[saco] Refactor
This commit is contained in:
@ -8,6 +8,10 @@
|
|||||||
#include "TinyEncrypt.h"
|
#include "TinyEncrypt.h"
|
||||||
#include "Obfuscator.h"
|
#include "Obfuscator.h"
|
||||||
|
|
||||||
|
#ifndef ARCTOOL
|
||||||
|
#include "../outputdebugstring.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
|
|
||||||
DWORD CArchiveFS::ms_dwHashInit = OBFUSCATE_DATA(0x9E3779B9);
|
DWORD CArchiveFS::ms_dwHashInit = OBFUSCATE_DATA(0x9E3779B9);
|
||||||
@ -361,9 +365,10 @@ BYTE* CArchiveFS::GetFileData(DWORD dwFileIndex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return node->pbData;
|
return node->pbData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
//------------------------------------
|
||||||
}
|
|
||||||
|
|
||||||
void CArchiveFS::UnloadData(DWORD dwFileIndex)
|
void CArchiveFS::UnloadData(DWORD dwFileIndex)
|
||||||
{
|
{
|
||||||
@ -375,3 +380,5 @@ void CArchiveFS::UnloadData(DWORD dwFileIndex)
|
|||||||
node->pbData = NULL;
|
node->pbData = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------
|
||||||
|
@ -29,7 +29,6 @@ CCryptoContext::CCryptoContext(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ms_dwRefCount++;
|
ms_dwRefCount++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
|
@ -10,19 +10,6 @@
|
|||||||
|
|
||||||
#ifndef ARCTOOL
|
#ifndef ARCTOOL
|
||||||
|
|
||||||
/*
|
|
||||||
const CHAR* CRYPT_MODULE = "advapi32";
|
|
||||||
const CHAR* CRYPT_FN_AcquireContext = "CryptAcquireContextA";
|
|
||||||
const CHAR* CRYPT_FN_ReleaseContext = "CryptReleaseContext";
|
|
||||||
const CHAR* CRYPT_FN_GenRandom = "CryptGenRandom";
|
|
||||||
const CHAR* CRYPT_FN_CreateHash = "CryptCreateHash";
|
|
||||||
const CHAR* CRYPT_FN_DestroyHash = "CryptDestroyHash";
|
|
||||||
const CHAR* CRYPT_FN_HashData = "CryptHashData";
|
|
||||||
const CHAR* CRYPT_FN_DestroyKey = "CryptDestroyKey";
|
|
||||||
const CHAR* CRYPT_FN_ImportKey = "CryptImportKey";
|
|
||||||
const CHAR* CRYPT_FN_VerifySignature = "CryptVerifySignatureA";
|
|
||||||
*/
|
|
||||||
|
|
||||||
const CHAR CRYPT_MODULE[] = "41#4%<fgU";
|
const CHAR CRYPT_MODULE[] = "41#4%<fgU";
|
||||||
const CHAR CRYPT_FN_AcquireContext[] = {0x16,0x27,0x2C,0x25,0x21,0x14,0x36,0x24,
|
const CHAR CRYPT_FN_AcquireContext[] = {0x16,0x27,0x2C,0x25,0x21,0x14,0x36,0x24,
|
||||||
0x20,0x3C,0x27,0x30,0x16,0x3A,0x3B,0x21,
|
0x20,0x3C,0x27,0x30,0x16,0x3A,0x3B,0x21,
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// This file defines a basic interface for data streams
|
||||||
|
// and provides implementations for a filebased stream
|
||||||
|
// as well as as a memory based stream.
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
class CAbstractStream
|
class CAbstractStream
|
||||||
{
|
{
|
||||||
@ -249,5 +254,4 @@ public:
|
|||||||
{
|
{
|
||||||
return m_nOffset;
|
return m_nOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
|
|
||||||
|
//
|
||||||
|
// This is a modified XTEA algorithm with a streaming
|
||||||
|
// mode of operation -- specifically CBC
|
||||||
|
//
|
||||||
|
|
||||||
#include "TinyEncrypt.h"
|
#include "TinyEncrypt.h"
|
||||||
#include "Obfuscator.h"
|
#include "Obfuscator.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
#define ADDR_HWND 0xC97C1C
|
#define ADDR_HWND 0xC97C1C
|
||||||
#define ADDR_ID3D9DEVICE 0xC97C28
|
#define ADDR_ID3D9DEVICE 0xC97C28
|
||||||
|
|
||||||
@ -30,3 +32,5 @@
|
|||||||
#define ADDR_VEHICLE_TABLE 0xB74494 // Contains ptr to the vehicles table
|
#define ADDR_VEHICLE_TABLE 0xB74494 // Contains ptr to the vehicles table
|
||||||
|
|
||||||
#define ADDR_CAMERA 0xB6F99C
|
#define ADDR_CAMERA 0xB6F99C
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
#define MAX_PLAYERS 1004
|
#define MAX_PLAYERS 1004
|
||||||
#define MAX_ACTORS 1000
|
#define MAX_ACTORS 1000
|
||||||
#define MAX_VEHICLES 2000
|
#define MAX_VEHICLES 2000
|
||||||
@ -58,6 +60,7 @@ typedef struct _MATRIX4X4 {
|
|||||||
#define IN_VEHICLE(x) ((x->dwStateFlags & 256) >> 8)
|
#define IN_VEHICLE(x) ((x->dwStateFlags & 256) >> 8)
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
typedef struct _WEAPON_SLOT_TYPE
|
typedef struct _WEAPON_SLOT_TYPE
|
||||||
{
|
{
|
||||||
DWORD dwType;
|
DWORD dwType;
|
||||||
@ -71,6 +74,7 @@ typedef struct _WEAPON_SLOT_TYPE
|
|||||||
} WEAPON_SLOT_TYPE; // MUST BE EXACTLY ALIGNED TO 28 bytes
|
} WEAPON_SLOT_TYPE; // MUST BE EXACTLY ALIGNED TO 28 bytes
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
typedef struct _PED_TASKS_TYPE
|
typedef struct _PED_TASKS_TYPE
|
||||||
{
|
{
|
||||||
@ -95,6 +99,7 @@ typedef struct _PED_TASKS_TYPE
|
|||||||
} PED_TASKS_TYPE;
|
} PED_TASKS_TYPE;
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
typedef struct _ENTITY_TYPE
|
typedef struct _ENTITY_TYPE
|
||||||
{
|
{
|
||||||
@ -127,10 +132,11 @@ typedef struct _ENTITY_TYPE
|
|||||||
} ENTITY_TYPE;
|
} ENTITY_TYPE;
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
typedef struct _PED_TYPE
|
typedef struct _PED_TYPE
|
||||||
{
|
{
|
||||||
ENTITY_TYPE entity;
|
ENTITY_TYPE entity; // 0-184
|
||||||
|
|
||||||
char _gapB8[948];
|
char _gapB8[948];
|
||||||
|
|
||||||
@ -193,6 +199,8 @@ typedef struct _PED_TYPE
|
|||||||
} PED_TYPE;
|
} PED_TYPE;
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct _VEHICLE_TYPE
|
typedef struct _VEHICLE_TYPE
|
||||||
{
|
{
|
||||||
ENTITY_TYPE entity; // 0-184
|
ENTITY_TYPE entity; // 0-184
|
||||||
|
@ -61,7 +61,7 @@ CHttpClient::~CHttpClient()
|
|||||||
|
|
||||||
int CHttpClient::ProcessURL(int iType, char *szURL, char *szPostData, char *szReferer)
|
int CHttpClient::ProcessURL(int iType, char *szURL, char *szPostData, char *szReferer)
|
||||||
{
|
{
|
||||||
printf("CHttpClient::ProcessURL %s\n", szURL); // Thanks Kalcor!
|
printf("CHttpClient::ProcessURL %s\n",szURL);
|
||||||
|
|
||||||
InitRequest(iType,szURL,szPostData,szReferer);
|
InitRequest(iType,szURL,szPostData,szReferer);
|
||||||
|
|
||||||
@ -187,6 +187,7 @@ void CHttpClient::InitRequest(int iType, char *szURL, char *szPostData, char *sz
|
|||||||
|
|
||||||
// Copy hostname from URL
|
// Copy hostname from URL
|
||||||
slash_ptr = strchr(szUseURL,'/');
|
slash_ptr = strchr(szUseURL,'/');
|
||||||
|
|
||||||
if(!slash_ptr) {
|
if(!slash_ptr) {
|
||||||
strcat(szUseURL,"/");
|
strcat(szUseURL,"/");
|
||||||
slash_ptr = strchr(szUseURL,'/');
|
slash_ptr = strchr(szUseURL,'/');
|
||||||
|
@ -53,6 +53,7 @@ char *Util_stristr(const char *String, const char *Pattern)
|
|||||||
return (starti);
|
return (starti);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +120,6 @@ int Util_wildcmp(char *wild, char *string)
|
|||||||
|
|
||||||
int Util_strnicmp(const char *s1, const char *s2, size_t n)
|
int Util_strnicmp(const char *s1, const char *s2, size_t n)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (n == 0) return 0;
|
if (n == 0) return 0;
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
|
||||||
void Util_UrlUnencode(char *enc);
|
void Util_UrlUnencode(char *enc);
|
||||||
char Util_toupper(char c);
|
char Util_toupper(char c);
|
||||||
char *Util_stristr(const char *String, const char *Pattern);
|
char *Util_stristr(const char *String, const char *Pattern);
|
||||||
|
Reference in New Issue
Block a user