int
__stdcall stdCallFunction(
int
a, std::string b)
{
printf(
"执行%s\n"
, b.c_str());
return
111
;
}
int
_cdecl cdeclFunction(
int
a, std::string b)
{
printf(
"执行%s\n"
, b.c_str());
return
222
;
}
int
__fastcall fastCallFunction(
int
a,
int
b, std::string c)
{
printf(
"执行%s,%d,%d\n"
, c.c_str(), a, b);
return
333
;
}
int
main() {
while
(
1
) {
auto f
=
GetProcAddress(LoadLibraryA(
"user32.dll"
),
"MessageBoxA"
);
/
/
x86RetSpoof::invokeStdcall<
int
>(std::uintptr_t(f),
0
,
"123"
,
"456"
,
0
);
std::string
str
=
"stdcall"
;
x86RetSpoof::invokeStdcall<
int
>(std::uintptr_t(stdCallFunction),
0
,
str
);
str
=
"cdelc"
;
x86RetSpoof::invokeCdecl<
int
>(std::uintptr_t(cdeclFunction),
0
,
str
);
str
=
"fastcall"
;
x86RetSpoof::invokeFastcall<
int
>(
555
,
666
,std::uintptr_t(fastCallFunction),
str
);
}
return
0
;
}