Answer the question
In order to leave comments, you need to log in
Hide the address of the called function. C/C++?
Hello! There is a task - to hide the address of the function in the program, so that during static analysis the "intruder" could not find the place where this function was called.
With variables (global) I did this:
char gStr[] = "Hello Toster!"; // Глобальная переменная
void foo(int a)
{
char *str = gStr + 10;
...
puts(str-a); // параметр a - всегда равен 10
}
void foo2(int a)
{
void (*fptr)(int) = (void(*)(int)) &((int*)f)[3]; // сложная конструкция :(((
// void (*fptr)(int) = (void(*)(int)) (f+3); // пробовал и так
...
}
Answer the question
In order to leave comments, you need to log in
I found a solution: make the pointer a global variable . And not local, as we had before.
And, then in function foo2 :
void foo2(int a)
{
void (*fptr)(int) = gFunPtr;
...
}
mov eax,[000403024]
...
the compiler stubbornly refuses to evaluate the expression &((int*)f)[3] when compiling
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question