Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Combat Arms Hacks & Cheats › Combat Arms Hack Coding / Programming / Source Code › My C# Menu Class

My C# Menu Class

Posts 1–11 of 11 · Page 1 of 1
User1
User1
My C# Menu Class
Hey guys, I attempted to get a menu working on my C# hack but I couldn't get the d3d device so I just gave up. I'ma just give up here after a few hours of googling, there seems to be no simple solution I could use. If anyone manages to get it, please help me out. Otherwise here is my menu code... It might not work as I can't test it without getting the device.

This is a basic port of Void's menu, Void also helped me out on a lot of the menu...

To C&P'ers, theres no point as this code will not work without a device.

Note: This code supports display numeral values as well as On/Off, the number can only go up to 10, but you can easily change that.

[PHP]//User1's C# Menu Class, ported from Void's menu class.
//Please give credits when used.
//This code might catastrophically fail as I never tried this...

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;


namespace CombatArmsHack
{
class Menu
{
//Please tell me you understand the below code...
[DllImport("user32.dll")]
static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey);

private System.Drawing.Font menuFont = new System.Drawing.Font("Comic Sans MS", 15); //The font to set the D3D Font to...

private Device m_Device; //D3D Device, if you can get this Managed or Unmanaged, please contact me.
private Font m_Font; //D3D Font
public List<MenuItem> MenuItems = new List<MenuItem>();


//Creates the font and sets the device
public Menu(Device device)
{
m_Device = device;
m_Font = new Font(m_Device,menuFont);
}
//Add a new Item to the Menu.
public void AddItem(string Text, int State, bool Logic)
{
MenuItem NewItem = new MenuItem();
NewItem.Text = Text;
NewItem.State = State;
NewItem.Logic = Logic;

MenuItems.Add(NewItem);
}
//Draws menu.
public void RenderMenu()
{
//Rectangle where one of the menu items will be rendered
System.Drawing.Rectangle CurRect = new System.Drawing.Rectangle(20,20,150,20);

for(int i = 0; i < MenuItems.Count;i++)
{
bool Selected = MenuItems[i].Selected;
int State = MenuItems[i].State;
bool Logic = MenuItems[i].Logic;
string Text = MenuItems[i].Text;


if(Selected)
{//Item is Selected
m_Font.DrawText(null,Text,CurRect,DrawTextFormat.L eft,System.Drawing.Color.Lime);
if(Logic)
{//Item is On/Off
if(State == 0)
{//Item Off
m_Font.DrawText(null,"Off",CurRect,DrawTextFormat. Right,System.Drawing.Color.Red);
}
else
{//Item On
m_Font.DrawText(null,"On",CurRect,DrawTextFormat.R ight,System.Drawing.Color.White);
}
}
else
{//If Not boolean, draw value
m_Font.DrawText(null,State.ToString(),CurRect,Draw TextFormat.Right,System.Drawing.Color.White);
}
}
else
{//Normal Item
m_Font.DrawText(null,Text,CurRect,DrawTextFormat.L eft,System.Drawing.Color.CornflowerBlue);
if(Logic)
{//Item is On/Off
if(State == 0)
{//Item Off
m_Font.DrawText(null,"Off",CurRect,DrawTextFormat. Right,System.Drawing.Color.Red);
}
else
{//Item On
m_Font.DrawText(null,"On",CurRect,DrawTextFormat.R ight,System.Drawing.Color.White);
}
}
else
{//Draw Number
m_Font.DrawText(null,State.ToString(),CurRect,Draw TextFormat.Right,System.Drawing.Color.White);
}
}
CurRect.Y += 17; //Shift rectangle down so the text does not get clipped.
}
}
//Takes care of which menu item is selected, and if it is on or off.
public void Controls()
{
int CurIndex = 0;
if(GetAsyncKeyState(System.Windows.Forms.Keys.Down ) != 0)
{
CurIndex++;
if (CurIndex > MenuItems.Count - 1)
{
CurIndex = MenuItems.Count - 1;
}
MenuItems[CurIndex].Selected = true;
try
{
MenuItems[CurIndex - 1].Selected = false;
}
catch (Exception) { }
}
if (GetAsyncKeyState(System.Windows.Forms.Keys.Up) != 0)
{
CurIndex--;
if (CurIndex < 0)
{
CurIndex = 0;
}
MenuItems[CurIndex].Selected = true;
try
{
MenuItems[CurIndex + 1].Selected = false;
}
catch (Exception) { }
}
if (GetAsyncKeyState(System.Windows.Forms.Keys.Right) != 0)
{
int CurState = MenuItems[CurIndex].State;
if (MenuItems[CurState].Logic)
{//If Boolean
if (CurState == 0)
{
CurState++;
}
else
{
CurState = 0;
}
}
else
{//Numeral Value
CurState++;
if (CurState > 10)
{
CurState = 10;
}
}
}
if (GetAsyncKeyState(System.Windows.Forms.Keys.Left) != 0)
{
int CurState = MenuItems[CurIndex].State;
if (MenuItems[CurState].Logic)
{//If Boolean
if (CurState == 0)
{
CurState = 1;
}
else
{
CurState = 0;
}
}
else
{//Numeral Value
CurState--;
if (CurState < 0)
{
CurState = 0;
}
}
}
}

public void Release()
{//Release Unmanaged memory.
m_Font.Dispose();
m_Device.Dispose();
}
}

//Menu Items
class MenuItem
{
public string Text; //Text to Display
public bool Selected; //Highlight?
public int State; //On/Off/Number
//If Logic is true, 0 = Off, 1 = On. Else it is a number
public bool Logic; //State is Bool or Num?
//If Logic = True, then the menu will display the State as On/Off.
}
}
[/PHP]

I hope one day someone can put this to good use, and again please help me get the D3D Device if possible...

Yes I know this code might be an epic fail as well, I'm not at all experienced with DX, or MDX.
#1 · 16y ago
Dreamer
Dreamer
NICE RELEASE BUT ITS A MISTAKE RELEASING IT!!! ALL YOUR HARD WORK
#2 · 16y ago
CoderNever
CoderNever
This looks real hard man
#3 · 16y ago
WH
whit
Thanks For Sharing Mate...
#4 · 16y ago
User1
User1
NP, a days work released into public domain... Not bad.
#5 · 16y ago
Void
Void
Yup, after the whole day of him spamming me for help, he just gives up. |:
#6 · 16y ago
User1
User1
Quote Originally Posted by Void View Post
Yup, after the whole day of him spamming me for help, he just gives up. |:
Wana help me out and show me how to get the device?
#7 · 16y ago
SC
scimmyboy
this is why u dont do C#
#8 · 16y ago
freedompeace
freedompeace
Lol, now you need another C++ DLL to activate the CLR runtime and host your C# DLL in it.
#9 · 16y ago
User1
User1
Quote Originally Posted by freedompeace View Post
Lol, now you need another C++ DLL to activate the CLR runtime and host your C# DLL in it.
Done long time ago... Thats the whole base of my project LOL
#10 · 16y ago
kutzki
kutzki
DUDE NICE CODING MAN!!! I SEE NOW WHAT you were working on...
#11 · 16y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

  • [Source]Simple menu classBy Void in C++/C Programming
    44Last post 15y ago
  • Delphi Menu ClassBy Departure in Combat Arms Hack Coding / Programming / Source Code
    25Last post 15y ago
  • [Tutorial]Change class without respawnBy vir2000 in Game Hacking Tutorials
    0Last post 20y ago
  • Guild Wars New ClassesBy Chronologix in General Gaming
    24Last post 20y ago
  • Heavy Weapons Class mine bug. I had no idea.By NukeAssault in General Gaming
    2Last post 20y ago

Tags for this Thread

None