Jump to content
  • entries
    6
  • comments
    5
  • views
    24,032

pgm2yks


iq_132

1,228 views

So I got bored today and started looking at the pgm2yks.c

 

Here's a few lines from the file

0x000000, 0x00007c, 0x0000f8, 0x000174, 0x0001f0, 0x00026c, 0x0002e8, 0x000364,

0x0003e0, 0x00045c, 0x0004d8, 0x000554, 0x0005d0, 0x00064c, 0x0006c8, 0x000744,

0x0007c0, 0x00083c, 0x0008b8, 0x000934, 0x0009b0, 0x000a2c, 0x000aa8, 0x000b24,

0x000ba0, 0x000c1c, 0x000c98, 0x000d14, 0x000d90, 0x000e0c, 0x000e88, 0x000f04,

0x000f80, 0x000ffc, 0x001078, 0x0010f4, 0x001170, 0x0011ec, 0x001268, 0x0012e4,

 

Here's what I got with the algo below

0x000000, 0x00007c, 0x0000f8, 0x000174, 0x0001f0, 0x00026c, 0x0002e8, 0x000364,

0x0003e0, 0x00045c, 0x0004d8, 0x000554, 0x0005d0, 0x00064c, 0x0006c8, 0x000744,

0x0007c0, 0x00083c, 0x0008b8, 0x000934, 0x0009b0, 0x000a2c, 0x000aa8, 0x000b24,

0x000ba0, 0x000c1c, 0x000c98, 0x000d14, 0x000d90, 0x000e0c, 0x000e88, 0x000f04,

0x000f80, 0x0010fc, 0x001078, 0x0011f4, 0x001170, 0x0012ec, 0x001268, 0x0013e4,

 

 

It's not 100 percent, and it gets worse as you go through the file (0x3c00 values),

but there are some bits of the decrypted addresses that are correct throughout

pretty much the whole file, so I'm fairly certain that I'm on the right path. :)

 

unsigned int nret(unsigned int sprite_no)
{
unsigned int i, a  = 0x007c;

for (i = 0; i < 32; i++)
{
	if (sprite_no & (1 << i))
	{
		a ^= 0x84 << i;
	}
}

return a;
}

0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...