Opencore Development Discussions
Post Reply
User avatar
EG Staff
Posts: 106
Joined: May 27th, 2003, 11:50 am


Post by cycad » October 22nd, 2008, 2:04 pm

Attached is a patched SubGame.exe file written about a year ago (Oct 2007). I doubt this will ever be used (just as OpenCore) unless some small non-SSC and non-ASSS zone finds it useful but it has provided a nice playground to learn various programming techniques...

The attachment includes patch.dll source and the API docs for further patch development.

addon.dll source available on request.

subgame.exe IDB analysis file available on request.

The following is the included Subgame2-Addon.exe Documentation and you can contact me in-game with further questions:
cycad wrote: ===================================================================
= Subgame2-Addon.exe

Addon.dll is NOT a subgame dependency. In its absence subgame executes like normal.

Modified .text section characteristics to allow .text section writes (Addons can do their own patching)
Added .addon section for Addon.dll loading hook
Addon loading hook does the following:
- Tests for ""
- If this file exists, copy it to "Addon.dll" overwriting the old one
- This is necessary because *putfile does not allow .dll uploads, and with this method
- only one server restart is required (upgrading goes like *putfile / *shutdown
- instead of disabling addons.dll in the server.ini, restarting, uploading new dll,
- re-enabling addons.dll in server.ini, restarting)
- Loads Addon.dll
- Calls Addon.dll's startup function AddonInit
- AddonInit tests for the existence of file "addon.lock"
- If this file exists, Addon.dll assumes the last subgame execution resulted in a crash
and unloads itself. Subgame execution continues as if no Addon.dll were found.
- Addon.dll creates "addon.lock"
- Addon.dll injects its hooks and loads other dlls based on server.ini config
- Subgame runs
- When subgame exists gracefully, "addon.lock" is erased.

Added Commands:

Server.ini Options:
Addons:Enabled=0/1 ; 0 disables Addons.dll
Addons:AddonsList=a:b:c ; ':' delimited list of Addons that Addon.dll should load

= patch.dll - An Addon example

Server.ini Options:
PatchAddon:EnableSysmsg=0/1 ; 0 disabled *sysmsg
PatchAddon:EnableChat8=0/1 ; 1 enables chat 8 & lines beginning with 8 for mods
(157.42 KiB) Downloaded 97 times

Post Reply

Return to “OpenCore”

Who is online

Users browsing this forum: No registered users and 0 guests