How to create "empty" space in an executable file at a specific address (gcc, linux)?

What I essentially want to do is write another program to this "empty space" so that the executable "works" on

I thought about adding a signature to the application, and then wrote down the data, looking for it later, but this is not entirely correct ...

Now, another important thing ... I know that it should be possible to create a cave of code using code like:

void function(void) {
__asm {
nop
nop
nop
nop
};
}

then even this is practically the same thing (except that it will be in the .data section, so it’s not feasible):

const char data[3];

The problem is that the other application will not have a specific address for writing.

+3
source share
3

, PE ELF , .

, , , . , N , , seek , .

, . , , , , .

+7

ld- script, , . . , , :

.section .myresource
.align 4
.globl myres
myres:
.fill 1048576

C- , :

extern const int* myres;

binutils: http://sourceware.org/binutils/docs-2.19/

+3

, , .

, _ = script.

0

Source: https://habr.com/ru/post/1719027/


All Articles