Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
4 changes: 3 additions & 1 deletion AMBuildScript
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class ExtensionConfig(object):
'-fvisibility=hidden',
]
cxx.cxxflags += [
'-std=c++11',
'-std=c++14',
'-fno-exceptions',
'-fno-threadsafe-statics',
'-Wno-non-virtual-dtor',
Expand Down Expand Up @@ -360,6 +360,8 @@ class ExtensionConfig(object):
lib_folder = os.path.join(sdk.path, 'linux_sdk')
elif sdk.name in ['sdk2013', 'bms']:
lib_folder = os.path.join(sdk.path, 'lib', 'public', 'linux32')
elif sdk.name == 'css':
lib_folder = os.path.join(sdk.path, 'lib', 'public', 'linux')
else:
lib_folder = os.path.join(sdk.path, 'lib', 'linux')
elif builder.target_platform == 'mac':
Expand Down
14 changes: 8 additions & 6 deletions extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ bool __stdcall BlindHookHandler(CBaseEntity *pEntity, CBaseEntity *pevInflictor,

__declspec(naked) void blindhook()
{
__asm sub esp, 4 // Align to 16
__asm push [ebp+0x18] // pevAttacker
__asm push [ebp+0x14] // pevInflictor
__asm push ebx // pEntity
__asm push edi // pEntity
__asm call BlindHookHandler;
__asm add esp, 4

__asm test al, al;
__asm jz Trampoline
Expand All @@ -78,10 +80,10 @@ __declspec(naked) void blindhook()
// Trampoline back
__asm Trampoline:
__asm _emit 0x8B
__asm _emit 0x03
__asm _emit 0x07
__asm _emit 0x8D
__asm _emit 0x4D
__asm _emit 0xD0
__asm _emit 0xC8

__asm mov edx, g_addr_continue
__asm jmp edx
Expand All @@ -103,9 +105,9 @@ bool BlindHook::SDK_OnLoad(char *error, size_t maxlength, bool late)

void *addr_hook;

addr_hook = (void*)((uintptr_t)addr + 0xCC);
g_addr_continue = (void*)((uintptr_t)addr + 0xD1);
g_addr_skip = (void*)((uintptr_t)addr + 0x68);
addr_hook = (void*)((uintptr_t)addr + 0xB4);
g_addr_continue = (void*)((uintptr_t)addr + 0xB9);
g_addr_skip = (void*)((uintptr_t)addr + 0x58);

sharesys->RegisterLibrary(myself, "blindhook");
plsys->AddPluginsListener(this);
Expand Down
2 changes: 1 addition & 1 deletion smsdk_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/* Basic information exposed publicly */
#define SMEXT_CONF_NAME "Blind Hook"
#define SMEXT_CONF_DESCRIPTION "Adds SourcePawn hook for flashbang's blind action."
#define SMEXT_CONF_VERSION "1.0-cssob"
#define SMEXT_CONF_VERSION "1.1-cssob"
#define SMEXT_CONF_AUTHOR "Kailo"
#define SMEXT_CONF_URL "https://github.com/Kailo97"
#define SMEXT_CONF_LOGTAG "Blind Hook"
Expand Down
2 changes: 1 addition & 1 deletion sourcemod_files/gamedata/blindhook.games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"RadiusFlash"
{
"library" "server"
"linux" "\x55\x89\xE5\x57\x56\x8D\x4D\x08"
"linux" "@_Z11RadiusFlash6VectorP11CBaseEntityS1_fii"
}
}
}
Expand Down