Amiga-C (129/223)

From:Jesper Svennevid
Date:16 Aug 2001 at 17:27:59
Subject:RE: [amiga-c] Leeking, Deeking and Peeking

> If I had the following
>
> mem = AllocMem(2000, MEMF_CLEAR | MEMF_PUBLIC);
> lock = Open("Ram:test", MODE_OLDFILE);
> Read(lock, mem, 2000);
>
>
> How do i read mem+20 as LONG, WORD and BYTE ??
>
> ie: num = Leek(mem + 20) etc

BYTE* mem_byte = mem;
WORD* mem_word = mem;
LONG* mem_long = mem;

mem_byte[20] will be mem+20
mem_word[10] will be mem+20, as words are 2 bytes in size
mem_long[5] will be mem+20, as longs are 4 bytes in size



// Jesper Svennevid : jesper@svennevid.net

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Do you need to encrypt all your online transactions? Secure corporate intranets? Authenticate your Web sites? Whatever
security your site needs, you'll find the perfect solution here!
http://us.click.yahoo.com/Bre3tC/Q56CAA/yigFAA/dpFolB/TM
---------------------------------------------------------------------~->

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/