Skip to content

SirusDoma/O2Net32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

O2Net32

A drop-in replacement for O2Net32.dll.
Rewritten from scratch in modern C# and compiled to a native Windows DLL via .NET 10 Native AOT.

The replacement preserves the exact same export table and on-the-wire framing as the original DLL, but relies on System.Net.Sockets.Socket rather than raw Winsock overlapped I/O.

Exports

The rebuilt O2Net32.dll exports four symbols by ordinal, matching the original:

Ordinal Signature
1 void O2Net_ShutDown()
2 int O2Net_StartUp(HWND hwnd, const char* host, uint16_t port, void (*cb)(uint32_t code, void* arg))
3 int Recv(uint8_t* outBuf, uint32_t* outLen)
4 int Send(const uint8_t* data, uint32_t len)

Callback code values:

Code Meaning arg
1 Connected hwnd from StartUp
2 Packet received hwnd. Drain with Recv until it returns 0
3 Fatal Winsock error WSAError cast to void* (do not dereference)
5 Disconnected hwnd

Protocol framing: little-endian uint16 length prefix inclusive of the header ([lo][hi][payload...]). Same as the original.

Build

dotnet publish Source\O2Net32\O2Net32.csproj -c Release -r win-x86

Output: Build\Publish\O2Net32.dll (x86).

Warning

Plain dotnet build will generate .NET binary which is incompatible with any O2Jam executables.

About

A drop-in replacement for O2Net32.dll

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages