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 


Why dll injection? Dll injection vs trainer

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

Joined: 11 Jun 2019
Posts: 6

PostPosted: Sun Aug 16, 2020 9:47 am    Post subject: Why dll injection? Dll injection vs trainer Reply with quote

Hey there,

what are the advantages to use dll injection?
With a normal trainer, I can do the same things and I don't need to inject a dll.
So what are the advantages exactly by using dll inejction instead of a normal memory editing (trainer)?

Thanks in advance Smile
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25840
Location: The netherlands

PostPosted: Mon Aug 17, 2020 1:19 am    Post subject: Reply with quote

you can write your code in a language you know instead of learning a lot of assembler

e.g a code injection as set health
you can do :
Code:

mov [rax+248],#1000


but in a dll you could do
Code:

void sethealth(structurethatdefinestheplayer *player)
{
  player->health=1000
}
....
asm:
yourinjectionspot:
jmp newmem
originalcode:

newmem:
pushfq
push RAX
push RCX
push RDX
push R8
push R9
push R10
push R11


//also save the xmm registers if your code uses floats
sub rsp,20  //allocate 32 bytes for scratchspace
mov rcx,rax //pass rax as parameter
call yourdll.sethealth
add rsp,20

pop r11
pop r10
pop r9
pop r8
pop rdx
pop rcx
pop rax
popfq
jmp originalcode


which is so much easier, as you can do player->health=1000

lol

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Timm3D
How do I cheat?
Reputation: 0

Joined: 11 Jun 2019
Posts: 6

PostPosted: Mon Aug 17, 2020 9:56 am    Post subject: Reply with quote

Ok, but with languages like C# (.NET) you don't have a dllmain function (export). So how do I inject and call the dll there?
Shocked
Back to top
View user's profile Send private message
JohnathanSweeney
Newbie cheater
Reputation: 1

Joined: 04 Apr 2016
Posts: 20

PostPosted: Mon Aug 17, 2020 3:07 pm    Post subject: Reply with quote

Timm3D wrote:
Ok, but with languages like C# (.NET) you don't have a dllmain function (export). So how do I inject and call the dll there?
Shocked


It is not normal to inject .NET managed code into a native unmanaged process.

Typically you are writing the DLL which you are injecting with C++.

If you want to inject a C# file into a native process there is only one library I have had success with: DNCI - Dot Net Code Injector, you can find it on github

Works right out of the box, it includes test DLLs.
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 Gamehacking 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