summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-10-16 20:04:40 -0300
committershennetsind <ind@henn.et>2013-10-16 20:04:40 -0300
commit3ba9b1013c494f5c0a8b490336d60f0f4dabbd4a (patch)
treee09b007b2dec290cef90a49e1b671ce7d59a7ce2 /src/plugins
parent4a1332099ff348f88f3d2c05512a92d3bc6f9c25 (diff)
downloadhercules-3ba9b1013c494f5c0a8b490336d60f0f4dabbd4a.tar.gz
hercules-3ba9b1013c494f5c0a8b490336d60f0f4dabbd4a.tar.bz2
hercules-3ba9b1013c494f5c0a8b490336d60f0f4dabbd4a.tar.xz
hercules-3ba9b1013c494f5c0a8b490336d60f0f4dabbd4a.zip
Modified HPM Hook Caching
Dropped hard-coded indexes, will make updates of the file in the future be smaller and much more clear in content. Made Possible Thanks to Haruna <3 Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HPMHooking.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c
index 8b4f06ae0..1ca5b5f3c 100644
--- a/src/plugins/HPMHooking.c
+++ b/src/plugins/HPMHooking.c
@@ -53,8 +53,7 @@ HPExport struct hplugin_info pinfo = {
HPM_VERSION, // HPM Version (don't change, macro is automatically updated)
};
-#define HP_POP(x) #x , (void**)(&x)
-#define HP_POP2(x) (void*)x
+#define HP_POP(x,y) #x , (void**)(&x) , (void*)y , 0
DBMap *hp_db;/* hooking points db -- for quick lookup */
struct HookingPointData {
@@ -150,7 +149,7 @@ void HPM_HP_final(void) {
void HPM_HP_load(void) {
#include "../plugins/HPMHooking/HPMHooking.HookingPoints.inc"
- int i, len = ARRAYLENGTH(HookingPoints);
+ int i, len = ARRAYLENGTH(HookingPoints), idx = 0;
memset(&HPMHooks,0,sizeof(struct HPMHooksCore));
@@ -163,6 +162,9 @@ void HPM_HP_load(void) {
memcpy(hpd, &HookingPoints[i], sizeof(struct HookingPointData));
+ hpd->idx = idx;
+ idx += 2;
+
strdb_put(hp_db, HookingPoints[i].name, hpd);
HPMHooks.data.total++;