Miscellaneous > Projects

IQ's neogeo Tools

<< < (17/17)

bankbank:
hi iq_132

is there any chance you could add kof98 to your p_dec tool? as well as add an option for re-encryption?

I want to do a romhack for kof98 and I need to be able to decrypt and re-encrypt the binary.

here is the decryption code, taken from https://raw.githubusercontent.com/ColumPaget/gngeo-cjp/master/src/neocrypt.c :


--- Code: ---/* Kof98 uses an early encryption, quite different from the others */
void kof98_decrypt_68k(running_machine *machine)
{
UINT8 *src = memory_region(machine, "maincpu");
UINT8 *dst = alloc_array_or_die(UINT8, 0x200000);
int i, j, k;
static const UINT32 sec[]={0x000000,0x100000,0x000004,0x100004,0x10000a,0x00000a,0x10000e,0x00000e};
static const UINT32 pos[]={0x000,0x004,0x00a,0x00e};

memcpy( dst, src, 0x200000);
for( i=0x800; i<0x100000; i+=0x200 )
{
for( j=0; j<0x100; j+=0x10 )
{
for( k=0; k<16; k+=2)
{
memcpy( &src[i+j+k],       &dst[ i+j+sec[k/2]+0x100 ], 2 );
memcpy( &src[i+j+k+0x100], &dst[ i+j+sec[k/2] ],       2 );
}
if( i >= 0x080000 && i < 0x0c0000)
{
for( k=0; k<4; k++ )
{
memcpy( &src[i+j+pos[k]],       &dst[i+j+pos[k]],       2 );
memcpy( &src[i+j+pos[k]+0x100], &dst[i+j+pos[k]+0x100], 2 );
}
}
else if( i >= 0x0c0000 )
{
for( k=0; k<4; k++ )
{
memcpy( &src[i+j+pos[k]],       &dst[i+j+pos[k]+0x100], 2 );
memcpy( &src[i+j+pos[k]+0x100], &dst[i+j+pos[k]],       2 );
}
}
}
memcpy( &src[i+0x000000], &dst[i+0x000000], 2 );
memcpy( &src[i+0x000002], &dst[i+0x100000], 2 );
memcpy( &src[i+0x000100], &dst[i+0x000100], 2 );
memcpy( &src[i+0x000102], &dst[i+0x100100], 2 );
}
memcpy( &src[0x100000], &src[0x200000], 0x400000 );

free(dst);
}
--- End code ---

thank you!

iq_132:
Here's a tool to encrypt and decrypt NeoGeo M1 roms, by request

Igor_Arabe:
Thx. I tested only with encrypted M1 roms. This tool don't decrypt kf2k3pcb's M1 properly.
The Old version(?) 'm1crypt' too.

source: 271-m1.m1, crc: d6bcf2bc
generated rom: 271-m1.m1-decrypted, crc: 189ab969

Navigation

[0] Message Index

[*] Previous page

Go to full version