Skip to content

Commit c4d757b

Browse files
committed
Fix minor compiler warnings due to implicit casts
1 parent 7240d51 commit c4d757b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

hijack/hijack.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ write_mem(pid_t pid, unsigned long *buf, int nlong, unsigned long pos)
514514
int i;
515515

516516
for (p = buf, i = 0; i < nlong; p++, i++)
517-
if (0 > ptrace(PTRACE_POKETEXT, pid, pos+(i*4), *p))
517+
if (0 > ptrace(PTRACE_POKETEXT, pid, (void *)(pos+(i*4)), (void *)*p))
518518
return -1;
519519
return 0;
520520
}
@@ -526,7 +526,7 @@ read_mem(pid_t pid, unsigned long *buf, int nlong, unsigned long pos)
526526
int i;
527527

528528
for (p = buf, i = 0; i < nlong; p++, i++)
529-
if ((*p = ptrace(PTRACE_PEEKTEXT, pid, pos+(i*4), *p)) < 0)
529+
if ((*p = ptrace(PTRACE_PEEKTEXT, pid, (void *)(pos+(i*4)), (void *)*p)) < 0)
530530
return -1;
531531
return 0;
532532
}
@@ -666,7 +666,7 @@ int main(int argc, char *argv[])
666666

667667
void *ldl = dlopen("libdl.so", RTLD_LAZY);
668668
if (ldl) {
669-
dlopenaddr = dlsym(ldl, "dlopen");
669+
dlopenaddr = (unsigned long)dlsym(ldl, "dlopen");
670670
dlclose(ldl);
671671
}
672672
unsigned long int lkaddr;
@@ -719,7 +719,7 @@ int main(int argc, char *argv[])
719719
printf("zygote -> %s\n", fname);
720720

721721
// detach from zygote
722-
ptrace(PTRACE_DETACH, pid, 0, SIGCONT);
722+
ptrace(PTRACE_DETACH, pid, 0, (void *)SIGCONT);
723723

724724
// now perform on new process
725725
pid = child_pid;
@@ -871,7 +871,7 @@ int main(int argc, char *argv[])
871871

872872
// detach and continue
873873
ptrace(PTRACE_SETREGS, pid, 0, &regs);
874-
ptrace(PTRACE_DETACH, pid, 0, SIGCONT);
874+
ptrace(PTRACE_DETACH, pid, 0, (void *)SIGCONT);
875875

876876
if (debug)
877877
printf("library injection completed!\n");

0 commit comments

Comments
 (0)