diff --git a/source/tegraexplorer/script/functions.c b/source/tegraexplorer/script/functions.c index 9e8236a..2eb982a 100644 --- a/source/tegraexplorer/script/functions.c +++ b/source/tegraexplorer/script/functions.c @@ -66,12 +66,24 @@ int parseStringInput(char *in, char **out){ u32 currentcolor = COLOR_WHITE; int part_printf(){ - char *toprint; - if (parseStringInput(argv[0], &toprint)) - return -1; - SWAPCOLOR(currentcolor); - gfx_printf(toprint); + for (int i = 0; i < argc; i++){ + if (argv[i][0] == '@'){ + int toprintint; + if (parseIntInput(argv[i], &toprintint)) + return -1; + + gfx_printf("%d", toprintint); + } + else { + char *toprintstring; + if (parseStringInput(argv[i], &toprintstring)) + return -1; + + gfx_printf(toprintstring); + } + } + gfx_printf("\n"); return 0; } @@ -529,7 +541,7 @@ int part_getPos(){ } str_fnc_struct functions[] = { - {"printf", part_printf, 1}, + {"printf", part_printf, 255}, {"printInt", part_print_int, 1}, {"setPrintPos", part_setPrintPos, 2}, {"clearscreen", part_clearscreen, 0}, @@ -571,7 +583,7 @@ str_fnc_struct functions[] = { int run_function(char *func_name, int *out){ for (u32 i = 0; functions[i].key != NULL; i++){ if (!strcmp(functions[i].key, func_name)){ - if (argc != functions[i].arg_count) + if (argc != functions[i].arg_count && functions[i].arg_count != 255) continue; *out = functions[i].value(); diff --git a/source/tegraexplorer/script/parser.c b/source/tegraexplorer/script/parser.c index ad42fd5..b7e2ac7 100644 --- a/source/tegraexplorer/script/parser.c +++ b/source/tegraexplorer/script/parser.c @@ -56,7 +56,7 @@ u32 splitargs(char* in) { argv = calloc(count + 1, sizeof(char*)); for (i = 0; i < count; i++) - argv[i] = calloc(128, sizeof(char)); + argv[i] = calloc(96, sizeof(char)); for (i = 0; i < len && curcount < count; i++) { diff --git a/source/tegraexplorer/utils/tools.c b/source/tegraexplorer/utils/tools.c index 641f003..fc5832d 100644 --- a/source/tegraexplorer/utils/tools.c +++ b/source/tegraexplorer/utils/tools.c @@ -35,7 +35,7 @@ void displayinfo(){ SWAPCOLOR(COLOR_ORANGE); - gfx_printf("Fuse count: %d\nPKG1 id: %s\n", fuse_count, pkg1.id); + gfx_printf("Fuse count: %d\nPKG1 id: '%s'\n", fuse_count, pkg1.id); if (pkg1.ver >= 0) gfx_printf("PKG1 version: %d\n", pkg1.ver);