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 


Autoassemble.dll?

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

Joined: 30 Aug 2011
Posts: 114
Location: ::1

PostPosted: Mon Apr 30, 2012 4:11 pm    Post subject: Autoassemble.dll? Reply with quote

If I were to write a trainer in C# that would write jmp [specific address] to somewhere, then how would I do it? From what I have seen, every time you put it at a different location, the bytes change... What and where is autoassemble.dll? Should I use that? I would be using C#.
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Mon Apr 30, 2012 7:10 pm    Post subject: Reply with quote

The operand for JMP is the relative offset added to the instruction pointer (after JMP completes) to get to new location.

Example:
0x00400000 - 0xEB 0x1E - JMP 0x00400020

0xEB stands for an 8-bit relative JMP, and 0x1E is the offset (0x20 - sizeof(JMP rel8)).

See http://ref.x86asm.net/ for other opcodes.
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Tue May 01, 2012 5:25 am    Post subject: Reply with quote

I just made this now, tested it in my memory class, works fine.
Len <- the length to the next instruction atleast 5 bytes away, the rest gets nopped.
DoJump <- Put true for jump, Put false for call

Code:
    public byte[] JmpCall(IntPtr Cave, int JumpFrom, int Len, bool DoJump)
    {
        if (Len < 5) return null;
        byte[] tmp = BitConverter.GetBytes((int)Cave - JumpFrom - 5);
        byte[] byts = new byte[Len];
        byts[0] = DoJump ? (byte)0xE9 : (byte)0xE8;
        for (int i = 1; i < byts.Length; i++)
        {
            byts[i] = i < 5 ? tmp[i - 1] : (byte)0x90;
        }
        return byts;
    }


But this is only to get to the cave. You'l still need to make something to return or jump back from the cave to the next instruction.
It would be reversed for jumping back. NextInstruc - Cave - 5
Cave location would be (Cave + Length of injection)
NextInstruc location would be (JumpFrom + Len)

_________________
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