summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/HPMHooking.c8
-rwxr-xr-xtools/HPMHookGen/HPMHookGen.pl2
2 files changed, 6 insertions, 4 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++;
diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl
index 5333f3f03..cf50a9e77 100755
--- a/tools/HPMHookGen/HPMHookGen.pl
+++ b/tools/HPMHookGen/HPMHookGen.pl
@@ -392,7 +392,7 @@ foreach my $key (@keys) {
foreach my $if (@{ $ifs{$key} }) {
print FH <<"EOF";
- { HP_POP($key\->$if->{name}), HP_POP2($if->{hname}), $idx },
+ { HP_POP($key\->$if->{name}, $if->{hname}) },
EOF
$idx += 2;