jchv / go-winloader Goto Github PK
View Code? Open in Web Editor NEW[WIP] Implementation of the Windows module loader in pure Go, with no CGo.
License: ISC License
[WIP] Implementation of the Windows module loader in pure Go, with no CGo.
License: ISC License
see here:
gioui-plugins/gio-plugins#59
Hi there! Firstly, awesome job on the project!
Was wondering if you had any intentions in supporting UPX compressed DLLs as there's currently an interesting trade off between shipping a compressed DLL with your application or embedding a non-compressed version that's usually 2x the size. It currently crashes with the following stack trace:
C:\Users\leaan\Documents\GitHub\go-winloader\cmd\demo>demo.exe tiny2.dll
Exception 0xc0000005 0x8 0x27e734414d0 0x27e734414d0
PC=0x27e734414d0
syscall.Syscall(0x27e73461310, 0x3, 0x27e73440000, 0x1, 0x0, 0x0, 0x0, 0x0)
C:/Program Files/Go/src/runtime/syscall_windows.go:330 +0xe9
github.com/jchv/go-winloader/internal/winloader.Proc.Call(0x27e73461310, 0xc00012e330, 0x3, 0x3, 0x18, 0x8a69a0,
0x27e73461301, 0xc00012e330)
C:/Users/leaan/Documents/GitHub/go-winloader/internal/winloader/loader_windows.go:24 +0x22f
github.com/jchv/go-winloader/internal/memloader.(*Loader).LoadMem(0xc000162390, 0xc000168000, 0xbbea, 0xbbeb, 0x
bbeb, 0x0, 0x0, 0xc000106000)
C:/Users/leaan/Documents/GitHub/go-winloader/internal/memloader/loader.go:239 +0xa88
github.com/jchv/go-winloader.LoadFromMemory(...)
C:/Users/leaan/Documents/GitHub/go-winloader/loader_windows.go:25
main.main()
C:/Users/leaan/Documents/GitHub/go-winloader/cmd/demo/main.go:18 +0x167
rax 0x27e734414d0
rbx 0x1000
rcx 0x27e73440000
rdi 0x27e73440000
rsi 0x27e7344a038
rbp 0x7ff99295bc70
rsp 0x7f359ffd48
r8 0x0
r9 0x4
r10 0x0
r11 0x246
r12 0x1
r13 0x1
r14 0x23
r15 0xffffffffffffffff
rip 0x27e734414d0
rflags 0x10206
cs 0x33
fs 0x53
gs 0x2b
Is it possible to link multiple DLLs loaded into memory? The a.dll library uses a function from b.dll. Having packed a.dll into .go constant, we can load it from memory, but this makes no sense if it is not loaded without finding b.dll
Hi) Are there any differences when using memory loading from a system function in terms of threads using and resource allocation? Faced the fact that in a number of experiments with cef (chromium embedded framework), launching three functions when linking in LDFLAGS and windows.NewLazyDll opens a new webview and loads url there. When using winloader.LoadFromMemory I get no errors, windows open, it opens a webview with a blank page (also works context-menu), but no URL opens. I've been investigating this issue for a week now, but I can't find any clear indication of the cause of this behavior.
// #cgo LDFLAGS: -L. -llibcef
/* C.cef_initialize(&settings.MainArgs, cefSettings, &settings.AppHandler, C.NULL) */
// winloader.LoadFromMemory(b)
/* cefInitialize.Call(
uint64(uintptr(unsafe.Pointer(&settings.MainArgs))),
uint64(uintptr(unsafe.Pointer(cefSettings))),
uint64(uintptr(unsafe.Pointer(&settings.AppHandler))),
uint64(uintptr(unsafe.Pointer(C.NULL))),
) */
// windows.NewLazyDLL("libcef.dll")
cefInitialize.Call(
uintptr(unsafe.Pointer(&settings.MainArgs)),
uintptr(unsafe.Pointer(cefSettings)),
uintptr(unsafe.Pointer(&settings.AppHandler)),
uintptr(unsafe.Pointer(C.NULL)),
)
I am not asking for help with cef, but maybe there are some subtleties that I do not know about and which could give me an idea of how to solve this problem. Unlike EDGE, the CEF library requires a lot of dlls in its directory and I am impressed by the idea of embedding them as resources in my application.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.