Tuesday, 26 November 2013
Commandos BTCOD windowed on 32 bit dekstop
I got tired with switching to 16 bit desktop to be able to run BTCOD in windowed mode. So with bunch of lines of C++ code here it's. Additional feature is full-screen console with Lua interpreter and some game engine features available from Lua script. I had to implement DisplayDevice interface and provide some simple methods to create and resize game window, locking/unlocking primary drawing surface. With this new SdlDisplayDevice I was finally able to use quake-like console in the game window. You probably remember that previously it had to be in separate window. But that's not all. There is Lua script interpreter running and there are some features available. Just as proof of concept one can check current game engine state, select character and check some character attributes like type , name from the Lua script. More to come. Enjoy the video.
Code Injection through dynamic library
Inspired by Oni Mod Anniversary Edition I started playing with code injection. My usual target is my favorite game Commandos Beyond the Call of Duty. I've bought original box version long time ago. My first goal was ability to reuse existing binary executable. It's easier to modify if you can see immediate result. I've start with few failed attempts of using game executable as dll library. I was able to load exe file as library using LoadLibrary Win32 Api call, but load address was always random, without proper reloc segment in exe file it's not possible to use any code from that binary directly, and reconstructing entire reloc segments seemed as impossible task. So I've change my approach. Instead of using binary as dll I decided to create my shared library and inject custom code into starting process. There is an easy way to do that on Windows. One have to create dll library with the same name as one used by executable. In my case coman_mp.exe uses ddraw.dll. Created library have to provide list of exported functions. Fortunately game binary (coman_mp.exe) uses only one functions from ddraw.dll (DirectDrawCreate).
This approach is based on assumption that game binary will be loaded and fully initialized before any of dynamic libraries required by this binary. During the loading and dynamic linking stage system loader will look for required dynamic libraries in current working directory. So it's enough to create dll that provides DirectDrawCreate function and dummy IDirectDraw interface implementation and store it in the same directory where game binary is.
Code sample presents dynamic library source.
End of part one.
This was just very simple introduction to story about my work with Commandos BTCOD game binary.
This approach is based on assumption that game binary will be loaded and fully initialized before any of dynamic libraries required by this binary. During the loading and dynamic linking stage system loader will look for required dynamic libraries in current working directory. So it's enough to create dll that provides DirectDrawCreate function and dummy IDirectDraw interface implementation and store it in the same directory where game binary is.
Code sample presents dynamic library source.
#include <windows.h>
struct LPDIRECTDRAW;
struct IUnknown;
HRESULT WINAPI DirectDrawCreate(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter)
{
return 1;
}
BOOL APIENTRY DllMain(HANDLE hModule, DWORD reason, LPVOID lpReserved)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
// At this point game binary is loaded and initialized
// we can start patching
break;
case DLL_THREAD_DETACH:
break;
}
return true;
}
End of part one.
This was just very simple introduction to story about my work with Commandos BTCOD game binary.
Sunday, 16 June 2013
Mission editor with visible patrol routes
One more but small improvement to BTCOD mission editor. Now it's possible to see patrol routes.
Also there is possibility to use debug console. Check first image. It's also usable from Lua scripts.
Tuesday, 9 April 2013
Commanods BtCoD deadly flamethrower
Finally flamethrower can be used to kill Nazis. Last step will be creating proper flame animation.
Thursday, 4 April 2013
BtCoD flamethrower part 2
Finally flamethrower is almost usable. Now proper character animation is used. Check the video. One thing still missing proper flame animation. Anyone interested in making one. Let me know.
Wednesday, 27 March 2013
Strike in Narrow Path built-in editor
This time I was able to use built-in editor in Commandos BEL mod called Strike In Narrow Path. It's pretty similar to that one found in Commandos BTCOD. If you wanna try it just download SINP ddraw.dll and put it in the directory with SINP binary. It will work only with SINP 2.3 english version.
Tuesday, 12 March 2013
BCoD flamethrower in action
Another small step made. It's possible to use flamethrower. Proper character animation is still missing. This is still work in progress.
Flamethrower in BCOD
![]() |
| Mechanic with flamethrower |
It was brought to my attention that there is possibility to use a flamethrower in BCOD. So I started playing with it. As far as I know only Mechanic character has proper animations for it. I found a way how to add it to backpack. It's still not fully usable. Just work in progress.
Commandos BCOD Modding
![]() |
| Commandos BCOD with game editor and Lua interpreter. |
Also I found that some debug options in BCOD were left by developers they have removed just key shortcuts. Current status is that I can use Lua interpreter to investigate and modify state of the game. My plan is to use Lua to extend existing game engine with some fun stuff.
Thursday, 10 December 2009
Commandos BEL map viewer

Since two weeks I'm working on Commandos BEL map viewer. Small preview of work status can be seen on the screenshot. There is lot of work to be done, but current result is quite awesome. Also some additional tools are under development such as Commandos image container browser. There is somewhere deep in my mind an idea to about writing open source Commandos game engine.
Tuesday, 11 November 2008
Koala Painter Qt image plugin
Yesterday I was playing with Qt plugins and accidentally wrote Koala Painter image plugin for Qt4. It has been tested with Image Viewer available with Qt4 source code. Next step will be to write plugins for other C64 image formats.
Thursday, 6 November 2008
Xfce based on Qt toolkit
Some time ago i've start writing Qt port of xfce4-panel.
Mainly to don't forget how to write programs using Qt toolkit.
Now it is in phase pre-alpha (not usable), but works even
have few plugin (launcher, show-desktop and action).
If i'll have more time, maybe i'll continue the work and
the goal will be something similar to xfce only based on Qt.
But the question is: Is there anybody who is interested to
using something like that?
Mainly to don't forget how to write programs using Qt toolkit.
Now it is in phase pre-alpha (not usable), but works even
have few plugin (launcher, show-desktop and action).
If i'll have more time, maybe i'll continue the work and
the goal will be something similar to xfce only based on Qt.
But the question is: Is there anybody who is interested to
using something like that?
Cross makepkg
Durning works on my Master Thesis i've create port of makepkg script from ArchLinux distro. I've called it cmakepkg. Now it can compile and build packages for diffrent architecture using installed cross compiler. Using this tool i've successfully build several packages for powerpc architecture.
cmakepkg additional features:
- saving man, include files are now configurable
- config file stored in ~/.config/cmakepkg/
- configurable target platform
- configurable development envirnoment and path to it
Previously i've prepare PKGBUILD'd for cross powerpc development envirnoment, which contains:
- binutils
- gcc and g++
- glibc
cmakepkg additional features:
- saving man, include files are now configurable
- config file stored in ~/.config/cmakepkg/
- configurable target platform
- configurable development envirnoment and path to it
Previously i've prepare PKGBUILD'd for cross powerpc development envirnoment, which contains:
- binutils
- gcc and g++
- glibc
Thursday, 27 December 2007
End of the year
Another year had past.
For me it was a good year.
I have learn many new things,
and meet very interesting people.
My wish for the next year?
I want to marry with my beloved Żaneta,
write the master thesis, and find a good
job.
For me it was a good year.
I have learn many new things,
and meet very interesting people.
My wish for the next year?
I want to marry with my beloved Żaneta,
write the master thesis, and find a good
job.
Saturday, 29 September 2007
Tuesday, 10 July 2007
No to zaczynamy
Rozpocząłem prace nad moją pracą dyplomową.
Narazie krótki plan pracy. Niedługo mam otrzymać
sprzęt na którym mam pracować. Pierwsze spotkanie
z PowerPC. Mam nadzieje że uda mi się do końca wakacji
zrealizować większą część pracy. Na bieżąco muszę
tworzyć dokumentację (po angielsku). No to do pracy...
Narazie krótki plan pracy. Niedługo mam otrzymać
sprzęt na którym mam pracować. Pierwsze spotkanie
z PowerPC. Mam nadzieje że uda mi się do końca wakacji
zrealizować większą część pracy. Na bieżąco muszę
tworzyć dokumentację (po angielsku). No to do pracy...
Saturday, 23 June 2007
MViewC64
About two years ago i have written simple
viewer for the C64 computer images.
It can read several formats including
Koala Painter, FLI, and others.
Now i want to write more complex user interface,
only if i will have enough time.
viewer for the C64 computer images.
It can read several formats including
Koala Painter, FLI, and others.
Now i want to write more complex user interface,
only if i will have enough time.
Wednesday, 20 June 2007
Początek drogi
Siedząc samotnie w prawie pustym uczelnianym
korytarzu człowiek zaczyna się zastanawiać
"kur... i po co mi to wszystko?". Kumple wyjechali
do Irlandii "kroją kasę", a ja się tu męczę.
"No i co mi z tego przyjdzie?"
Ale jest nadzieja! :)
Narazie sza...
korytarzu człowiek zaczyna się zastanawiać
"kur... i po co mi to wszystko?". Kumple wyjechali
do Irlandii "kroją kasę", a ja się tu męczę.
"No i co mi z tego przyjdzie?"
Ale jest nadzieja! :)
Narazie sza...
Subscribe to:
Posts (Atom)





