jet / damon

Supervisor program to constrain Windows executables running under Nomad's raw_exec driver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsafe DLL Loading

zx2c4 opened this issue · comments

You're using syscall, but you should be using x/sys/windows's lazy DLL struct instead:

kernel32DLL = syscall.NewLazyDLL("kernel32.dll")
advapi32DLL = syscall.NewLazyDLL("advapi32.dll")
userenvDLL = syscall.NewLazyDLL("userenv.dll")
psapiDLL = syscall.NewLazyDLL("psapi.dll")
iphlpapiDLL = syscall.NewLazyDLL("iphlpapi.dll")

iphlpapi.dll and userenv.dll are not part of \KnownDlls.

Your blog post indicates you know about the right way to do it but for some reason didn't.

Thanks for the find @zx2c4. Do you have time to make the PR to fix it?

I have no idea what this project does or is used for, but I thought you had an interesting Windows library so I was poking around with it. You're probably a better person to fix this than me.

Sure, just wanted to give you first dibs on fixing it if you were interested. Thank you anyway for reporting, I'll take care of it.

Neat, I'll take a look at this too. Thanks for the tip!