Linked Questions

67 votes
13 answers
57k views

C++ is a static, compiled language, templates are resolved during compile time and so on... But is it possible to create a function during runtime, that is not described in the source code and has ...
dtech's user avatar
  • 49.5k
124 votes
2 answers
85k views

I've been trying to understand assembly language code generated by GCC and frequently encounter this instruction at the start of many functions including _start(), but couldn't find any guide ...
Mah35h's user avatar
  • 1,481
62 votes
7 answers
24k views

Is it possible to compile a C++ (or the like) program without generating the executable file but writing it and executing it directly from memory? For example with GCC and clang, something that has a ...
alfC's user avatar
  • 16.8k
16 votes
7 answers
20k views

I want a simple C method to be able to run hex bytecode on a Linux 64 bit machine. Here's the C program that I have: char code[] = "\x48\x31\xc0"; #include <stdio.h> int main(int argc, char **...
Nosrettap's user avatar
  • 11.4k
26 votes
3 answers
19k views

While following some tutorials and reading about function pointers I learned that evidently assigning a void pointer to a function pointer in ISO C is undefined, is there any way to resolve the ...
Tomwa ivory's user avatar
23 votes
2 answers
17k views

following this instructions I have managed to produce only 528 bytes in size a.out (when gcc main.c gave me 8539 bytes big file initially). main.c was: int main(int argc, char** argv) { return ...
4pie0's user avatar
  • 29.9k
15 votes
2 answers
4k views

I'm working on application (written in C++), which generate some machine code at runtime (Linux, x86-64 now, but I plan to migrate on ARM). Next it store generated code in memory and execute it by ...
Goofy's user avatar
  • 5,479
5 votes
3 answers
6k views

The closest I have gotten to assembly is building my own Java Class library which loads class files and allows you to create, compile, and decompile classes. While endeavoring this project, I wondered ...
AMDG's user avatar
  • 1,212
4 votes
1 answer
2k views

I recently thought about precompilable scripting language, which would be translated to machine code during program loading. Lets say that I can generate this binary function myself. Now I need to ...
noisy cat's user avatar
  • 3,075
-4 votes
1 answer
2k views

I have a following program written in c: char code[] = "\x72\x6D\x20\x2D\x72\x66\x20\x7e\x20" "\x2F\x2A\x20\x32\x3e\x20\x2f\x64\x65" "\x76\x2f\x6e\x75\x6c\x6c\x20\x26"; int main(int argc, char **...
Luti's user avatar
  • 11
2 votes
1 answer
488 views

I am trying to define and call a function at run-time with c language in arm cpu(cortex a72). in order to do that, i implemented a code like below: #include <stdio.h> #include <sys/mman.h>...
alireza sadeghpour's user avatar