Difference between revisions of "Wintermute/Externals"

From ScummVM :: Wiki
Jump to navigation Jump to search
Line 8: Line 8:


== James Peris (Demo 2012) ==
== James Peris (Demo 2012) ==
=== getURLContent ===
=== geturl.dll ===
==== getURLContent ====
Used to download news headlines at Demo 2012 of James Peris
Used to download news headlines at Demo 2012 of James Peris


Line 20: Line 21:


== Various games by HeroCraft ==
== Various games by HeroCraft ==
=== SetValueToReg ===
=== tools.dll ===
==== SetValueToReg ====
Used to switch game's windowed/fullscreen mode at games by HeroCraft
Used to switch game's windowed/fullscreen mode at games by HeroCraft


Line 27: Line 29:
Known usage: SetValueToReg("Software\HeroCraft\<GameID>\Video", "Windowed", 1)
Known usage: SetValueToReg("Software\HeroCraft\<GameID>\Video", "Windowed", 1)


=== changeWindowCaption ===
=== img.dll ===
==== changeWindowCaption ====
Used to change game's window caption at games by HeroCraft
Used to change game's window caption at games by HeroCraft


Line 34: Line 37:
Known usage: changeWindowCaption(Game.Hwnd, <Title>)
Known usage: changeWindowCaption(Game.Hwnd, <Title>)


=== maximizedWindow ===
==== maximizedWindow ====
Used to change game's window size at games by HeroCraft
Used to change game's window size at games by HeroCraft


Line 42: Line 45:


== Wilma Tetris ==
== Wilma Tetris ==
=== ShellExecuteA ===
=== shell32.dll ===
==== ShellExecuteA ====
Used to open URL in browser at Wilma Tetris
Used to open URL in browser at Wilma Tetris


Line 54: Line 58:
Those games are out of ScummVM scope and are not supported by ResidualVM yet. However, their external function calls are mocked or implemented.
Those games are out of ScummVM scope and are not supported by ResidualVM yet. However, their external function calls are mocked or implemented.
== Art of Murder: FBI Confidential ==
== Art of Murder: FBI Confidential ==
=== _InstallUtilAnsi@0 ===
=== installutil.dll ===
==== _InstallUtilAnsi@0 ====
Used to check if DVD is inserted at Art of Murder: FBI Confidential
Used to check if DVD is inserted at Art of Murder: FBI Confidential


Line 64: Line 69:


== Various games by Corbomite Games ===
== Various games by Corbomite Games ===
=== IRC_init ===
=== dlltest.dll ===
==== IRC_init ====
Used to connect to debug IRC server at games by Corbomite Games
Used to connect to debug IRC server at games by Corbomite Games


Line 83: Line 89:
Returns 0 on success, other value on error
Returns 0 on success, other value on error


=== ChangeNick ===
==== ChangeNick ====
Used to update nick at debug IRC server at games by Corbomite Games
Used to update nick at debug IRC server at games by Corbomite Games


Line 92: Line 98:
Return value is never used
Return value is never used


=== IRC_SendString ===
==== IRC_SendString ====
Used to send debug and chat lines to an IRC server at games by Corbomite Games
Used to send debug and chat lines to an IRC server at games by Corbomite Games


Line 101: Line 107:
Known Channel values are: "#Zbeng" and "#ZbengDebug"
Known Channel values are: "#Zbeng" and "#ZbengDebug"


=== IRC_GetChatStrings ===
==== IRC_GetChatStrings ====
Used to get chat lines from an IRC server at games by Corbomite Games
Used to get chat lines from an IRC server at games by Corbomite Games


Line 108: Line 114:
Known usage: IRC_GetChatStrings(<Buffer>, 65535)
Known usage: IRC_GetChatStrings(<Buffer>, 65535)


=== IRC_quit ===
==== IRC_quit ====
Used to disconnect from debug IRC server at games by Corbomite Games
Used to disconnect from debug IRC server at games by Corbomite Games


Line 115: Line 121:
Known usage: IRC_quit()
Known usage: IRC_quit()


=== LoadLibraryA ===
=== kernel32.dll ===
==== LoadLibraryA ====
Used for checking library availability at games by Corbomite Games
Used for checking library availability at games by Corbomite Games


Line 124: Line 131:
Return values are only compared with zero and are never used in other APIs
Return values are only compared with zero and are never used in other APIs


=== FreeLibrary ===
==== FreeLibrary ====
Declared at games by Corbomite Games
Declared at games by Corbomite Games


Line 131: Line 138:
Specification: external "kernel32.dll" stdcall FreeLibrary(long)
Specification: external "kernel32.dll" stdcall FreeLibrary(long)


=== GetEnvironmentVariableA ===
==== GetEnvironmentVariableA ====
Used for getting environment variables at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Used for getting environment variables at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest


Line 142: Line 149:
Known EnvName values used in licensing code: "FULLGAME"
Known EnvName values used in licensing code: "FULLGAME"


=== Register ===
=== httpconnect ===
==== Register ====
Used to register license key online at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Used to register license key online at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest


Line 179: Line 187:
For some reason always returns -7 for me in a test game
For some reason always returns -7 for me in a test game


=== Validate ===
==== Validate ====
Used to validate something at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Used to validate something at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest


Line 192: Line 200:
For some reason always returns 1 for me in a test game
For some reason always returns 1 for me in a test game


=== SendHTTPAsync ===
==== SendHTTPAsync ====
Used to send game progress events to server at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Used to send game progress events to server at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest


Line 207: Line 215:
Return value is never used
Return value is never used


=== SendRecvHTTP (6 params variant) ===
==== SendRecvHTTP (6 params variant) ====
Declared at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Declared at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest


Line 216: Line 224:
Always returns -7 for me in a test game, probably returns the same network errors as Register()
Always returns -7 for me in a test game, probably returns the same network errors as Register()


=== SendRecvHTTP (4 params variant) ===
==== SendRecvHTTP (4 params variant) ====
Used to call HTTP methods at Zbang! The Game
Used to call HTTP methods at Zbang! The Game



Revision as of 21:10, 4 May 2020

This page lists known external functions for most Wintermute games.

Original WME 1.x allows game scripts to call external functions from DLL libraries. This way game creator can either call Win32 API functions or use custom extension DLL libraries.

ScummVM's WME contain mocks and reimplementations for functions listed below, emulating import those functions from a given DLL.

2D games

James Peris (Demo 2012)

geturl.dll

getURLContent

Used to download news headlines at Demo 2012 of James Peris

HTTP GET result is stored in 3rd param of the call as a plain string

Specification: external "geturl.dll" cdecl getURLContent(string, string, string)

Known usage: getURLContent("http://www.lacosaweb.com", <DirURL>, <Buffer>)

Sets 3rd param to "Request Error." on error

Various games by HeroCraft

tools.dll

SetValueToReg

Used to switch game's windowed/fullscreen mode at games by HeroCraft

Specification: external "tools.dll" cdecl SetValueToReg(string, string, long)

Known usage: SetValueToReg("Software\HeroCraft\<GameID>\Video", "Windowed", 1)

img.dll

changeWindowCaption

Used to change game's window caption at games by HeroCraft

Specification: external "img.dll" cdecl changeWindowCaption(long, string)

Known usage: changeWindowCaption(Game.Hwnd, <Title>)

maximizedWindow

Used to change game's window size at games by HeroCraft

Specification: external "img.dll" cdecl maximizedWindow(long, long, long)

Known usage: maximizedWindow(Game.Hwnd, 1024, 768)

Wilma Tetris

shell32.dll

ShellExecuteA

Used to open URL in browser at Wilma Tetris

Specification: external "shell32.dll" stdcall long ShellExecuteA(long, string, string, string, string, long)

Known usage: ShellExecuteA(0, "open", <URL>, "", "", 3)

Returns value >32 on success

2.5D games

Those games are out of ScummVM scope and are not supported by ResidualVM yet. However, their external function calls are mocked or implemented.

Art of Murder: FBI Confidential

installutil.dll

_InstallUtilAnsi@0

Used to check if DVD is inserted at Art of Murder: FBI Confidential

Specification: external "installutil.dll" stdcall long _InstallUtilAnsi@0()

Known usage: _InstallUtilAnsi@0()

Returns 1 on success, other value on fail (which leads to Game.QuitGame() in non-Debug mode)

Various games by Corbomite Games =

dlltest.dll

IRC_init

Used to connect to debug IRC server at games by Corbomite Games

Specification: external "dlltest.dll" cdecl long IRC_init(string)

Known usage: IRC_init(<PlayerName>)

Known actions:

1. Connect to irc.starchat.net

2. Send "NICK ZU_<PlayerName>/"

3. Send "USER Blah ZbengHost ZbengServer ZbengRealname"

4. Send "Join #Zbeng"

Returns 0 on success, other value on error

ChangeNick

Used to update nick at debug IRC server at games by Corbomite Games

Specification: external "dlltest.dll" cdecl long ChangeNick(string)

Known usage: ChangeNick(<PlayerName>)

Return value is never used

IRC_SendString

Used to send debug and chat lines to an IRC server at games by Corbomite Games

Specification: external "dlltest.dll" cdecl IRC_SendString(string, string)

Known usage: IRC_SendString(<Message>, <Channel>)

Known Channel values are: "#Zbeng" and "#ZbengDebug"

IRC_GetChatStrings

Used to get chat lines from an IRC server at games by Corbomite Games

Specification: external "dlltest.dll" cdecl IRC_GetChatStrings(string, long)

Known usage: IRC_GetChatStrings(<Buffer>, 65535)

IRC_quit

Used to disconnect from debug IRC server at games by Corbomite Games

Specification: external "dlltest.dll" cdecl IRC_quit()

Known usage: IRC_quit()

kernel32.dll

LoadLibraryA

Used for checking library availability at games by Corbomite Games

Specification: external "kernel32.dll" stdcall long LoadLibraryA(string)

Known usage: LoadLibraryA("httpconnect.dll"), LoadLibraryA("dlltest.dll")

Return values are only compared with zero and are never used in other APIs

FreeLibrary

Declared at games by Corbomite Games

Seems to be unused, probably was used for unloading IRC & HTTP libraries

Specification: external "kernel32.dll" stdcall FreeLibrary(long)

GetEnvironmentVariableA

Used for getting environment variables at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest

Specification: external "kernel32.dll" stdcall long GetEnvironmentVariableA(string, string, long)

Known usage: GetEnvironmentVariableA(<EnvName>, <buffer>, 65535)

Known EnvName values used in debug code: "USERKEY", "ALTUSERNAME", "ENHFINGERPRINT", "EXTRAINFO", "FINGERPRINT", "KEYSTRING", "STOLENKEY", "TRIAL"

Known EnvName values used in licensing code: "FULLGAME"

httpconnect

Register

Used to register license key online at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest

Specification: external "httpconnect.dll" cdecl long Register(string, long, string, long)

Known usage: Register(<productId>, 65535, <productKey>, 65535)

Known product ID values are: "357868", "353058" and "353006"

Known action: HTTP GET http://keygen.corbomitegames.com/keygen/validateKey.php?action=REGISTER&productId=productId&key=productKey

Returns 1 on success

Returns 0 on firewall error

Returns -1 on invalid product key

Returns -2 on invalid product ID

Returns -3 on expired product key

Returns -4 on invalid machine ID

Returns -5 on number of installations exceeded

Returns -6 on socket error

Returns -7 on no internet connection

Returns -8 on connection reset

Returns -11 on validation temporary unavaliable

Returns -12 on validation error

For some reason always returns -7 for me in a test game

Validate

Used to validate something at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest

Specification: external "httpconnect.dll" cdecl long Validate()

Known usage: Validate()

Known action: HTTP GET http://keygen.corbomitegames.com/keygen/validateKey.php?action=VALIDATE&productId=Ar&key=Ar

Used only when Debug mode is active or game is started with "INVALID" cmdline parameter

For some reason always returns 1 for me in a test game

SendHTTPAsync

Used to send game progress events to server at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest

Specification: external "httpconnect.dll" cdecl long SendHTTPAsync(string, long, string, long, string, long)

Known usage: SendHTTPAsync("backend.pizzamorgana.com", 65535, <FullURL>, 65535, <Buffer?!>, 65535)

FullURL is formed as "http://backend.pizzamorgana.com/event.php?Event=<EventName>&player=<PlayerName>&extraParams=<ExtraParams>&SN=<ProductKey>&Episode=1&GameTime=<CurrentTime>&UniqueID=<UniqueId>"

Known EventName values are: "GameStart", "ChangeGoal", "EndGame" and "QuitGame"

Known ExtraParams values are: "ACT0", "ACT1", "ACT2", "ACT3", "ACT4", "Ep0FindFood", "Ep0FindCellMenu", "Ep0BroRoom", "Ep0FindKey", "Ep0FindCellMenuKey", "Ep0FindMenuKey", "Ep0FindCell", "Ep0FindMenu", "Ep0OrderPizza", "Ep0GetRidOfVamp", "Ep0GetVampAttention", "Ep0License"

Return value is never used

SendRecvHTTP (6 params variant)

Declared at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest

Seems to be unused, probably SendRecvHTTP was initially used instead of SendHTTPAsync

Specification: external "httpconnect.dll" cdecl long SendRecvHTTP(string, long, string, long, string, long)

Always returns -7 for me in a test game, probably returns the same network errors as Register()

SendRecvHTTP (4 params variant)

Used to call HTTP methods at Zbang! The Game

Specification: external "httpconnect.dll" cdecl long SendRecvHTTP(string, long, string, long)

Known usage: SendRecvHTTP("scoresshort.php?player=<PlayerName>", 65535, <Buffer>, 65535)

Known usage: SendRecvHTTP("/update.php?player=<PlayerName>&difficulty=<Difficulty>&items=<CommaSeparatedItemList>", 65535, <Buffer>, 65535)

My Zbang demo does not have this dll, so there is no way to actually test it with a test game

Return value is never used in Zbang scripts