Hans Passant was right. It does not write to stdout, but I could fix it with assembly. So he was not right in that.
After this the output was unsynced, but it could be successfully fixed with exchanging a jump to nops. More: stackoverflow.com/questions/23811572/writefile-function-with-assembly-debugging-syncing
So sum everything up:
It is not just for Jedi Academy Dedicated Server, it can be useful for any binary file that stores output, but not to STDOUT.
Changing WriteFile function to write to STDOUT (-11 is stdout):
Fix syncing problem:
It is for JampDed 1.00, so if you want to use it for another version of JK, or for another game, you must find these addresses yourself. Best practise (in my opinion) if you go call by call deeper in the code. You may start from any message you find, then go deeper.
I have logged the whole debugging process this way:
004429a7 is (call 0043d440)
- 0043d44e (call 00422720)
-- 004227dD (call edx) - 2008F1B0
--- 2008f103 (call 2008cad0)
---- 2008c4d0
----- 2008c569 (call 2008b030)
------ 200a25f7 DWORD PTR DS:[20106A28] - 00422540
------- 0042254b (CALL DWORD PTR DS:[ECX+4]) - 0043d590
-------- 0043d8aa (call 0040fb40)
--------- 0040FC39 (call 0044b7a0)
---------- 0044b66c (call 004964dd)
----------- 00496500 (call 0049a4ba)
------------ 0049a4cd (call 00497d66)
------------- 00497d92 (call 0049e18c)
-------------- 0049e26f (CALL DWORD PTR DS:[4A715C])
And if you notice the last one is where WriteFile is located. And 2 before that is where the logsync stuff is located
So now
jampDed.exe | stdout.exe
works, and you can start creating your own mod for the server easily. Or anything you want. :)