| View previous topic :: View next topic |
| Author |
Message |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat Aug 04, 2007 4:57 pm Post subject: WriteProcessMemory Help =) |
|
|
i googled and i found some codes...
so heres 1:
| Code: | var
WindowName: Integer;
ProcessId: Integer;
ThreadId: Integer;
buf: PChar;
HandleWindow: Integer;
Write: Cardinal;
{....}
const
WindowTitle = 'a program name';
Address = $A662D6;
PokeValue = $4A;
NumberOfBytes = 2;
{....}
procedure TForm1.Button1Click(Sender: TObject);
begin
WindowName := FindWindow(nil, WindowTitle);
if WindowName = 0 then
begin
MessageDlg('Program not running.', mtWarning, [mbOK], 0);
end;
ThreadId := GetWindowThreadProcessId(WindowName, @ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessId);
GetMem(buf, 1);
buf^ := Chr(PokeValue);
WriteProcessMemory(HandleWindow, ptr(Address), buf, NumberOfBytes, Write);
FreeMem(buf);
CloseHandle(HandleWindow);
end;
|
where its a comment (like {...}) theres the rest of the script...
what do i need to change in here i dont get everythin here...
| Quote: | ThreadId := GetWindowThreadProcessId(WindowName, @ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessId);
//=======================================
GetMem(buf, 1);
buf^ := Chr(PokeValue);
WriteProcessMemory(HandleWindow, ptr(Address), buf, NumberOfBytes, Write);
FreeMem(buf);
CloseHandle(HandleWindow);
end;
|
ok, above the comment line i dont understand anything... O_o
below i think i know what to change but not pretty sure where and how...
buf^ - whats this?
Chr(PokeValue) - change Chr to something or leave it as Chr? and whats a poke value..?
ptr(Address) - ok here comes the address... but as 00112233 (example) or would it be 0x00112233?
number of bytes, like alloc? i guess
after that Write, need to change this or this is part of the code?
FreeMem(buf) - instead buf use a value? like 34 (just an example)
sorry for all the questions... thx to those that just willing to read and answer =)
can u just give me a real example this will be the best ill figure out what i need to change...
thx
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Aug 04, 2007 5:07 pm Post subject: |
|
|
| you should be using xEngine
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat Aug 04, 2007 5:19 pm Post subject: |
|
|
whats this? O_o
umm.. a dll...
how can it help me..? im just trying to learn writeprocessmemory function not making a uce and i have no idea what is this dll for.. =\
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sat Aug 04, 2007 9:02 pm Post subject: |
|
|
The dll contains a wrapper function for WriteProcessMemory. So you can just call the wrapper and then it will do the rest. Params are provided by x0r.
_________________
|
|
| Back to top |
|
 |
Zombi3 Expert Cheater
Reputation: 0
Joined: 02 Aug 2007 Posts: 144
|
Posted: Sat Aug 04, 2007 9:08 pm Post subject: |
|
|
| sponge wrote: | | The dll contains a wrapper function for WriteProcessMemory. So you can just call the wrapper and then it will do the rest. Params are provided by x0r. |
Still haven't heard from you?
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sun Aug 05, 2007 4:50 am Post subject: |
|
|
| Why use the DLL? Lol, its easier to do it yourself.
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sun Aug 05, 2007 10:37 am Post subject: |
|
|
yea i wanna learn how to do this myself...
besides, i dont know how to call it and use it... =\
so how can i do this without calling it?
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sun Aug 05, 2007 5:45 pm Post subject: |
|
|
| Symbol wrote: | yea i wanna learn how to do this myself...
besides, i dont know how to call it and use it... =\
so how can i do this without calling it? |
you want to use WPM without calling it? are you crazy?? all the params and definitions you need are at MSDN.
_________________
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sun Aug 05, 2007 5:49 pm Post subject: |
|
|
im kinda new to ths..
inother words i dont understand a word of what u sayin'...
cant u use it without x0r's dll?
and i dont even know how to use it with the dll...
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sun Aug 05, 2007 5:54 pm Post subject: |
|
|
oh my god... wow....
http://msdn2.microsoft.com/en-us/library/ms681674.aspx
Simplified terms:
| Code: |
hProcess
[in] Handle to the process you want to edit.
lpBaseAddress
[in] Where to write to.
lpBuffer
[in] Information wanted to be written.
nSize
[in] number of bytes you want written.
lpNumberOfBytesWritten
[out] when the API returns it will fill this with how many bytes it wrote. | to find modulehandle use GetModuleHandle
_________________
|
|
| Back to top |
|
 |
|