@@ -514,7 +514,7 @@ write_mem(pid_t pid, unsigned long *buf, int nlong, unsigned long pos)
514
514
int i ;
515
515
516
516
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 ))
518
518
return -1 ;
519
519
return 0 ;
520
520
}
@@ -526,7 +526,7 @@ read_mem(pid_t pid, unsigned long *buf, int nlong, unsigned long pos)
526
526
int i ;
527
527
528
528
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 )
530
530
return -1 ;
531
531
return 0 ;
532
532
}
@@ -666,7 +666,7 @@ int main(int argc, char *argv[])
666
666
667
667
void * ldl = dlopen ("libdl.so" , RTLD_LAZY );
668
668
if (ldl ) {
669
- dlopenaddr = dlsym (ldl , "dlopen" );
669
+ dlopenaddr = ( unsigned long ) dlsym (ldl , "dlopen" );
670
670
dlclose (ldl );
671
671
}
672
672
unsigned long int lkaddr ;
@@ -719,7 +719,7 @@ int main(int argc, char *argv[])
719
719
printf ("zygote -> %s\n" , fname );
720
720
721
721
// detach from zygote
722
- ptrace (PTRACE_DETACH , pid , 0 , SIGCONT );
722
+ ptrace (PTRACE_DETACH , pid , 0 , ( void * ) SIGCONT );
723
723
724
724
// now perform on new process
725
725
pid = child_pid ;
@@ -871,7 +871,7 @@ int main(int argc, char *argv[])
871
871
872
872
// detach and continue
873
873
ptrace (PTRACE_SETREGS , pid , 0 , & regs );
874
- ptrace (PTRACE_DETACH , pid , 0 , SIGCONT );
874
+ ptrace (PTRACE_DETACH , pid , 0 , ( void * ) SIGCONT );
875
875
876
876
if (debug )
877
877
printf ("library injection completed!\n" );
0 commit comments