Skip to content

Commit

Permalink
Fix spare overdump, and rename drb -> __bbc_direct_readblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
emoose committed Mar 8, 2018
1 parent 3f1a3be commit 47be255
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions iQueDiagExtend/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int CmdDumpNandRaw()
int* diag_handle = (int*)0x40E198;
int* handlesBase = (int*)0x4326C0;
const auto __BBC_CheckHandle = (int(*)(int handle))(0x403A20);
const auto drb = (int(*)(int vtable, int blk, int count, unsigned char *buffer, unsigned char *spare))(0x40AD80);
const auto __bbc_direct_readblocks = (int(*)(int vtable, int blk, int count, unsigned char *buffer, unsigned char *spare))(0x40AD80);

int res = __BBC_CheckHandle(*diag_handle);
if (res)
Expand All @@ -29,12 +29,12 @@ int CmdDumpNandRaw()
FILE *f = fopen("nand.bin", "wb");
FILE *f2 = fopen("spare.bin", "wb");
unsigned char buff[0x4000];
unsigned char spare[0x100];
unsigned char spare[0x10];
for (int i = 0; i < 0x1000; i++)
{
drb((int)direct_ptrs[0], i, 1, buff, spare);
__bbc_direct_readblocks((int)direct_ptrs[0], i, 1, buff, spare);
fwrite(buff, 1, 0x4000, f);
fwrite(spare, 1, 0x100, f2);
fwrite(spare, 1, 0x10, f2);

fflush(f);
fflush(f2);
Expand Down

0 comments on commit 47be255

Please sign in to comment.