Dragonegg stack variables reorderings

Hi Duncan,

I think this is probably due to stack variables being output lazily, i.e.
when first used. For example, if you declare variables A and B but use B
first then probably B will get output to the LLVM IR first.

I think you're right: I fixed my particular problem by initializing all stack
variables.

I guess I could arrange for them all to be output in one fell swoop at the
start of the function. Why do you need this?

I need this to make RIPE (https://github.com/johnwilander/RIPE) work. RIPE is
the "runtime intrusion prevention evaluator" and it is a program that performs
a lot of different attacks on itself. It relies on the order of stack
variables for its stack smashing attacks.

Regards,
Job

I need this to make RIPE (https://github.com/johnwilander/RIPE) work. RIPE is
the "runtime intrusion prevention evaluator" and it is a program that performs
a lot of different attacks on itself. It relies on the order of stack
variables for its stack smashing attacks.

Interesting, how much of other undefined / implementation-defined
behaviors it uses then? :slight_smile:

Hi Anton,

Interesting, how much of other undefined / implementation-defined
behaviors it uses then? :slight_smile:

A lot:-) For example, the offset between parameters and the return address, to
name one.

For variables, it relies on the order
1) on the stack;
2) in structs;
3) in the data segment;
4) in the bss segment.

1) is definately undefined, 2) is definately defined and I'm not sure about 3)
and 4).

Regards,
Job