Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++ to ASM]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
PIEzLOVERS
How do I cheat?
Reputation: 0

Joined: 11 Apr 2010
Posts: 3
Location: South East Asia

PostPosted: Mon Mar 14, 2011 1:18 am    Post subject: [C++ to ASM] Reply with quote

Well , here's the problem o-o
I want to add a random value to [iDamage] , but VS gives me the improper error o-o
how do i put a value into a textbox and convert it , make it compatiable for native C++ ?
P.S google didn't help me -.-

Codecave
Code:
int iDamage = Convert::ToInt32(textBox3->Text);
DWORD dwDamageControl = XXXXXX;
DWORD dwDControl = dwDamageControl + 0xA;
__declspec(naked) void __stdcall DamageControl()
{
__asm
{
        mov [esp+0xc4],[iDamage]
        jmp dword ptr [dwDControl]
}
}


CheckBox Checked
Code:
void Form1::checkBox4_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
BYTE dDControl[8] = {0x83,0xbc,0x24,0xc8,0x00,0x00,0x00,0x00};
if(checkBox4->Checked == true)
{
Jump(dwDamageControl,DamageControl,3);
}
else if (checkBox4->Checked == false)
{
memcpy((void*)dwDamageControl, dDControl, sizeof(dDControl));
}
}

Any Solutions to this problem ?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Mar 14, 2011 2:21 am    Post subject: Reply with quote

Eww at native C++ >.>

Anyway..

Code:
mov [esp+0xc4],[iDamage]


This is not valid ASM. Which is probably why you are getting errors.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
PIEzLOVERS
How do I cheat?
Reputation: 0

Joined: 11 Apr 2010
Posts: 3
Location: South East Asia

PostPosted: Mon Mar 14, 2011 2:38 am    Post subject: Reply with quote

i tried

Code:
int iDamage = Convert::ToInt32(textBox3->Text);
DWORD dwDamageControl = XXXXXX;
DWORD dwDControl = dwDamageControl + 0xA;
__declspec(naked) void __stdcall DamageControl()
{
__asm
{
        mov edi , [iDamage]
        mov [esp+0xc4],edi
        jmp dword ptr [dwDControl]
}
}

and it still doesn't work @.@
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Mon Mar 14, 2011 6:19 am    Post subject: Reply with quote

You can't just trash edi. Wrap it in a push/pop
Back to top
View user's profile Send private message
PIEzLOVERS
How do I cheat?
Reputation: 0

Joined: 11 Apr 2010
Posts: 3
Location: South East Asia

PostPosted: Mon Mar 14, 2011 6:53 am    Post subject: Reply with quote

It still crashes , what i want is actually how to get a variable from a textbox in C++ and convert it so it's compatiable for Native C++
Back to top
View user's profile Send private message Send e-mail MSN Messenger
natanreis1
Cheater
Reputation: 1

Joined: 01 Apr 2008
Posts: 44
Location: Somewhere over the rainbow

PostPosted: Tue Mar 15, 2011 2:33 pm    Post subject: Reply with quote

int iDamage = Convert::ToInt32(textBox3->Text);
DWORD dwDamageControl = XXXXXX;
DWORD dwDControl = dwDamageControl + 5; //<<< ------ assuming you're writing nops after the hook.

__declspec(naked) void __stdcall DamageControl()
{
__asm
{
push edi
lea edi, iDamage
mov edi, [edi]
mov [esp+0xc4], edi
pop edi
jmp dword ptr [dwDControl]
}
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites