@@ -163,7 +163,9 @@ def show_progress(
163163
164164 # Show current file
165165 if filename :
166- print (f"{ Colors .DIM } -> Completed: { Colors .NC } { Colors .GREEN } { filename } { Colors .NC } " )
166+ print (
167+ f"{ Colors .DIM } -> Completed: { Colors .NC } { Colors .GREEN } { filename } { Colors .NC } "
168+ )
167169 else :
168170 print (f"{ Colors .DIM } -> Processing...{ Colors .NC } " )
169171
@@ -176,7 +178,9 @@ def show_progress_final(total: int, elapsed: int):
176178 bar = draw_progress_bar (total , total )
177179 print (f"\r \033 [K\n \033 [K\n " , end = "" )
178180 print ("\033 [2A" , end = "" )
179- print (f"{ Colors .GREEN } [{ bar } ]{ Colors .NC } { Colors .BOLD } 100%{ Colors .NC } ({ total } /{ total } ) | Total: { format_time (elapsed )} " )
181+ print (
182+ f"{ Colors .GREEN } [{ bar } ]{ Colors .NC } { Colors .BOLD } 100%{ Colors .NC } ({ total } /{ total } ) | Total: { format_time (elapsed )} "
183+ )
180184 print ()
181185
182186
@@ -787,11 +791,17 @@ def process_elf_file(
787791 if current_func > 0 :
788792 avg_time = elapsed / current_func
789793 eta = int ((total_funcs - current_func ) * avg_time )
790- show_progress (current_func , total_funcs , elapsed , last_func_name , eta )
794+ show_progress (
795+ current_func , total_funcs , elapsed , last_func_name , eta
796+ )
791797 except :
792798 pass
793799 elif "ANALYZING" in line and not analysis_done :
794- print (f"\r { Colors .DIM } Ghidra analyzing...{ Colors .NC } " , end = "" , flush = True )
800+ print (
801+ f"\r { Colors .DIM } Ghidra analyzing...{ Colors .NC } " ,
802+ end = "" ,
803+ flush = True ,
804+ )
795805
796806 process .wait ()
797807
@@ -837,7 +847,11 @@ def process_elf_file(
837847 result .duration = time .time () - start_time
838848
839849 if result .success :
840- h_count = len (list (Path (include_dir ).glob ("*.h" ))) if os .path .isdir (include_dir ) else 0
850+ h_count = (
851+ len (list (Path (include_dir ).glob ("*.h" )))
852+ if os .path .isdir (include_dir )
853+ else 0
854+ )
841855
842856 print ()
843857 log_info (f"{ Colors .GREEN } ELF Processing Complete{ Colors .NC } " )
@@ -862,7 +876,9 @@ def process_elf_file(
862876 print (f" - { name } ({ lines } lines)" )
863877
864878 if result .module_count > 10 :
865- print (f" { Colors .DIM } ... and { result .module_count - 10 } more modules{ Colors .NC } " )
879+ print (
880+ f" { Colors .DIM } ... and { result .module_count - 10 } more modules{ Colors .NC } "
881+ )
866882 print ()
867883
868884 # Generate README
@@ -896,15 +912,21 @@ def generate_elf_readme(name: str, output_dir: str, strategy: str, result: ElfRe
896912 f .write (f"## Module Grouping Strategy: { strategy } \n \n " )
897913
898914 if strategy == "prefix" :
899- f .write ("Functions are grouped by their naming prefix. This works best for libraries\n " )
915+ f .write (
916+ "Functions are grouped by their naming prefix. This works best for libraries\n "
917+ )
900918 f .write ("with consistent naming conventions like:\n " )
901919 f .write ("- xxBmp* (Bitmap functions) -> elf_name_xxBmp.cpp\n " )
902920 f .write ("- xxFnt* (Font functions) -> elf_name_xxFnt.cpp\n \n " )
903921 elif strategy == "alpha" :
904- f .write ("Functions are grouped alphabetically (A-Z). Useful for very large\n " )
922+ f .write (
923+ "Functions are grouped alphabetically (A-Z). Useful for very large\n "
924+ )
905925 f .write ("ELF files as a first-pass organization.\n \n " )
906926 elif strategy == "camelcase" :
907- f .write ("Functions are grouped by extracting CamelCase words from their names.\n " )
927+ f .write (
928+ "Functions are grouped by extracting CamelCase words from their names.\n "
929+ )
908930 f .write ("Good for object-oriented code.\n \n " )
909931 elif strategy == "single" :
910932 f .write ("All functions are placed in a single output file.\n \n " )
0 commit comments