I want to have an empty IAT when I compile go exe. I posted about this in the past https://www.reddit.com/r/golang/comments/1fz6raq/understanding_cgo_and_iat_with_dumpfileexe/
SolutionI noticed that all the imports in the IAT are because of a file in go runtime package called https://github.com/golang/go/blob/master/src/runtime/os_windows.go
So having ```//go:cgo_import_dynamic runtime._CloseHandle CloseHandle%1 "kernel32.dll"``` will result in the address of CloseHandle winapi being in the local variable _CloseHandle and resulting in CloseHandle appearing in the import table.
I was not able to understand what cgo_import_dynamic really does (nor find the code behind it).
After some research, I read that there is a technique to hide IAT by implementing two function
```
These are homemade and does not require any winapi call !!
I was able to implement them in go. In a standalone project they work and give the correct address of CloseHandle and all the other function.
This again work in a standalone project but I am having trouble integrating it in the toolchain.
In "runtime/os_windows.go" I deleted the cgo import of CloseHandle and replaced the declaration of _CloseHandle by
```
And this fails. The value of _CloseHandle is 0x0 and not the address like I tested in my standalone project.
After some investigation, the problem seems to come from the way I initialise _CloseHandle.
Debugging
In os_windows.go there is a function "func initHighResTimer()". I added some print for debugging:
```
When I compile a exe sample and run it I get:
```
Any help please ?
PS: I plan to deep dive more into the internal of go toolchain. Any resource or groups you recommend I join ?