View previous topic :: View next topic |
Author |
Message |
mOnSoOn Expert Cheater
Reputation: 0
Joined: 05 Jul 2007 Posts: 203
|
Posted: Tue Oct 20, 2009 5:19 pm Post subject: [Q] Memory Writing .. |
|
|
Hi,
I stopped programming like 8 month ago and I forogt a lot. Anyway,
I want to inject my dll to a process (which is something I know). After the dll injected I want to write the process I injected memroy through the dll.
How can I write FROM the dll to the process' memory?
Another question...
Is there anyway to open from the dll (that injected) a form with some lists that I can add to them things from the process (which includes reading from the process...)?
thanks
|
|
Back to top |
|
 |
igoticecream Grandmaster Cheater Supreme
Reputation: 0
Joined: 23 Apr 2006 Posts: 1807 Location: 0x00400000
|
Posted: Tue Oct 20, 2009 8:42 pm Post subject: |
|
|
Since you are in the context of the target process memory, you can do things like
*(DWORD*)0xBADFOOD = 0x90909090;
you are writting four nops at address 0xBADFOOD, of course 0xBADFOOD belongs to the target process memory
_________________
+~ |
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Oct 20, 2009 10:21 pm Post subject: Re: [Q] Memory Writing .. |
|
|
mOnSoOn wrote: | How can I write FROM the dll to the process' memory |
you can just use a pointer to it or use memcpy, dead simple.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25792 Location: The netherlands
|
Posted: Wed Oct 21, 2009 3:13 am Post subject: |
|
|
igoticecream wrote: | Since you are in the context of the target process memory, you can do things like
*(DWORD*)0xBADFOOD = 0x90909090;
you are writting four nops at address 0xBADFOOD, of course 0xBADFOOD belongs to the target process memory |
don't forget to make the memory writable first
_________________
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 |
|
 |
igoticecream Grandmaster Cheater Supreme
Reputation: 0
Joined: 23 Apr 2006 Posts: 1807 Location: 0x00400000
|
Posted: Wed Oct 21, 2009 5:57 am Post subject: |
|
|
Dark Byte wrote: | igoticecream wrote: | Since you are in the context of the target process memory, you can do things like
*(DWORD*)0xBADFOOD = 0x90909090;
you are writting four nops at address 0xBADFOOD, of course 0xBADFOOD belongs to the target process memory |
don't forget to make the memory writable first |
Yea, sometimes the code section is not writeable and you may find exeption 0xc0000005. Use virtualprotect
_________________
+~ |
|
Back to top |
|
 |
mOnSoOn Expert Cheater
Reputation: 0
Joined: 05 Jul 2007 Posts: 203
|
Posted: Wed Oct 21, 2009 8:06 am Post subject: |
|
|
Thanks..
edit:
If I want to hook something like not just changing the address' aobs.
Code: | 004D1E22:
jmp lolFunc
void __declspec (naked) lolFunc(int s)
{
_asm
{
mov eax,ebx
jmp 004D1E24
}
} |
How can I do something like this? Do I need to caclculates the lolFunc aobs or something?
If anyone got a dll source that hooks in an adress and change some addresses, It would be helpful!!
Thanks.
|
|
Back to top |
|
 |
igoticecream Grandmaster Cheater Supreme
Reputation: 0
Joined: 23 Apr 2006 Posts: 1807 Location: 0x00400000
|
Posted: Wed Oct 21, 2009 8:47 pm Post subject: |
|
|
#define JMP(frm, to) (int)(((int)to - (int)frm) - 5)
*(BYTE *)Address = 0xE8;
*(DWORD*)(Address+1) = JMP(Address,SCRIPT);
notice that 0xE8 represent a call, the jmp byte is 0xE9
_________________
+~ |
|
Back to top |
|
 |
NoMercy Master Cheater
Reputation: 1
Joined: 09 Feb 2009 Posts: 289
|
Posted: Thu Oct 22, 2009 8:55 am Post subject: |
|
|
doesnt compile
|
|
Back to top |
|
 |
Guy Expert Cheater
Reputation: 0
Joined: 30 May 2009 Posts: 187
|
Posted: Thu Oct 22, 2009 12:39 pm Post subject: |
|
|
NoMercy wrote: |
doesnt compile |
Use the MASM-syntax:
Code: |
__asm {
JMP DWORD PTR [EAX]
}
|
Jumping to where EAX points to.
Jumping to the value stored in EAX.
Though, note, by using inline ASM with MSVS, you're removing x64-compatibility. I recommend injecting shellcode, or using Windows API functions, or even the MSVS-exclusive Intrinsics.
_________________
Has anyone seen Hitler around..? If so, PM me! |
|
Back to top |
|
 |
|