Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
FOCUS<br />
Listing 4a. hara.c<br />
#defi ne _GNU_SOURCE<br />
#include <br />
#include <br />
#include <br />
#include <br />
#include "pattern.h"<br />
#defi ne PATTERN_BUF_SIZ 1024<br />
#defi ne NM_PATH "/usr/bin/nm"<br />
#defi ne ADDRESS_BASE 0x8048000<br />
int checkPattern(char *buf1, char *buf2, size_t n);<br />
int main(int argc, char **argv){<br />
int i,j,k;<br />
int nFunc=0;<br />
int nTotal=0;<br />
int pos; //position fi chier<br />
char buf[128];<br />
30 HAKIN9 1/2010<br />
char buf2[128];<br />
char patternbuf[PATTERN_BUF_SIZ];<br />
char fi lebuf[PATTERN_BUF_SIZ];<br />
char *funcAddr;<br />
char ch;<br />
int funcSize;<br />
int readSize;<br />
int funcOffset;<br />
FILE *fp;<br />
FILE *sp;<br />
struct stat statbuf;<br />
struct passwd *pwd;<br />
/* Affi chage des en-têtes */<br />
printf("======================== HARA v1.0 ==========================\n");<br />
printf("[=] emplacement fonction libc pour binaires compilés statiquement\n");<br />
printf("[=] z0nKT1g3r @ WiseguyS\n");<br />
printf("[=] http://0xbeefc0de.org\n");<br />
//vérifi er l'argument<br />
if(argc