Update hamsandwich module project files and use AMTL.

This commit is contained in:
Arkshine
2014-08-10 11:48:06 +02:00
parent 4f776ee56b
commit 4f3d335ab4
21 changed files with 710 additions and 7500 deletions

View File

@@ -16,13 +16,12 @@
#include "offsets.h"
#include "ham_utils.h"
#include "hooklist.h"
#include "CVector.h"
#include "forward.h"
#include "hook.h"
#include "CString.h"
#include <am-vector.h>
#include <am-string.h>
extern CVector<Hook *> hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL];
extern ke::Vector<Hook *> hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL];
void FailPlugin(AMX *amx, int id, int err, const char *reason);
@@ -34,13 +33,9 @@ inline void *GetFunction(void *pthis, int id, bool &istramp)
void *func=GetVTableEntry(pthis, hooklist[id].vtid, Offsets.GetBase());
// Check to see if it's a trampoline
CVector<Hook *>::iterator end=hooks[id].end();
for (CVector<Hook *>::iterator i=hooks[id].begin();
i!=end;
++i)
for (size_t i = 0; i < hooks[id].length(); ++i)
{
if (func==(*i)->tramp)
if (func == hooks[id].at(i)->tramp)
{
istramp=true;
return func;
@@ -57,17 +52,13 @@ inline void *_GetFunction(void *pthis, int id)
void *func=ivtbl[hooklist[id].vtid];
// Iterate through the hooks for the id, see if the function is found
CVector<Hook *>::iterator end=hooks[id].end();
for (CVector<Hook *>::iterator i=hooks[id].begin();
i!=end;
++i)
for (size_t i = 0; i < hooks[id].length(); ++i)
{
// If the function points to a trampoline, then return the original
// function.
if (func==(*i)->tramp)
if (func == hooks[id].at(i)->tramp)
{
return (*i)->func;
return hooks[id].at(i)->func;
}
}