Mail Archives: djgpp/2000/08/16/09:00:20
"Rafał Maj" <r_maj AT poczta DOT onet DOT pl> wrote:
> My small program is making a copy of code of some function. Program works
> fine, until my function is trying to call
> library functions.
_Copy_ the code of a function? Why on earth would you want to do that?
If that works, and be it only partly, it's by coincidence rather than
by design. Even *reading* the actual code of some function isn't
necessarily supported. Even less can you expect to be able to execute
a mere char-array, like this.
In a nutshell: function code isn't directly readable, and data isn't
executable, in protected mode. Not in the way you do it, at least.
You need some assembly, and you have to be extremely careful doing it.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -