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 


[QUESTION] wtf is this and how do i fit this in?

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

Joined: 16 Mar 2007
Posts: 366
Location: Bellocan / The dragon nest left behind

PostPosted: Wed Feb 20, 2008 1:31 am    Post subject: [QUESTION] wtf is this and how do i fit this in? Reply with quote

Code:
Alloc( MyCode, 2048 )    ; Allocate 2,048 bytes and store the allocated address into MyCode, which we use as the location where our new code goes.
Label( OverwrittenCode ) ; The code that was overwritten by the JMP to MyCode will go here.
Label( Exit )            ; JMP here to exit our custom code and go back to the original code.
Label( Return )          ; The location of the next instruction of the original code.

FullAccess( 0x00400000, 2048 )
0x00400000 :
jmp MyCode
Return :






MyCode :                 ; The allocated address.  Put your code after this.






OverwrittenCode :        ; The overwritten code (code that was overwritten by the JMP to MyCode).
dec     ebp
pop     edx
nop
add     byte ptr [ebx], al






Exit :                   ; Automatic JMP back to the original code, or you can JMP Return directly to avoid coming here.
jmp Return



what kind of code is it?
and how do i fit this in there
Code:
[Enable]

//NoDelay JMP
//40355E - EIP->403561

//NoDelay NOP1
//5F28EE - EIP->5F28F1

//NoDelay NOP2
//5F2902 - EIP->5F2909

//NoDelay NOP3
//593605 - EIP->59360E

[Disable]


thanks to ferris for this code

_________________
rep me if you like Red Hot Chili Peppers
Back to top
View user's profile Send private message Send e-mail
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Feb 20, 2008 7:24 pm    Post subject: Reply with quote

It's CE script. The code that Cheat Engine uses in it's ASM script engine.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Wed Feb 20, 2008 8:48 pm    Post subject: Reply with quote

If you aren't familiar with the FULLACCESS command I believe it's a wrapper for VirtualProtect (PAGE_EXECUTE_READWRITE).
_________________
Back to top
View user's profile Send private message
ElverGone
Master Cheater
Reputation: 0

Joined: 16 Mar 2007
Posts: 366
Location: Bellocan / The dragon nest left behind

PostPosted: Wed Feb 20, 2008 9:07 pm    Post subject: Reply with quote

Wiccaan wrote:
It's CE script. The code that Cheat Engine uses in it's ASM script engine.

i took it from MHS Surprised

_________________
rep me if you like Red Hot Chili Peppers
Back to top
View user's profile Send private message Send e-mail
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Feb 20, 2008 10:11 pm    Post subject: Reply with quote

ElverGone wrote:
Wiccaan wrote:
It's CE script. The code that Cheat Engine uses in it's ASM script engine.

i took it from MHS Surprised


Congrats?

Sponge wrote:
If you aren't familiar with the FULLACCESS command I believe it's a wrapper for VirtualProtect (PAGE_EXECUTE_READWRITE).


FULLACCESS calls VirtualProtectEx with PAGE_EXECUTE_READWRITE as the param. (As seen in autoassembler.pas:)

Code:
    //unprotectmemory
    for i:=0 to length(fullaccess)-1 do
    begin
      virtualprotectex(processhandle,pointer(fullaccess[i].address),fullaccess[i].size,PAGE_EXECUTE_READWRITE,op);

      if (fullaccess[i].address>80000000) and (DarkByteKernel<>0) then
        MakeWritable(fullaccess[i].address,(fullaccess[i].size div 4096)*4096,false);
    end;

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Negima
I post too much
Reputation: 6

Joined: 22 May 2007
Posts: 2221

PostPosted: Wed Feb 20, 2008 11:03 pm    Post subject: Reply with quote

Code:
[Enable]

//NoDelay JMP
//40355E - EIP->403561

//NoDelay NOP1
//5F28EE - EIP->5F28F1

//NoDelay NOP2
//5F2902 - EIP->5F2909

//NoDelay NOP3
//593605 - EIP->59360E

[Disable]


All of the opcodes are written into comments....
Back to top
View user's profile Send private message Visit poster's website
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Thu Feb 21, 2008 12:56 am    Post subject: Reply with quote

Wiccaan wrote:
ElverGone wrote:
Wiccaan wrote:
It's CE script. The code that Cheat Engine uses in it's ASM script engine.

i took it from MHS Surprised


Congrats?

Sponge wrote:
If you aren't familiar with the FULLACCESS command I believe it's a wrapper for VirtualProtect (PAGE_EXECUTE_READWRITE).


FULLACCESS calls VirtualProtectEx with PAGE_EXECUTE_READWRITE as the param. (As seen in autoassembler.pas:)

Code:
    //unprotectmemory
    for i:=0 to length(fullaccess)-1 do
    begin
      virtualprotectex(processhandle,pointer(fullaccess[i].address),fullaccess[i].size,PAGE_EXECUTE_READWRITE,op);

      if (fullaccess[i].address>80000000) and (DarkByteKernel<>0) then
        MakeWritable(fullaccess[i].address,(fullaccess[i].size div 4096)*4096,false);
    end;
close enuff.
_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu Feb 21, 2008 9:26 am    Post subject: Reply with quote

Code:
[Enable]

//NoDelay JMP
//40355E - EIP->403561

//NoDelay NOP1
//5F28EE - EIP->5F28F1

//NoDelay NOP2
//5F2902 - EIP->5F2909

//NoDelay NOP3
//593605 - EIP->59360E

[Disable]


You can't fit that in there, it's saying that you need to set the value of EIP at the address, I think.
Back to top
View user's profile Send private message MSN Messenger
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