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 › Combat Arms Coding Help & Discussion › [HELP] Saving Char* Arrays in Structure.

[HELP] Saving Char* Arrays in Structure.

Posts 1–8 of 8 · Page 1 of 1
topblast
topblast
[HELP] Saving Char* Arrays in Structure.
I AM HAVING PROBLEMS WILLING A STRUCTURE WITH CHAR* [] and getting them back to text. When i put it in MessageBoxA() it Compiles but then it crashed at that location. When in PrintRightText() it just dont draw Anything.



Structures HERE


[PHP]struct sItem
{
char* Name;
char** Options;
int* Value;
bool Selectable;
sItem(char* NAME, char** OPTIONS, int* VALUE, bool SELECTABLE)
{
Name=NAME;
Options=OPTIONS;
Value=VALUE;
Selectable=SELECTABLE;
}
~sItem()
{}
};

typedef struct {
char* Name;
int noItems;
int totHeight;
sItem** Items;
int Selected;
} sTab;
[/PHP]

The Adding FUNCTIONS

[PHP]
void cMenu::AddTab(char* name, bool selected)
{
TABS[noTabs]->Name = name;
TABS[noTabs]->Selected = selected;
TABS[noTabs]->noItems = noTempitems;
TABS[noTabs]->totHeight = temptotHeight;
TABS[noTabs]->Items = tempItems;
noTempitems=temptotHeight=0;
this->tempItems=(sItem **)malloc(10);
for (int i=0; i<10; i++) this->tempItems[i]=(sItem *)malloc(sizeof(sItem));
noTabs++;
totHeight=(noTabs*30);
}

void cMenu::AddItem(char* Item_Name, char** Options, int* DefaultValue)
{
tempItems[noTempitems]=new sItem(Item_Name, Options, DefaultValue, true);
noTempitems++;
temptotHeight=(noTempitems*16);
}[/PHP]

FILL THE STRUCTURES HERE
[php]char* Options[] = {"WEE", "WEE1", "WEE2"};
pMenu->AddText("TEXTXY" , "HEY IT IS WORKING");
pMenu->AddItem("Item 2", Options, &A[1]);
pMenu->AddItem("Item 3", Options, &A[2]);

pMenu->AddTab("Tab 1", true);
[/PHP]

AND NOT THE DRAW STUFFY


[PHP]for (int i=0; i<this->noTabs;i++)
{
for (int o=0; o<(this->TABS[i]->noItems) ;o++)
{
int val=(this->TABS[i]->Items[o]->Value)?(*this->TABS[i]->Items[o]->Value):0;
if (this->TABS[i]->Items[o]->Options){

char* texy = this->TABS[i]->Items[o]->Options[val];

PrintRightText(pFont,posi0+3, posi1+(o*15), 0xffccccff, texy);
}
}
}[/PHP]
#1 · 15y ago
topblast
topblast
guess no one here knows about this
#2 · 15y ago
SC
scimmyboy
thats cuz nobody wants to help mpgh anymore LOL
#3 · 15y ago
topblast
topblast
Quote Originally Posted by scimmyboy View Post
thats cuz nobody wants to help mpgh anymore LOL
I am not MPGH.. i am just a simple D3D coder .
#4 · 15y ago
GodHack2
GodHack2
recreating hans's ay
#5 · 15y ago
GO
Gordon`
there are local and global variables. using local variables is not very useful cause they are gone after the function call

i said be careful with pointers in another thread. i would use memcpy/strcpy to copy the names/text values/etc into the structure.

btw:
Code:
this->tempItems=(sItem **)malloc(10);
this only allocates memory for 10 bytes not for 10 items
#6 · edited 15y ago · 15y ago
why06
why06
Good eye Gordon!

I see you try to allocate memory for them here, but this does not work. Your only returning a pointer to the allocated memory.
Code:
for (int i=0; i<10; i++) this->tempItems[i]=(sItem *)malloc(sizeof(sItem));
So all you ended up doing is saving pointers in those 10 bytes you allocated.

To delare an an array of sItem simply do it like any other data type
Code:
int* intArray;
intArray = new int[20]; //will create array of 20 ints
so for sItems it would be
Code:
sItem* itemArray;
itemArray = new sItem[some_number_here];
Now itemArray will point to that allocated memory.
#7 · 15y ago
topblast
topblast
I i will do that to make it little more safe, but menu Options still not working
#8 · 15y ago
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Tags for this Thread

None