Implemented loading of multiple DLLs

This commit is contained in:
Eduard Urbach 2024-08-17 15:34:42 +02:00
parent 58a157c864
commit 3eba9fb526
Signed by: eduard
GPG key ID: 49226B848C78F6C8
4 changed files with 57 additions and 57 deletions

View file

@ -154,7 +154,24 @@ func write(writer io.Writer, code []byte, data []byte) error {
case "mac":
macho.Write(buffer, code, data)
case "windows":
pe.Write(buffer, code, data)
dlls := []pe.DLL{
{
Name: "kernel32.dll",
Functions: []string{
"ExitProcess",
"GetStdHandle",
"WriteFile",
},
},
{
Name: "user32.dll",
Functions: []string{
"MessageBoxA",
},
},
}
pe.Write(buffer, code, data, dlls)
default:
return fmt.Errorf("unsupported platform '%s'", config.TargetOS)
}