Improved Windows support
This commit is contained in:
parent
201f783a4d
commit
fa1dce31f3
6 changed files with 127 additions and 63 deletions
|
@ -77,7 +77,7 @@ func (r *Result) finalize() ([]byte, []byte) {
|
|||
final.Label(asm.CALL_AT, "ExitProcess")
|
||||
}
|
||||
|
||||
code, data := final.Finalize()
|
||||
code, data := final.Finalize(windows.DLLs)
|
||||
return code, data
|
||||
}
|
||||
|
||||
|
@ -154,24 +154,7 @@ func write(writer io.Writer, code []byte, data []byte) error {
|
|||
case "mac":
|
||||
macho.Write(buffer, code, data)
|
||||
case "windows":
|
||||
dlls := []pe.DLL{
|
||||
{
|
||||
Name: "kernel32.dll",
|
||||
Functions: []string{
|
||||
"ExitProcess",
|
||||
"GetStdHandle",
|
||||
"WriteFile",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "user32.dll",
|
||||
Functions: []string{
|
||||
"MessageBoxA",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
pe.Write(buffer, code, data, dlls)
|
||||
pe.Write(buffer, code, data, windows.DLLs)
|
||||
default:
|
||||
return fmt.Errorf("unsupported platform '%s'", config.TargetOS)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue