The MASM Forum

General => The Campus => Topic started by: acake on December 07, 2019, 03:13:46 AM

Title: Structure and Stack
Post by: acake on December 07, 2019, 03:13:46 AM
Disclaimer (because disclaimers are cool): I know that everything related to shellcode is forbidden here but let me explain you why I'm currently asking that question.

I personally realize that those kind of program obligate me to think in a really low level point of view and I personally like that because I realize that there's many things I don't know about memory etc...

Now let's ask my "illegal" question.

Let's take an example of well known structure, PROCESSENTRY32, the size of this structure is 296 bytes.

I was just wondering how structures works in a low level point of view ?
If I want to use one, (in a purely illegal program for sure), should I just allocate 296 random bytes or it is more complex ?

I'm sure that it isn't just 296 random bytes because how the program will detect the fields in the structure and know their size ?
Or maybe those fields are just independent variables and I've been in an illusion during all my life ?

So how does structures works in a low level point of view ?

Thanks.
Title: Re: Structure and Stack
Post by: hutch-- on December 07, 2019, 03:27:37 AM
> So how does structures works in a low level point of view ?

The same as it works in any other level, an address in memory (the start address) and a sequence of offsets from that start address for data defined by the structure. Be careful with the questions related to shell code or any other related field, not only do we shoot first and ask questions later but we kick out people who ask them.