brandonlw / Psychson

Phison 2251-03 (2303) Custom Firmware & Existing Firmware Patches (BadUSB)
MIT License
4.11k stars 1.28k forks source link

Hidden Partition error - body not accepted #50

Open ajja opened 10 years ago

ajja commented 10 years ago

Good afternoon,

Using a Toshiba 16GB pen drive with the controller information detailed below I'm trying to get the hidden partition demo to work. The method I used was as follows:

*Ensure boot mode is in effect

//#define FEATURE_CHANGE_PASSWORD

define FEATURE_EXPOSE_HIDDEN_PARTITION

define NUM_LBAS 0x1F005C56 //this needs to be even! (round down)

This is all I've changed in the base.c file. Do I need to switch LBA in elsewhere?

//Get the passed-in LBA lba = ((unsigned long)(scsi_cdb[2]) << 24) & 0xFF000000; lba |= ((unsigned long)(scsi_cdb[3]) << 16) & 0xFF0000; lba |= (scsi_cdb[4] << 8) & 0xFF00; lba |= scsi_cdb[5];

        //Shift it if necessary
        if (IsHiddenAreaVisible())
        {
            lba += NUM_LBAS / 2;
        }

        //Save it
        scsi_cdb[2] = (lba >> 24) & 0xFF;
        scsi_cdb[3] = (lba >> 16) & 0xFF;
        scsi_cdb[4] = (lba >> 8) & 0xFF;
        scsi_cdb[5] = lba & 0xFF;

        //Let the firmware do its thing <-- like this section ????

Using FW file 2303FW10110.Bin lifted from USB.dev.ru, changed filename to fw.bin I ran build.bat which produced a fw.bin output. When I tried flashing it to the drive I was presented with the following error:

C:\Users\ajones\Documents\Psychson-master\tools> DriveCom.exe /drive=E /action=SendFirmware /burner=BN03V104M.BIN /firmware=fw.bin Action specified: SendFirmware Gathering information... Reported chip type: 2302 Reported chip ID: 98-3A-A8-92-76-57 Reported firmware version: 1.01.10 Mode: Burner Rebooting... Sending firmware... FATAL: System.InvalidOperationException: Body not accepted at DriveCom.PhisonDevice.TransferFile(Byte[] data, Byte header, Byte body) in c:\Users\ajones\Documents\Psychson-master\DriveCom\DriveCom\PhisonDevice.cs:lin e 282 at DriveCom.Startup._RunFirmware(String fileName) in c:\Users\ajones\Document s\Psychson-master\DriveCom\DriveCom\Startup.cs:line 427 at DriveCom.Startup._SendFirmware() in c:\Users\ajones\Documents\Psychson-mas ter\DriveCom\DriveCom\Startup.cs:line 378 at DriveCom.Startup.Main(String[] args) in c:\Users\ajones\Documents\Psychson -master\DriveCom\DriveCom\Startup.cs:line 114

Any pointers massively appreciated.

Bonjour123 commented 8 years ago

Hello, I know it is a bit late, but I have some questions. Can you built the bin ? Because I have tons of errors when I launch build bat in patch. Thnaks in advance