Go Back   Guitar Hero Forum > Guitar Hero Series > Guitar Hero III

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 12-18-2009, 03:18 PM
Junior Member
 
Join Date: Dec 2009
Posts: 1
Default HELP WITH GHIII FSB Decryptor

hi

i have an source code to compile a GHIII FSB Decryptor to extract songs from FSB files of guitar hero 3

but i dont know compile this

please, someone help me with this, im release the code to someone compile this or help me to compie:

Code:
#include "windows.h"
#include "stdio.h"
#include "sys\stat.h"

#define KEY_LEN 11

char SwapByteBits(unsigned char cInput)
{
   unsigned char nResult=0;

   for(int i=0; i<8; i++)
   {
      nResult = nResult << 1;
      nResult |= (cInput & 1);
      cInput = cInput >> 1;
   }

   return (nResult);
}

int main(int argc, char* argv[])
{
   int nError = 0;
   struct _stat32 fileStat;
   unsigned int nBufferSize = 0;
   FILE* inFile = NULL;
   FILE* outFile = NULL;
   unsigned char* pBuffer;
   unsigned char* pInput;
   unsigned int nLoopIdx = 0;
   unsigned char cpKey[KEY_LEN] = "5atu6w4zaw";

   printf ("GHIII FSB Decryptor v1.0 by Invo\n");
   printf ("--------------------------------\n");
   printf ("\n");

   // Check params
   if (argc != 3)
   {
      printf ("Usage: %s <Input> <Output>\n", argv[0]);
      return (1);
   }

   // Get the file size
   nError = _stat32(argv[1], &fileStat);
   if (nError != 0)
   {
      printf ("Failed to get the input file size!\n");
      return (1);
   }

   nBufferSize = fileStat.st_size;

   // Allocate buffer
   pBuffer = (unsigned char*)malloc(nBufferSize);
   if (pBuffer == NULL)
   {
      printf ("Failed to allocate input buffer!\n");
      return (1);
   }

   // Open and read the input
   inFile = fopen(argv[1], "rb");
   if (inFile == NULL)
   {
      printf ("Failed to open the input file!\n");
      return (1);
   }
   printf ("Reading file (%d Bytes)... ", nBufferSize);
   fread(pBuffer, 1, nBufferSize, inFile);
   fclose(inFile);
   printf ("Done!\n");

   // Decrypt
   printf ("Decrypting... ");
   pInput = pBuffer;
   for (int nLoopIdx=0; nLoopIdx<nBufferSize; nLoopIdx++)
   {
      *pInput = SwapByteBits(*pInput ^ cpKey[nLoopIdx % (KEY_LEN-1)]);

      pInput++;
   }
   printf ("Done!\n");

   // Open and write the output
   outFile = fopen(argv[2], "wb");
   if (outFile == NULL)
   {
      printf ("Failed to open the output file!\n");
      return (1);
   }
   printf ("Writing file... ");
   fwrite(pBuffer, 1, nBufferSize, outFile);
   fclose (outFile);
   printf ("Done!\n");

   // The end...
   return (0);
}
Reply With Quote
Sponsored Links

  #2 (permalink)  
Old 01-05-2010, 05:50 AM
Junior Member
 
Join Date: Jan 2010
Posts: 1
Default

I would also like to know how to compile this.
Reply With Quote
Reply

Bookmarks

Tags
decrypt, extractor, gh3, ghiii, songs

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:56 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0