PDA

View Full Version : BF2142 Armor, Health & Ammo Bar Asm Modifications


dubbls
22nd December 2006, 05:42
BF2142 1.10 Code Examples for Healthbar & Armor Bar Display with Ammo Bar Hotkey Toggle

Display Health and Armor bars changed from BF2, this time we have to hack individual
classes to have healthbars and armor bars for vehicles display all the time.
Here are the assembly modifications you will need to achieve Amor Bar & Health Bar Display and
an ammo Toggle Hotkey for all classes with a brief explination to each modification.


Allow Assualt, Supply & Engineer Classes to see Display Bars
(RendBase+0x1BB3BF)

Allow Enemy Classes to see Display Bars
(RendBase+0x1BB183)

Allow Assualt, Supply & Recon Class to see Armor Bars for Vehicles
(RendBase+0x1BB26C)

Allow Recon, Supply & Engineer Classes to see health bars
(RendBase+0x1BB238)

Allow Recon Class to See Display Bars
(RendBase+0x1BB1B0)


Now if you want to make a hotkey toggle button so you can toggle between
Healthbar and ArmorBar view to Ammo view for both infantry and vehicles,
you make these modifications while the other above hacks are active.


Allow all Classes to see display bars
(RendBase+0x1BB2EC)

Allow Assault, Supply & Recon Classes see Ammo bar for Infantry
(RendBase+0x1BB2BA)

Allow Assault, Supply & Recon Classes see ammo bar for Vehicles
(RendBase+0x1BB26C)

Allow Engineer to see ammo bars for infantry
(RendBase+0x1BB241)

Allow Engineer to see ammo bars for vehicles
(RendBase+0x1BB262)


For the hotkey off toggle you just rewrite back in the games orignal code for
the ammo modifications while the Health & Armor bar modifications are still active and
it will toggle between the Health & Armor bar and their Ammo bar display anytime you want.


Oh ya, if you want to force the bar displays to not fade at all, here is 1 easy way at

(RendBase+01BB4C9)
the FSUB ST,ST(1) command, just switch it to FMUL ST,ST(1)


Happy Holidays
-dubs

dar
23rd December 2006, 01:25
thanks!!!! nice chrismass gift from you :D just want i needed to complete my stuff :D

good job dubbls!

The_Milkman
23rd December 2006, 03:04
How do we enter this for 2142?

Haxing4Life
23rd December 2006, 14:08
nop the offsets

snipester
24th December 2006, 20:42
I just changed JNZ to JE and that worked...

juggalosunited
15th January 2007, 23:33
how do u do this

tASEr
16th January 2007, 01:02
Go read up on how to make a simple nametag hack and come back, you will understand more.

F3Zero
26th January 2007, 13:03
Yeah I want to make my own nametag hack. Its frigin hard though!

Shaan
14th February 2007, 03:57
how can i find RendBase ?
what is it?

bithunter_2007
17th February 2007, 02:48
@Shaan
by calling

Handle = OpenProcess(PROCESS_ALL_ACCESS,0,_BF2PID);
RenderBase = GetModuleBaseAddress(pid, "RendDX9.dll");

bh_07

Shaan
3rd April 2007, 12:14
hey thanks.
but i can,t find GetModuleBaseAddress .....
there are something else in .Net Library.

Sparten
5th April 2007, 10:16
GetModuleBaseAddress(); is not a windows API but a made up function, its mainly used for stanalone hack proggies((.exe)trainers)
GetModuleHandle(); (WIN API) can be used if inside target process eg. injecting a dll.

anyways here is the function.

DWORD GetModuleBaseAddress(DWORD iProcId, char* DLLName)
{
HANDLE hSnap;
MODULEENTRY32 xModule;
hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, iProcId);
xModule.dwSize = sizeof(MODULEENTRY32);
if (Module32First(hSnap, &xModule))
{
while (Module32Next(hSnap, &xModule))
{
if (strcmp(xModule.szModule, DLLName) == 0)
{
CloseHandle(hSnap);
return (DWORD)xModule.modBaseAddr;
}
}
}
CloseHandle(hSnap);
return 0;
}

credits ??