Solved Convert C++ To C#

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

steb

Jr.Coder
Full Member
Nobleman
Aug 16, 2016
63
383
1
I have no experience with c++
can someone convert this to c#

DWORD SF = (DWORD)GetModuleHnalde("SpecialForce.exe");
Dword Speed = SF + 0x798F80;

DWORD WINAPI SpeedHack(void*)
{
while (true)
{
(*(PBYTE)(Speed)) = 0;
Sleep(100)
}
}

BOOL APIENTRY DLLMain(HMODULE hm, DWORD rr, DWORD re)
{
if (rr == DLL_PROCESS_ATTACK)
{
CreateThread(0,0, SpeedHack, 0, 0, 0);
}
}
 

HexMurder

Arcane Hacker
Dank Tier VIP
Dank Tier Donator
Jun 7, 2012
319
7,988
22
honestly i can't even tell if this is a troll or not becuase there are so many typos in this C++ code alone. However here is a basic translation. Probably not copy/paste-able, but this is most of the work for you.

https://pinvoke.net/ is your best friend when converting C++ into C#.
https://pinvoke.net/default.aspx/coredll/GetModuleHandle.html

C++:
[COLOR="#00FF00"]//import this dll to use getmod func from C++[/COLOR]
[DllImport("coredll.dll")]
static extern IntPtr GetModuleHandle(string module);

[COLOR="#00FF00"]//A DWORD is, by definition, an unsigned 32-bit integer. Since C# does not have DWORDs we will literally be using an unisgned int 32.[/COLOR]
UINT32 SF = (long)GetModuleHandle("SpecialForce.exe");
UINT32 Speed = SF + 0x798F80;

UINT32 SpeedHack()
{
while (true)
ut (UINT32)(Speed)) = 0;
Thread.Sleep(100);
}
}

BOOL DLLMain(HMODULE hm, long rr, long re)
{
if (rr == DLL_PROCESS_ATTACK)
{
Thread thread = new Thread(new ThreadStart(SpeedHack));
thread.Start();
}
}
 
Last edited:

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
2,978
17
honestly i can't even tell if this is a troll or not becuase there are so many typos in this C++ code alone. However here is a basic translation. Probably not copy/paste-able, but this is most of the work for you.

https://pinvoke.net/ is your best friend when converting C++ into C#.
https://pinvoke.net/default.aspx/coredll/GetModuleHandle.html

C++:
[COLOR="#00FF00"]//import this dll to use getmod func from C++[/COLOR]
[DllImport("coredll.dll")]
static extern IntPtr GetModuleHandle(string module);

[COLOR="#00FF00"]//A DWORD is, by definition, an unsigned 32-bit integer. Since C# does not have DWORDs we will literally be using an unisgned int 32.[/COLOR]
UINT32 SF = (long)GetModuleHandle("SpecialForce.exe");
UINT32 Speed = SF + 0x798F80;

UINT32 SpeedHack()
{
while (true)
ut (UINT32)(Speed)) = 0;
Thread.Sleep(100);
}
}

BOOL DLLMain(HMODULE hm, long rr, long re)
{
if (rr == DLL_PROCESS_ATTACK)
{
Thread thread = new Thread(new ThreadStart(SpeedHack));
thread.Start();
}
}
I think you misunderstood him, he wants a copy-pastable compiling copy of the C++ code, not an explanation that he can learn from.
 

HexMurder

Arcane Hacker
Dank Tier VIP
Dank Tier Donator
Jun 7, 2012
319
7,988
22
I think you misunderstood him, he wants a copy-pastable compiling copy of the C++ code, not an explanation that he can learn from.
Hmm... Too bad for him this is GuidedHacking and not CopyPastaHacking. :kappa:
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
Вroihon;45587 said:
But everything changed when the DLL_PROCESS attacked
rofl nice find broihon, everyone else missed it
 

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,745
40,528
316
Rake;45591 said:
rofl nice find broihon, everyone else missed it
pls mod me for my quality posts, thx in advance
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods