Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 13:39

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: fsbext password command line flag for encrypted FSB
PostPosted: 12 Feb 2011 00:30 

Joined: 23 Oct 2010 00:29
Posts: 35
How hard would it be to implement a command line flag in fsbext.exe for password encrypted FSB files. For example...

fsbext.exe -d C:\path\to\extraction -p fsb-password test.fsb

This would make it one step faster.

I don't know how to code C (or anything actually), otherwise I would give modifying and compiling the fsbext.c a shot.

Thanks in advance.


Top
 Profile  
 
 
 Post subject: Re: fsbext password command line flag for encrypted FSB
PostPosted: 14 Feb 2011 16:54 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
yeah I can add that option, it can be useful with tons of fsb files that use the same password
stay tuned


Top
 Profile  
 
 Post subject: Re: fsbext password command line flag for encrypted FSB
PostPosted: 15 Feb 2011 19:36 

Joined: 23 Oct 2010 00:29
Posts: 35
Thanks aluigi. I certainly appreciate you looking into this.

Also, I have a question regarding compiling the utility. How would I go about removing the GUI parts from the code. I was able to compile it with MinGW by removing a small section of the code that calls for the Open dialog box (for selecting the save path). But if I double-click on fsbext.exe, it loads as if wanting to start the GUI but doesn't because of the code I removed.


Top
 Profile  
 
 Post subject: Re: fsbext password command line flag for encrypted FSB
PostPosted: 16 Feb 2011 13:47 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
the gui part is automatic (it's showed only with double-click) anyway if you want just to erase it completely it's enough that you replace GetForegroundWindow() with NULL or just remove that "mywnd = GetForegroundWindow()" line completely.


Top
 Profile  
 
 Post subject: Re: fsbext password command line flag for encrypted FSB
PostPosted: 19 Feb 2011 04:22 

Joined: 23 Oct 2010 00:29
Posts: 35
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);


Top
 Profile  
 
 Post subject: Re: fsbext password command line flag for encrypted FSB
PostPosted: 19 Feb 2011 13:05 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
yeah correct


Top
 Profile  
 
 Post subject: Re: fsbext password command line flag for encrypted FSB
PostPosted: 23 Feb 2011 20:48 

Joined: 23 Oct 2010 00:29
Posts: 35
Thank you for the help. I'll be looking forward to the new fsbext utility.


Top
 Profile  
 
 Post subject: Re: fsbext password command line flag for encrypted FSB
PostPosted: 24 Feb 2011 00:51 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
good, I'm working on it for adding the latest things (real-time decryption without the temporary file, other enhancement and a small fix) so I will release it tomorrow


Top
 Profile  
 
 Post subject: Re: fsbext password command line flag for encrypted FSB
PostPosted: 07 Mar 2011 19:29 

Joined: 23 Oct 2010 00:29
Posts: 35
Thank your for the latest update to fsbext. The decrypt-only option was a nice bonus.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: