@@ -86,6 +86,9 @@ object (self)
8686 > got.info" );
8787 let module EU = ELF_utils in
8888 if EU. elf_static () then begin
89+ ret := Sys. command(objdump_command ^ " -s -j \
90+ .got.plt " ^ f^ " | grep \" ^ \" | cut -d \" \" -f3,4,5,6 \
91+ > got_plt.info" );
8992 ret := Sys. command(objdump_command ^ " -d -j \
9093 .plt " ^ f^ " | grep jmp | wc -l > plt_entries.info" );
9194 ret := Sys. command(objdump_command ^ " -s -j \
@@ -134,8 +137,13 @@ object (self)
134137 else failwith " unsupported architecture for fields" in
135138 ignore (Sys. command(" cat " ^ f^ " .disassemble | grep \" ^ \" | cut -f" ^ fields^ " \
136139 > instrs.info" ));
140+ let module EU = ELF_utils in
141+ if EU. elf_static () then
142+ ( ignore (Sys. command(" cat plt_whole.info | grep \" ^ \" | cut -f1,3 \
143+ > plt_whole2.info" ));
144+ ignore (Sys. command(" cat plt_whole2.info >> instrs.info" )) );
137145 ignore (Sys. command(" python3 filter_nop.py" ));
138- ignore (Sys. command(" cut -f 1 instrs.info > text_mem.info" ))
146+ ignore (Sys. command(" cut -f 1 instrs.info > text_mem.info" ));
139147
140148 method user_func_process (f : string ) : unit =
141149 ignore (Sys. command(" cat " ^ f^ " .disassemble | grep \" <\" | grep \" >:\" \
@@ -147,12 +155,12 @@ object (self)
147155 (ignore (Sys. command(" readelf -SW " ^ f ^ " | awk \' FNR<15\' | \
148156 awk \' /data|bss|got|__libc_IO_vtables|\
149157 __libc_freeres_ptrs/ {print $3,$5,$6,$7} \' | \
150- awk \' $1 != \" .got.plt \" {print $1,$2,$3,$4}\' \
158+ awk \' {print $1,$2,$3,$4}\' \
151159 > sections.info" ));
152160 ignore (Sys. command(" readelf -SW " ^ f ^ " | awk \' FNR>14\' | \
153161 awk \' /data|bss|got|__libc_IO_vtables|\
154162 __libc_freeres_ptrs/ {print $2,$4,$5,$6} \' | \
155- awk \' $1 != \" .got.plt \" {print $1,$2,$3,$4}\' \
163+ awk \' {print $1,$2,$3,$4}\' \
156164 >> sections.info" )))
157165 else
158166 (ignore (Sys. command(" readelf -SW " ^ f ^ " | awk \' FNR<15\' | \
@@ -300,8 +308,8 @@ let main () =
300308 let _ = Random. self_init () in
301309 let init = new ailInit in
302310 ( init#init arch bit_mode;
303- init#disassemble elf arch;
304- init#process elf arch bit_mode;
311+ init#disassemble elf arch; (* create text and data files *)
312+ init#process elf arch bit_mode; (* create other text files *)
305313 init#ail_process(elf) )
306314 else
307315 print_string (" binary file " ^ elf^ " doesn't exist\n " )
0 commit comments