Create a golang dll that forwards a target PE's imports.
Uses ino to generate *.def files.
dlltool
from mingw converts them to *.exp files and it all gets passed
to the linker via go build's ldflags.
go build -buildmode=c-shared -o ${out} -ldflags="-extldflags=-Wl,${pwd}/fwd.exp"
package main
import "C"
func init() {
go func() {
// your code here
}()
}
func main() { /* still necessary for go dlls */ }
To proxy all functions from version.dll
that teams.exe
imports:
make amd64 hijack=version.dll from=path/to/teams.exe
make 386 hijack=version.dll from=path/to/teams.exe