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++] Asm

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iRiot
Master Cheater
Reputation: 0

Joined: 03 Jul 2007
Posts: 395
Location: Aka RIOT

PostPosted: Fri Nov 21, 2008 8:28 pm    Post subject: [c++] Asm Reply with quote

Well iam trying to code in the Item Vac hack for the maplestory ... yes i know its patched but iam using it for pirvate servers.. well this is what happens i enable the hack and it doesn't d/c me but when loot an item it shuts down maplestory... here is my coding i was wondering if any1 can find the problem with it

Code:

#include <windows.h>
#include "resource.h"
#define JMP(frm, to) (int)(((int)to - (int)frm) - 5); 


BYTE bItemVac1[16];
BYTE bItemVac2[16];
BYTE bItemVac3[16];


DWORD ReturnAddy = 0x004B44E7;




__declspec(naked) void ItemVacHook()
{
__asm
{

pushad
mov ecx,[ebp+0x8]
mov ebx,[ebp-0x24]
mov [ecx],ebx
mov [ecx+0x4],eax
mov ecx,eax
mov eax,ebx
lea edx,[eax-0x19]
mov [ebp-0x34],edx
lea edx,[ecx-0x32]
add eax,0x19
add ecx,0xA
mov [ebp-0x30],edx
mov [ebp-0x2C],eax
mov [ebp-0x28],ecx
popad
push eax
push [ebp-0x24]
lea eax,[ebp-0x34]
jmp ReturnAddy
}
}







void ItemVacOn (HWND hWnd)
{
      memcpy( (void*)bItemVac1, (void*)0x004B44E7, 16 );
      memcpy( (void*)bItemVac2, (void*)0x004B44E8, 16 );
      memcpy( (void*)bItemVac3, (void*)0x004B44EB, 16 );



*(BYTE*)0x004B44E7 = 0xE9;
*(DWORD*)(0x004B44E7+1) = JMP( 0x004B44E7, ItemVacHook );
*(WORD*)(0x004B44E7 + 5) = 0x9090; // 90 90


}


void ItemVacOff (HWND hWnd)
{
   memcpy( (void*)0x004B44E7, (void*)bItemVac1, 16 );
   memcpy( (void*)0x004B44E8, (void*)bItemVac2, 16 );
   memcpy( (void*)0x004B44EB, (void*)bItemVac2, 16 );
}




Original Script:

Code:

[Enable]
alloc(ItemVac,128)
label(return)
ItemVac:
pushad
mov ecx,[ebp+8]
mov ebx,[ebp-24]
mov [ecx],ebx
mov [ecx+4],eax
mov ecx,eax
mov eax,ebx
lea edx,[eax-19]
mov [ebp-34],edx
lea edx,[ecx-32]
add eax,19
add ecx,A
mov [ebp-30],edx
mov [ebp-2C],eax
mov [ebp-28],ecx
popad
push eax
push [ebp-24]
lea eax,[ebp-34]
jmp return
004B44E7: //50 FF 75 DC 8D 45 CC 50 FF 15
jmp ItemVac
nop
nop
return:

[Disable]
004B44E7:
push eax
push [ebp-24]
lea eax,[ebp-34]

_________________
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Fri Nov 21, 2008 9:36 pm    Post subject: Reply with quote

Code:
DWORD ReturnAddy = 0x004B44E7;

jmp ReturnAddy


make sure that the return addy is the main addy + 5

Code:
DWORD ReturnAddy = (0x004B44E7 + 5);

_________________
Back to top
View user's profile Send private message Send e-mail
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Fri Nov 21, 2008 10:21 pm    Post subject: Reply with quote

Code:
*(WORD*)(0x004B44E7 + 5) = 0x9090; // 90 90


Lol is it just me or do I think this will crash.
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Fri Nov 21, 2008 10:30 pm    Post subject: Reply with quote

_void_ wrote:
Code:
*(WORD*)(0x004B44E7 + 5) = 0x9090; // 90 90


Lol is it just me or do I think this will crash.
Just you meng. pz.
_________________
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Fri Nov 21, 2008 10:30 pm    Post subject: Reply with quote

_void_ wrote:
Code:
*(WORD*)(0x004B44E7 + 5) = 0x9090; // 90 90


Lol is it just me or do I think this will crash.


Uhh..its just you?
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Fri Nov 21, 2008 10:31 pm    Post subject: Reply with quote

_void_ wrote:
Code:
*(WORD*)(0x004B44E7 + 5) = 0x9090; // 90 90


Lol is it just me or do I think this will crash.


It's just you. This will not crash...unless it is not supposed to be noped. If it is, the it'll work.

_________________
Back to top
View user's profile Send private message Send e-mail
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sat Nov 22, 2008 5:05 am    Post subject: Reply with quote

You know that Item Vac can be done by changing only one byte...
I found that there's a conditional jump (jne) below this item vac address you used (right after the PtInRect call, by changing it to jmp it will ignore what PtInRect returned), if you change it to jmp (0xEB) you will still be able to pick up items from distance.

Try debugging (with OllyDBG or something) and see what happens.

And this:
Code:
   memcpy( (void*)0x004B44E7, (void*)bItemVac1, 16 );
   memcpy( (void*)0x004B44E8, (void*)bItemVac2, 16 );
   memcpy( (void*)0x004B44EB, (void*)bItemVac2, 16 );

Is pretty stupid, couldn't you just copy all bytes from 0x004B44E7 to 0x004B44EB+0x10 (0x004B44FB - 0x004B44E7 = 0x14 = 20)?

just:
Code:
memcpy(bItemVac, (LPVOID)0x004B44E7, 20);
and:
memcpy((LPVOID)0x004B44E7, bItemVac, 20);
Back to top
View user's profile Send private message
iRiot
Master Cheater
Reputation: 0

Joined: 03 Jul 2007
Posts: 395
Location: Aka RIOT

PostPosted: Sat Nov 22, 2008 8:28 am    Post subject: Reply with quote

thanks guys it works now

@symbol
yea i think i saw something on ragezone about a couple of months ago about a 1 address item vac and it worked to lol

_________________
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sat Nov 22, 2008 11:27 am    Post subject: Reply with quote

Symbol wrote:
You know that Item Vac can be done by changing only one byte...
I found that there's a conditional jump (jne) below this item vac address you used (right after the PtInRect call, by changing it to jmp it will ignore what PtInRect returned), if you change it to jmp (0xEB) you will still be able to pick up items from distance.

Try debugging (with OllyDBG or something) and see what happens.

And this:
Code:
   memcpy( (void*)0x004B44E7, (void*)bItemVac1, 16 );
   memcpy( (void*)0x004B44E8, (void*)bItemVac2, 16 );
   memcpy( (void*)0x004B44EB, (void*)bItemVac2, 16 );

Is pretty stupid, couldn't you just copy all bytes from 0x004B44E7 to 0x004B44EB+0x10 (0x004B44FB - 0x004B44E7 = 0x14 = 20)?

just:
Code:
memcpy(bItemVac, (LPVOID)0x004B44E7, 20);
and:
memcpy((LPVOID)0x004B44E7, bItemVac, 20);
It will not work on real MapleStorys. By changing just one jump, you are not changing the character coordinates in the packet (stored in local variables).
_________________
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sat Nov 22, 2008 2:26 pm    Post subject: Re: [c++] Asm Reply with quote

Well, I never tried, but..:
iRiot wrote:
Well iam trying to code in the Item Vac hack for the maplestory ... yes i know its patched but iam using it for pirvate servers..
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