r/classicbattlefield • u/basdit • 3d ago
BF1942: kill bots that steal your vehicle using console
I like to play BF1942 against bots. One thing that has always annoyed the hell out of me is that those fuckers tend to steal your tank or hog the destroyer or def guns. While you can kick players using console you cannot do it with bots. Inspired by all the LLM stuff going on I thought I would have Claude have a crack at it. It found out that there are actually commands to do it, but they are blocked with an unauthorized error. Claude was able to patch that permission check out of the executable and I could finally kick Terrence Pickles out of my gunner seat. Of course I want to share this with the community so I let it create a PowerShell script that can patch your executable and should work on most versions. Here ends the human messages and starts Claude its slop instructions, enjoy!
Script: https://pastebin.com/10UuYVAX
Install
- Close the game.
- On Pastebin, click raw, then save the page as bf1942-console-unlock.ps1 in your BF1942 folder. Make sure it doesn't end up as .ps1.txt.
- Open PowerShell in that folder (Shift + right-click in the folder → "Open PowerShell window here") and run:
powershell -ExecutionPolicy Bypass -File bf1942-console-unlock.ps1
To see what it would change without changing anything, add -WhatIf to the end.
Evicting Terrence Pickles
Start a bot game, press ~ and type:
ai.killBotName "Terrence Pickles"
- Use the bot's name exactly as shown on the scoreboard. Capitalisation matters.
- ai.killBotId <id> does the same thing by ID number.
- ai.killAllBots kills every bot at once.
The bot dies and your seat is free.
Undo
powershell -ExecutionPolicy Bypass -File bf1942-console-unlock.ps1 -Restore
What it does to your exe
- It changes 3 small jumps in the game's command-permission check (4 bytes in total) so the console is allowed to run every command.
- It finds that check by structure rather than fixed positions, so it isn't tied to one version. I've tested it on v1.61, and it also found the check in the dedicated server exe.
- It saves a backup as BF1942.exe.orig before changing anything.
- If the exe doesn't look as expected, it stops without changing anything. That includes old original-CD exes with SafeDisc copy protection.
- It's plain text, so you can read it before running it.
Don't play online with the patched exe. PunkBuster or server-side checks may flag it. Use -Restore before going online.
