2

I am developing a program which, through the use of ReadProcessMemory and WriteProcessMemory from the kernel32 API, modifies another win32 program at runtime.

WPF-based editor.exe accesses target.exe

I would also like to support those who run target.exe on *nix platforms through the use of wine, but I cannot simply run editor.exe in wine -- the GUI is implemented in WPF, which wine does not support.

Rather than reimplement the GUI in WinForms or MFC (which are supported by wine), I would like to produce a native GUI for *nix, using QT or GTK for Linux, and Cocoa for Mac.

GTK-based editor.so accesses target.exe running in wine

My question is about winelib, which seems intended to help port win32 programs to *nix. Using winelib, a program is compiled as a *nix executable, but has access to the win32 API, and continues to depend on a wine environment to provide system resources such as a registry.

According to the WineHQ introduction page, programs compiled with winelib also have access to *nix APIs, and this in-depth wiki page discusses using native APIs rather than wine-based ones. In a way, programs compiled with winelib have one foot in win32, and one foot in *nix.

Is it possible for a program to use winelib while only rendering a *nix gui, with no window or console rendered by wine? I really only need access to the ReadProcessMemory, WriteProcessMemory, and some Toolhelp32Snapshot functions (for locating the target.exe process). I believe all of these reside in kernel32.dll.

Chad Zawistowski
  • 1,876
  • 1
  • 13
  • 16
  • Nice graphics. I'd think that since Win32 PE executables can run without a UI, that a winelib one should be able to as well. – Ben Voigt Nov 07 '13 at 23:08
  • Looking at the `winemaker` documentation, it looks as if it should be as simple as not passing `--console`. – Ben Voigt Nov 07 '13 at 23:10
  • Looking again, the "Calling a Windows DLL from Linux" section of my own link seems very helpful. I ought to be able to pull this off, but the overarching *nix executable must be invoked by wine. – Chad Zawistowski Nov 08 '13 at 01:03
  • Ah, I can "make a winelib application which will require wine to run but can access Linux libraries as well", but there are restrictions such as "you have to use Windows synchronization primitives instead of the pthreads ones". – Chad Zawistowski Nov 08 '13 at 01:11
  • What about making a third application between them, running in wine and doing the manipulations, which would be commanded via, say, sockets by your *nix app? – Medinoc Nov 08 '13 at 13:17

0 Answers0