I am a beginner in red team development.Trying to implement hellsgate in C++. Simply put, in this program, the C program directly calls the function from the asm file.
The function in asm file:
HellDescent PROC
mov r10, rcx
mov eax, wSystemCall
syscall
ret
HellDescent ENDP
The function in C:
//define
extern HellDescent();
//call
HellDescent(-1,...);
In C++, this gives the error: “Too many arguments to function.”After referring to the material, I found the way of Fold expressions. When I used the method in the demo to create the function.
template <class... Args>
extern "C" int HellDescent(Args&&... args){}
Visual Studio prompted me: “linkage-specification-is-not-allowed."
I tried to search for information to solve but no results. Can anyone tell how to fix it.