README.md: project suspended

This commit is contained in:
norohind 2023-06-08 18:21:18 +03:00
parent 13afe8b0d7
commit 039cc7de32
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

154
README.md
View File

@ -1,3 +1,9 @@
# Conclusion
I was not able to rebuild provided UnrealScript code. Lack of verbose feedback from
build tools in UDK ecosystem (in particular, UDK.exe make) in case of problems has
exhausted me so I stopped researching on this game. Same as I stopped playing it.
# Deploy
TODO:
- Custom maps
@ -6,18 +12,23 @@ TODO:
- Apply webadmin patch
- Establish updates using <https://superuser.com/questions/1727148/check-if-steam-game-requires-an-update-via-command-line>
- Change as nothing as possible
- Took passwords to docker secrets/env and apply only at deploy time, use cli tool *crudini*?
- Change current password as it now in git history of this repo
- Write game version on config update commit
# Reverse engineering & Tricks
TODO:
- Investigate `LogInternal` slow (buffering?)
- Fix chat encoding
- ~~Investigate `LogInternal` slow (buffering?)~~
- Proper shutdown with game status control
- increase people amount
- play with config
- inspect the mutator
- fix discord presence (at least for local client)
- Investigate balance_tweaks.bin
- Investigate using domain name in JoinString
- Investigate server to client RCE using `client reliable function`
## Console commands execution
From `Core/Classes/Actor.uc`:
@ -26,7 +37,25 @@ From `Core/Classes/Actor.uc`:
native function string ConsoleCommand(string Command, optional bool bWriteToLog = true);
```
So it appears that console commands execution logic located in c++ code.
So it appears that for some console commands execution logic located in c++ code and
for some of them is defined in unrealscript as *exec function*s.
## UDK Versions
- 12791 - Latest available (<https://archive.org/download/udkinstaller/UDKInstall-2015-02.exe>); Tried to compile against it
- 10897 - KF2 is compiled against this version
## The GameInfo class
Might want to look to it for players amount increase.
```
The GameInfo class
The GameInfo class implements the game rules. A server (both dedicated and single-player) has one GameInfo subclass, accessible in UnrealScript as WorldInfo.Game. For each game type in Unreal, there is a special GameInfo subclass. For example, some existing classes are UTGame, UTDeathmatch, UTTeamGame.
A client in a network game does not have a GameInfo. That is, WorldInfo.Game == None on the client side. Clients should not be expected to have a GameInfo because the server implements all of the game play rules, and the generality of the code calls for the client not knowing what the game rules are.
GameInfo implements a broad set of functionality, such as recognizing players coming and going, assigning credit for kills, determining whether weapons should respawn, and so on. Here, we will only look at the GameInfo functions which are directly related to network programming.
```
src: <https://docs.unrealengine.com/udk/Three/NetworkingOverview.html>
## Logging
From `Core/Classes/Object.uc`:
@ -56,6 +85,22 @@ native(232) final static `{prevent_direct_calls} function WarnInternal( coerce s
This function being called on every log record, located in KFGameServ binary file: `0x0000000000e43210 UObject::execLogInternal(FFrame&, void*)`
### Buffering solution
Despite it isn't state anywhere in documentation (or I haven't succeed in finding it), the
logging system of unreal engine uses buffering.
It appears it's enough to add `-FORCELOGFLUSH` argument to avoid buffering.
src: <https://docs.unrealengine.com/udk/Three/CommandLineArguments.html>
Also check `-NOWRITE` - Disable output to log. I hope it disables log file writing. **Now it appears to don't work.**
### Logging to file
Initially I wanted also to deal with log files rotation as I don't need them when running server in container.
But on time of tests (8 Jun 2023) server very unreliable writes logs to file at all. For around one hundred runs I conducted,
`Launch.log` file appeared only once.
## Shutdown
Shutdown with exit code 0 can be achieved using `quit` console command in webadmin.
```
@ -75,9 +120,15 @@ WebAdmin console command stack:
SigIgn: TRAP(5) ALRM(14)
SigCgt: ILL(4) ABRT(6) BUS(7) FPE(8) SEGV(11) (33)
```
None of them invokes successful shutdown
None of them invokes successful (with exit code 0) shutdown
## GUID manipulations
## Get game version
`GAMEVER` console command returns info I don't want to use.
Steamquery's `get_info` function returns proper version. The same version can
be found in window's title of a desktop game client.
## Packages GUID manipulations
Get GUID of a package in python:
```python
# It's placed from 69 (dec) byte and takes 16 (dec) bytes in size
@ -92,19 +143,21 @@ print(uuid.UUID(bytes_le=r))
Write GUID:
```python
import uuid
u = uuid.UUID('753cbe46-8ff8-4383-a8a8-1a6338d55838')
u = uuid.UUID('df835886-7616-4d01-b31f-f693ec9ffa71')
with open("WebAdmin.u", "r+b") as file:
file.seek(69)
file.write(u.bytes_le)
```
It's enough to set GUID of an original package to make game consider it as the same package.
GUIDs appears to change every update.
In case of WebAdmin.u, on mismatch the game tries to download it from Redirect server.
## Parse maps cycle in python
```python
maps.split('=')[2].split(')')[0].replace('(', '[') + ']'
```
It's enough to set GUID of an original package to make game consider it as the same package.
## Language fix to try
```1. Кракозябры в админке:
Почему: сервер читает значение переменной LANG и пытается в мультиязычность (но не может).
@ -113,31 +166,45 @@ export LANG=en_US.utf8
```
src: https://steamcommunity.com/sharedfiles/filedetails/?id=1298957956
**This method tested to not work**
This method appears only to work with fields *GAME TYPE*, *DIFFICULTY*, *PERK* in webadmin.
## Language & encoding RE
Players to webadmin:
ISO-8859-1 -> UTF-8
Player to webadmin module still gives:
```
// `log("Message "$entry.message,,'WebAdmin');
[0092.35] WebAdmin: Message 83@>:1
```
```
// `log("BasicWebAdminUser.ReceiveMessage: " $Msg,,, 'WebAdmin');
BasicWebAdminUser.ReceiveMessage: B5AB B5AB
```
`IPDrv.WebResponse.CharSet` appears to not work
Sending message from web-admin call stack:
Sending message from web-admin call stack from server's view:
- WebAdmin.u: QHCurrentKF.IQueryHandler
- WebAdmin.u: WebAdmin.Query
- WebAdmin.u: QHCurrentKF.handleQuery
- WebAdmin.u: QHCurrent.handleCurrentChatData
- WebAdmin.u: QHCurrent.BroadcastMessage
- Engine.u: webadmin.WorldInfo.Game.BroadcastHandler.BroadcastText
- Engine.u: Receiver.TeamMessage
- ????
- Engine.u: PlayerController.TeamMessage // `reliable client simulated`
- Engine.u: HUD.Message // It appears to add console message
- Engine.u: Console.OutputText // It's definitely the console
TODO: investigate `MessageEntry` class
From a player to web admin call stack from server's view:
- Engine.u: PlayerController.ServerSay // `exec`; Client
- KFGame.u: KFPlayerController.ServerSay // `unreliable server`; Server
- Engine.u: PlayerController.ServerSay
- Engine.u: GameInfo.Broadcast
- Engine.u: BroadcastHandler.Broadcast
- Engine.u: BroadcastHandler.BroadcastText
- WebAdmin.u: MessagingSpectator.TeamMessage
- WebAdmin.u: BasicWebAdminUser.ReceiveMessage
Team message are sent to client for execution so it actually happens on client with server's provided arguments.
## Modules patching
How to log with substition:
@ -218,8 +285,8 @@ index 217a460..e3d29ff 100755
```
# References
## Web
## Information
- https://wiki.killingfloor2.com/index.php?title=Dedicated_Server_(Killing_Floor_2)
- https://docs.unrealengine.com/udk/Three/CommandletList.html
- https://docs.unrealengine.com/udk/Three/PackagesAndNetworking.html
- https://docs.unrealengine.com/udk/Three/CharacterEncoding.html
@ -228,7 +295,52 @@ index 217a460..e3d29ff 100755
- https://steamcommunity.com/sharedfiles/filedetails/?id=1298957956
- https://docs.unrealengine.com/udk/Three/ConsoleCommands.html
- https://docs.unrealengine.com/udk/Three/ConfigurationFiles.html
## Not web
- `killingfloor2\Development\Src` - Source code of some packages
- https://docs.unrealengine.com/udk/Three/UnrealScriptDefaultProperties.html
- https://docs.unrealengine.com/udk/Three/NetworkingOverview.html
- https://docs.unrealengine.com/udk/Three/NetworkProfiler.html
- https://docs.unrealengine.com/udk/Three/UT3Mods.html
- https://docs.unrealengine.com/udk/Three/CommandLineArguments.html
- https://docs.unrealengine.com/udk/Three/UnrealScriptFoundations.html
## Tools
- https://archive.org/download/udkinstall-2015-02
- https://eliotvu.com/portfolio/view/21/ue-explorer
# Draft
```
SETNOPEC GameInfo MaxPlayersAllowed 40
SETNOPEC GameInfo MaxPlayers 40
GET GameInfo MaxPlayersAllowed
GET GameInfo MaxPlayers
SETNOPEC KFAISpawnManager bLogAISpawning false
We want to change
WorldInfo.Game.MaxPlayersAllowed
WorldInfo.Game.MaxPlayers
АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ
абвгдеёжзийклмнопрстуфхцчшщъыьэюя
+32 (dec)
АБВГД
<span class="message"></span>
абвгд
<span class="message">012334</span>
я - O - 4F
Я - / - 2F
```