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 


help

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

Joined: 09 Feb 2009
Posts: 289

PostPosted: Wed Jul 08, 2009 5:22 pm    Post subject: help Reply with quote

so i made a assembly script but how can i put this in my c++ script?

this is it
Quote:
// DVType Value 0 = Items will land on you

[ENABLE]
registersymbol(dvtype)
alloc(dv,100)
alloc(uvx,100)
alloc(uvy,100)
alloc(dvtype,4)
label(normalx)
label(normaly)
label(endx)
label(endy)
label(backdv)
label(backuvy)
label(backuvx)
label(dvzero)
label(dvone)
label(uvzero)
label(uvone)

dv:
mov eax, [820efc]
push eax
mov eax, [eax+638]
mov [ebx+450], eax
cmp [dvtype], 0
je dvzero
cmp [dvtype], 1
je dvone
sub eax, 100
jmp dvzero

dvone:
add eax, 100

dvzero:
mov [ebx+448], eax
pop eax
mov eax, [eax+63C]
mov [ebx+44C], eax
mov [ebx+454], eax
jmp backdv

uvx:
push ecx
mov ecx, [820efc]
add ecx,638
cmp ebx, ecx
je normalx
mov ecx, [ecx]
cmp [dvtype], 0
je uvzero
cmp [dvtype], 1
je uvone
sub ecx, 100
jmp uvzero

uvone:
add ecx, 100

uvzero:
cmp [ebx],ecx
je endx

normalx:
mov [ebx],eax

endx:
pop ecx
mov edi, [ebp+10]
jmp backuvx

uvy:
push ecx
mov ecx, [820efc]
add ecx,63C
cmp edi, ecx
je normaly
mov ecx, [ecx]
cmp [edi],ecx
je endy

normaly:
mov [edi],eax

endy:
pop ecx
mov ebx, [ebp+14]
jmp backuvy

005474F6:
jmp dv
nop
backdv:

006F5DCA:
jmp uvx
backuvx:

006F5E2F:
jmp uvy
backuvy:

[DISABLE]
005474F6:
mov [ebx+00000454],eax

006F5DCA:
mov [ebx],eax
mov edi, [ebp+10]

006F5E2F:
mov [edi],eax
mov ebx, [ebp+14]

dealloc(dv)
dealloc(uvx)
dealloc(uvy)
dealloc(dvtype)
unregistersymbol(dvtype)


i tried to find tut but couldnt find
Back to top
View user's profile Send private message
BanMe
Master Cheater
Reputation: 0

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Wed Jul 08, 2009 5:47 pm    Post subject: Reply with quote

well you cannot directly include that script into any programming language other then AA without some framework built up that handles the code.. Wink I suggest looking at the source.. I have not looked at that specific area. But you will probably find a string parser that interprets strings and #'s into actual behaviors..

ie it is likely that:

Code:

006F5E2F:
mov [edi],eax
mov ebx, [ebp+14]


generates a call to writeprocessmemory in some form.. with 006f5e2f passed in as the base address.a also likely that : is a deliminator for code that is then interpolated into opcodes and probably sent to a buffer that is also passed into writeprocessmemory..

I hope this helps, even though its just a educated guess at what might be there Wink

regards BanMe

_________________
don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you.
Back to top
View user's profile Send private message MSN Messenger
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Wed Jul 08, 2009 5:50 pm    Post subject: Reply with quote

You can use inline assembly...google it for more details.
Here is a random example i found:

Code:
#include <stdio.h>

char format[] = "%s %s\n";
char hello[] = "Hello";
char world[] = "world";
void main( void )
{
   __asm
   {
      mov  eax, offset world
      push eax
      mov  eax, offset hello
      push eax
      mov  eax, offset format
      push eax
      call printf
      pop  ebx
      pop  ebx
      pop  ebx
   }
}

_________________
Back to top
View user's profile Send private message
BanMe
Master Cheater
Reputation: 0

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Wed Jul 08, 2009 6:08 pm    Post subject: Reply with quote

read what the OP said..
Quote:

so i made a assembly script but how can I put this in my c++ script?


regards BanMe

_________________
don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you.
Back to top
View user's profile Send private message MSN Messenger
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Thu Jul 09, 2009 3:02 pm    Post subject: Reply with quote

i dont understand it, some1 explain please
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Thu Jul 09, 2009 6:46 pm    Post subject: Reply with quote

Inline assembly is a feature in some programming languages that allows you to use assembly in your program code. The general syntax for C++ is:

Code:

_asm {
   //assembly code here
}


But your code is in auto assembly, which isn't actual assembly you could use, so you would have to convert it to assembly, and then use inline assembly to use it in your program.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
BanMe
Master Cheater
Reputation: 0

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Thu Jul 09, 2009 7:41 pm    Post subject: Reply with quote

or write a "parser" like I suggested..a parser is something that will take the Auto Assembly script and interpret the script into logical behavioral patterns..

or you could just rewrite your AA script into asm.. for example
this code in AA
Code:

006F5DCA:
mov [ebx],eax
mov edi, [ebp+10]


would rewrite into this in C++ and compiled would be the same as asm..

Code:

SIZE_T BytesWritten = 0;
BYTE Buff[5] = {0x89,0x03,0x8b,0x7d,0x10};
WriteProcessMemory(hProcess,0x6f5dca,&Buff,sizeof(Buff),&BytesWritten);


regards BanMe

_________________
don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you.
Back to top
View user's profile Send private message MSN Messenger
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Fri Jul 10, 2009 9:26 am    Post subject: Reply with quote

i think its to hard for me to write it in c++, so i have to make it in ASM, whats the difference between Auto ASM and ASM

thanks guys
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