Overhaul of many things.

This commit is contained in:
Asher Baker
2012-11-05 16:00:51 +00:00
parent 504d6befd2
commit fe52823b62
13 changed files with 350 additions and 100 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ for i in SM.sdkInfo:
'sdk/smsdk_ext.cpp'
])
SM.PostSetupHL2Job(extension, binary, i)
#SM.AutoVersion('extension', binary)
#SM.ExtractDebugInfo(extension, binary)
SM.AutoVersion('extension', binary)
SM.ExtractDebugInfo(extension, binary)
binary.SendToJob()
+7 -7
View File
@@ -157,9 +157,9 @@ int copy_bytes(unsigned char *func, unsigned char* dest, int required_len) {
else if(!twoByte)
{
if((opcode & 0xC4) == 0x00 ||
(opcode & 0xF4) == 0x60 && ((opcode & 0x0A) == 0x02 || (opcode & 0x09) == 0x09) ||
((opcode & 0xF4) == 0x60 && ((opcode & 0x0A) == 0x02 || (opcode & 0x09) == 0x09)) ||
(opcode & 0xF0) == 0x80 ||
(opcode & 0xF8) == 0xC0 && (opcode & 0x0E) != 0x02 ||
((opcode & 0xF8) == 0xC0 && (opcode & 0x0E) != 0x02) ||
(opcode & 0xFC) == 0xD0 ||
(opcode & 0xF6) == 0xF6)
{
@@ -170,11 +170,11 @@ int copy_bytes(unsigned char *func, unsigned char* dest, int required_len) {
}
else
{
if((opcode & 0xF0) == 0x00 && (opcode & 0x0F) >= 0x04 && (opcode & 0x0D) != 0x0D ||
if(((opcode & 0xF0) == 0x00 && (opcode & 0x0F) >= 0x04 && (opcode & 0x0D) != 0x0D) ||
(opcode & 0xF0) == 0x30 ||
opcode == 0x77 ||
(opcode & 0xF0) == 0x80 ||
(opcode & 0xF0) == 0xA0 && (opcode & 0x07) <= 0x02 ||
((opcode & 0xF0) == 0xA0 && (opcode & 0x07) <= 0x02) ||
(opcode & 0xF8) == 0xC8)
{
// No mod R/M byte
@@ -250,7 +250,7 @@ int copy_bytes(unsigned char *func, unsigned char* dest, int required_len) {
(opcode & 0xFE) == 0xD4 || // AAD/AAM
(opcode & 0xF8) == 0xE0 || // LOOP/JCXZ
opcode == 0xEB ||
opcode == 0xF6 && (modRM & 0x30) == 0x00) // TEST
(opcode == 0xF6 && (modRM & 0x30) == 0x00)) // TEST
{
if (dest)
*dest++ = *func++;
@@ -275,7 +275,7 @@ int copy_bytes(unsigned char *func, unsigned char* dest, int required_len) {
(opcode & 0xFC) == 0xA0 ||
(opcode & 0xEE) == 0xA8 ||
opcode == 0xC7 ||
opcode == 0xF7 && (modRM & 0x30) == 0x00)
(opcode == 0xF7 && (modRM & 0x30) == 0x00))
{
if (dest) {
//Fix CALL/JMP offset
@@ -370,7 +370,7 @@ void* eval_jump(void* src) {
else if (addr[0] == OP_JMP_BYTE) {
addr = &addr[OP_JMP_BYTE_SIZE] + *(char*)&addr[1];
//mangled 32bit jump?
if (addr[0] = OP_JMP) {
if (addr[0] == OP_JMP) {
addr = addr + *(int*)&addr[1];
}
return addr;
+4 -4
View File
@@ -93,9 +93,9 @@ CBaseServer *g_pBaseServer = NULL;
typedef CSteam3Server *(*Steam3ServerFunc)();
#ifndef WIN32
typedef void (*RejectConnectionFunc)(CBaseServer *, const netadr_t &address, int iClientChallenge, char *pchReason);
typedef void (*RejectConnectionFunc)(CBaseServer *, const netadr_t &address, int iClientChallenge, const char *pchReason);
#else
typedef void (__fastcall *RejectConnectionFunc)(CBaseServer *, void *, const netadr_t &address, int iClientChallenge, char *pchReason);
typedef void (__fastcall *RejectConnectionFunc)(CBaseServer *, void *, const netadr_t &address, int iClientChallenge, const char *pchReason);
#endif
#ifndef WIN32
@@ -116,7 +116,7 @@ CSteam3Server *Steam3Server()
return g_pSteam3ServerFunc();
}
void RejectConnection(const netadr_t &address, int iClientChallenge, char *pchReason)
void RejectConnection(const netadr_t &address, int iClientChallenge, const char *pchReason)
{
if (!g_pRejectConnectionFunc || !g_pBaseServer)
return;
@@ -274,7 +274,7 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient *, netadr_t &, address,
return DETOUR_MEMBER_CALL(CBaseServer__ConnectClient)(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
}
DETOUR_DECL_MEMBER3(CBaseServer__RejectConnection, void, netadr_t &, address, int, iClientChallenge, char *, pchReason)
DETOUR_DECL_MEMBER3(CBaseServer__RejectConnection, void, netadr_t &, address, int, iClientChallenge, const char *, pchReason)
{
if (g_bEndAuthSessionOnRejectConnection)
{
+4 -2
View File
@@ -34,10 +34,12 @@
* @brief Contains macros for configuring basic extension information.
*/
#include "version.h" // SM_FULL_VERSION
/* Basic information exposed publicly */
#define SMEXT_CONF_NAME "Connect"
#define SMEXT_CONF_DESCRIPTION ""
#define SMEXT_CONF_VERSION "1.1.0"
#define SMEXT_CONF_DESCRIPTION "Forward for early connection"
#define SMEXT_CONF_VERSION SM_FULL_VERSION
#define SMEXT_CONF_AUTHOR "Asher \"asherkin\" Baker"
#define SMEXT_CONF_URL "http://limetech.org/"
#define SMEXT_CONF_LOGTAG "CONNECT"
+27
View File
@@ -0,0 +1,27 @@
#ifndef _INCLUDE_VERSION_INFORMATION_H_
#define _INCLUDE_VERSION_INFORMATION_H_
/**
* @file Contains version information.
* @brief This file will redirect to an autogenerated version if being compiled via
* the build scripts.
*/
#if defined SM_GENERATED_BUILD
#include "version_auto.h"
#else
#ifndef SM_GENERATED_BUILD
#undef BINARY_NAME
#define BINARY_NAME "connect.ext.dll\0"
#endif
#define SM_BUILD_TAG "-manual"
#define SM_BUILD_UNIQUEID "[MANUAL BUILD]"
#define SM_VERSION "1.2.0"
#define SM_FULL_VERSION SM_VERSION SM_BUILD_TAG
#define SM_FILE_VERSION 1,2,0,0
#endif
#endif /* _INCLUDE_VERSION_INFORMATION_H_ */
+45
View File
@@ -0,0 +1,45 @@
#include "winres.h"
#include <version.h>
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif
#ifndef SM_GENERATED_BUILD
#define BINARY_NAME "connect.ext.dll\0"
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION SM_FILE_VERSION
PRODUCTVERSION SM_FILE_VERSION
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Connect Extension"
VALUE "FileDescription", "SourceMod Connect Extension"
VALUE "FileVersion", SM_BUILD_UNIQUEID
VALUE "InternalName", "Connect"
VALUE "LegalCopyright", "Copyright (c) 2012, Asher Baker"
VALUE "OriginalFilename", BINARY_NAME
VALUE "ProductName", "Connect Extension"
VALUE "ProductVersion", SM_FULL_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0x04B0
END
END