Okay, so this is the following code I removed from fsbext.c in order to use "gcc fsbext.c -o fsbext.exe" or else I would have to use "gcc fsbext.c -lcomdlg32 -o fsbext.exe". Please let me know if I removed any code that was important for decrypting/extracting FSB files...
Code:
#ifdef WIN32
mywnd = GetForegroundWindow();
if(GetWindowLong(mywnd, GWL_WNDPROC)) {
num = 0;
for(i = 1; i < argc; i++) {
if(((argv[i][0] != '-') && (argv[i][0] != '/')) || (strlen(argv[i]) != 2)) {
break;
}
switch(argv[i][1]) {
case 'd': i++; num = 1; break; // output folder already selected
case 's': i++; break;
case 'f': i++; break;
default: break;
}
}
if(i > argc) i = argc;
int rem_args = num ? 1 : 3;
i = rem_args - (argc - i);
if(i > 0) {
printf(
"- GUI mode activated, remember that the tool works also from command-line\n"
" where are available various options\n"
"\n");
fname = calloc(argc + i + 3, sizeof(char *)); // was + 1 but this code is a bit chaotic so stay safe
if(!fname) std_err();
memcpy(fname, argv, sizeof(char *) * argc);
argv = (void *)fname;
argc -= (rem_args - i);
char **lame = NULL; // long story
if(num) {
if(i >= 1) argv[argc++] = get_file("select the input FSB archive to extract", 1, 0);
} else {
if(i < 3) { // lame backup
if(i >= 1) argv[argc + 1] = argv[argc];
if(i >= 2) argv[argc + 2] = argv[argc];
}
if(i >= 1) argv[argc++] = "-d";
if(i >= 2) lame = &argv[argc++];
if(i >= 3) argv[argc] = get_file("select the input FSB archive to extract", 1, 0);
argc++;
*lame = get_folder("select the output folder where extracting the files");
}
}
}
#endif
Code:
printf("- %s\n", ofn.lpstrTitle);
if(!GetOpenFileName(&ofn)) exit(1); // terminate immediately
return(filename);
Code:
printf("- %s\n", ofn.lpstrTitle);
if(!GetSaveFileName(&ofn)) exit(1); // terminate immediately
p = mystrrchrs(filename, "\\/");
if(p) *p = 0;
return(filename);