Statistics

Users
3463
Articles
156
Articles View Hits
1499986

Trees

4 months 1 week ago #1 by El Swanto

  • Cannon Fodder
  • Cannon Fodder

  • Posts: 12
  • Thank you received:

  • Gender: Unknown
  • Birthdate: Unknown
  • Trees was created by El Swanto
    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

    Please Log in or Create an account to join the conversation.

    4 months 1 week ago #2 by Grog

  • Regimental Commander
  • Regimental Commander

  • Posts: 248
  • Thank you received: 153

  • Gender: Male
  • Birthdate: 08 Apr 1969
  • Replied by Grog on topic 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

    Please Log in or Create an account to join the conversation.

    4 months 1 week ago - 4 months 1 week ago #3 by r59

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 45

  • Gender: Unknown
  • Birthdate: Unknown
  • Replied by r59 on topic 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.
    Last edit: 4 months 1 week ago by r59.

    Please Log in or Create an account to join the conversation.

    4 months 1 week ago #4 by Martin James

  • Brigade Commander
  • Brigade Commander

  • Posts: 553
  • Thank you received: 144

  • Gender: Unknown
  • Birthdate: Unknown
  • Replied by Martin James on topic 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

    Please Log in or Create an account to join the conversation.

    4 months 1 week ago - 4 months 1 week ago #5 by r59

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 45

  • Gender: Unknown
  • Birthdate: Unknown
  • Replied by r59 on topic Re: Trees

    Martin James wrote: 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'm not sure if it's worth taking the risk, Martin.
    Hopefully I'll be granted a safe line to beat in hasty retreat, if things will go bad. :huh:

    mitra76 wrote: 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


    These were the latest instructions (7 months old) set by the forum moderation.
    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).
    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;
    }

    Have a nice Sunday.
    Last edit: 4 months 1 week ago by r59.
    The following user(s) said Thank You: Martin James

    Please Log in or Create an account to join the conversation.

    4 months 1 week ago #6 by Martin James

  • Brigade Commander
  • Brigade Commander

  • Posts: 553
  • Thank you received: 144

  • Gender: Unknown
  • Birthdate: Unknown
  • Replied by Martin James on topic 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

    Please Log in or Create an account to join the conversation.

    4 months 1 week ago - 4 months 1 week ago #7 by r59

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 45

  • Gender: Unknown
  • Birthdate: Unknown
  • Replied by r59 on topic Re: Trees
    I'll take you at your word, then. :whistle:
    So in the meantime, please don't lose yourself in the woods.
    You wouldn't be the first guy. :lol:
    Last edit: 4 months 1 week ago by r59.

    Please Log in or Create an account to join the conversation.

    4 months 1 week ago #8 by Martin James

  • Brigade Commander
  • Brigade Commander

  • Posts: 553
  • Thank you received: 144

  • Gender: Unknown
  • Birthdate: Unknown
  • Replied by Martin James on topic 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

    Please Log in or Create an account to join the conversation.

    Moderators: RebBuglergunship24Leffe7Sargonpaul9038