From e591b8b17d0e21e2d40a635ad7cc023e810844b0 Mon Sep 17 00:00:00 2001 From: superp00t Date: Mon, 25 Nov 2024 23:28:52 -0500 Subject: [PATCH] fix(ida): fixed export crash on IDA 9.0 --- ida/export_symbols.idc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ida/export_symbols.idc b/ida/export_symbols.idc index 6f70cac..96b5698 100644 --- a/ida/export_symbols.idc +++ b/ida/export_symbols.idc @@ -22,12 +22,7 @@ static bna_save_function_symbols(fd) { "%s %s f end=%s ; %08X", func_name, bna_format_address(func_start), bna_format_address(func_end), get_func_attr(func_address, FUNCATTR_FLAGS)); - if (writestr(fd, func_line) != 0) { - error("bna_save_function_symbols: failed to write line to file"); - return 0; - } - - if (writestr(fd, "\n") != 0) { + if (fprintf(fd, "%s\n", func_line) != 0) { error("bna_save_function_symbols: failed to write line break to file"); return 0; } @@ -49,10 +44,10 @@ static main() { output_filename = ask_file(1, "all.sym", "Enter a path to export your symbols"); if (output_filename == 0) { error("No output file specified. Doing NOTHING."); - return 0; + return 1; } - output_file = fopen(output_filename, "wb"); + output_file = fopen(output_filename, "w"); if (!output_file) { error("Failed to open output file '%s' for writing", output_filename); @@ -68,5 +63,8 @@ static main() { } fclose(output_file); + + warning("Successfully exported to %s", output_filename); + return 1; } \ No newline at end of file