Regarding multiplayer games, is it possible to prevent the "t" being used to turn off "trees"? Our group would like to try playing WITH trees once in awhile and would like to insure that no one can cheat. E-mail is swantsays@gmail
Thanks
Trees
Re: Trees
I'm pretty sure that you cannot turn off the Tree/foliage button. I understand that it is hard-coded.
Our MP group have had to learn to accept it and trust that nobody takes advantage.
I admit to using it but not to view enemy troops, rather to see the arrow clearer when deploying in Long grass
Our MP group have had to learn to accept it and trust that nobody takes advantage.
I admit to using it but not to view enemy troops, rather to see the arrow clearer when deploying in Long grass
Re: Trees
Easiest way is perhaps to just "nullify" the code in your process memory that handles any triggered eComToggleTrees.
std:fill'ing from the AI dll, init method.
Would take me no more than 30 seconds.
But it's gray area stuff.
Don't tempt me.
https://emojipedia-us.s3.dualstack.us-w ... _1f64f.png[/img_size]
std:fill'ing from the AI dll, init method.
Would take me no more than 30 seconds.
But it's gray area stuff.
Don't tempt me.
Last edited by r59 on Sun Feb 23, 2020 4:08 am, edited 1 time in total.
-
- Reactions:
- Posts: 569
- Joined: Mon Apr 11, 2011 9:23 pm
Re: Trees
Can I tempt you please, r59?
I do think it would be a good option for the host to have in MP, although I assume it could only be done in Waterloo, not GB.
Martin J
I do think it would be a good option for the host to have in MP, although I assume it could only be done in Waterloo, not GB.
Martin J
Re: Trees
I'm not sure if it's worth taking the risk, Martin.Can I tempt you please, r59?
I do think it would be a good option for the host to have in MP, although I assume it could only be done in Waterloo, not GB.
Martin J
Hopefully I'll be granted a safe line to beat in hasty retreat, if things will go bad. :huh:
These were the latest instructions (7 months old) set by the forum moderation.Ciao R59
I don't think is a great idea teach how to use a hex editor in order to change the exe code on the game forum, also if is for correct a problem. This is a commercial product with a contract with a distributor.
Please, in order to avoid any form of problem don't post them in absence of any Norb or Jim communication.
Davide
Ok, this is not hex editing physical files.
It's your running memory and you are never going to change the original exe (it undergoes many modifications on its own before being runnable too).
It's roughly comparable to setting a game variable's from the AI DLL after all, under the hood.
*In theory* this should avoid triggering any ballistic missile alert here (fingers crossed). :dry:
But, as I said before, it's still a gray area, nevertheless.
Use at your own risk and preferably not within a Steam installation.
I cannot test or compile it now, but might give an idea to anybody interested.
SowInit is another place where you can do this (but not restoring the original bytes).
Code: Select all
static std::uint8_t g_old_code[28];
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
if (CXUtil::IsMulti()) {
DWORD old_protect, dummy_protect;
auto start_addr = reinterpret_cast<std::uint8_t *>(0x0050E155);
if (VirtualProtect(start_addr, 28, PAGE_EXECUTE_READWRITE, &old_protect) != FALSE) {
if (*start_addr != UINT_C(0x90)) {
memcpy(g_old_code, start_addr, 28);
memset(start_addr, 0x90, 28);
FlushInstructionCache(GetCurrentProcess(), start_addr, 28);
}
VirtualProtect(start_addr, 28, old_protect, &dummy_protect);
}
}
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
if (CXUtil::IsMulti()) {
DWORD old_protect, dummy_protect;
auto start_addr = reinterpret_cast<std::uint8_t *>(0x0050E155);
if (VirtualProtect(start_addr, 28, PAGE_EXECUTE_READWRITE, &old_protect) != FALSE) {
if (*start_addr == UINT_C(0x90)) {
memcpy(start_addr, g_old_code, 28);
FlushInstructionCache(GetCurrentProcess(), start_addr, 28);
}
VirtualProtect(start_addr, 28, old_protect, &dummy_protect);
}
}
break;
}
return TRUE;
}
Last edited by r59 on Sun Feb 23, 2020 11:52 pm, edited 1 time in total.
-
- Reactions:
- Posts: 569
- Joined: Mon Apr 11, 2011 9:23 pm
Re: Trees
Many thanks r59.
I don't pretend to understand this stuff, but have alerted someone who does.
Will bend my own efforts towards finding you a safe-house for when Mitra comes for you
Martin J
I don't pretend to understand this stuff, but have alerted someone who does.
Will bend my own efforts towards finding you a safe-house for when Mitra comes for you

Martin J
-
- Reactions:
- Posts: 569
- Joined: Mon Apr 11, 2011 9:23 pm
Re: Trees
Hi again r59
Early reports back suggest you may be on to something.
I believe we can therefore upgrade you to a deluxe secret bunker
Thanks again
Martin J
Early reports back suggest you may be on to something.
I believe we can therefore upgrade you to a deluxe secret bunker

Thanks again
Martin J