EMO Style ForumPro - Hos Geldiniz
Delphi - Writing To Memory Uyeols10

Join the forum, it's quick and easy

EMO Style ForumPro - Hos Geldiniz
Delphi - Writing To Memory Uyeols10
EMO Style ForumPro - Hos Geldiniz
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 203 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: crayzboy76

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Anahtar-kelime

loot  kutu  pointer  

Kimler hatta?
Toplam 3 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 3 Misafir

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
Delphi - Writing To Memory I_icon_minitimeCuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
Delphi - Writing To Memory I_icon_minitimeCuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
Delphi - Writing To Memory I_icon_minitimeÇarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
Delphi - Writing To Memory I_icon_minitimePtsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
Delphi - Writing To Memory I_icon_minitimeC.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
Delphi - Writing To Memory I_icon_minitimeÇarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
Delphi - Writing To Memory I_icon_minitimeÇarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
Delphi - Writing To Memory I_icon_minitimeÇarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
Delphi - Writing To Memory I_icon_minitimePtsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

Delphi - Writing To Memory

Aşağa gitmek

Delphi - Writing To Memory Empty Delphi - Writing To Memory

Mesaj tarafından EMO C.tesi Haz. 18, 2011 11:12 pm

[quote='lolsee2' pid='123270' dateline='1306652115']
A short tutorial on writing memory to a process.

~Stating the Variables
Var
Pid: Integer;
Pidhandle: integer;


I'll explain it One by one

Pid The process id which is needed for us to write to memory
Pidhandle Kinda of same thing but a little different

Right now the value is at 0 because we have not used it

~Stating the Constant
Const
process = 'PRocess.exe'

Ok, Now we are stating what the process Is, In this case, fill out your process your going to write to.

Now Time to find the ID of a Process.
~Finding ID

First of all Add tlhelp32 to the uses list because this function requires it.

function GetID(Const ExeFileName: string; var ProcessId: integer): boolean;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
result := false;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do begin
if (StrIComp(PChar(ExtractFileName(FProcessEntry32.szExeFile)), PChar(ExeFileName)) = 0)
or (StrIComp(FProcessEntry32.szExeFile, PChar(ExeFileName)) = 0) then begin
ProcessId:= FProcessEntry32.th32ProcessID;
result := true;
break;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;

Now mainly focus on this Line

function GetID(Const ExeFileName: string; var ProcessId: integer): boolean;

This is the Function: GetID The Parameters are, The FILENAME, and THE PID which you have stated.


Let's use it!

~Using GetID();
Let's do this on a Button Click, and it will Show the Value of ID.

procedure TForm1.Button1Click(Sender: TObject);
begin
if GetID(process, Pid) then
Showmessage(IntToStr(Pid));


Now you Have your GetID function!
~Writing Memory

WriteProcessMemory(Pidhandle, Pointer(Address), @NewValue, Data, Written);

The WPM needs, The Process Handle, THe Addres, The New Value, the size of the Value/address(forgot O.O) and the Write. State it like this.

Var
Address: Cardinal
NewValue: Integer;
Data: Integer;
Written: Cardinal

REMEMBER!
byte = 1 byte
word = 2 bytes
cardinal = 4 bytes

This seems alright but now, How do We get the PIDHANDLE?

~OpenProcess
We will use OpenProcess() to get the PidHandle
Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid);


~Getting it All Together

Var
Pid: Integer;
Pidhandle: integer;
Address: Cardinal
NewValue: Integer;
Data: Integer;
Written: Cardinal;

procedure TForm1.Button1Click(Sender: TObject);
begin

Address := $04000000;
NewValue := 666;
Data := 4;

if GetID(process,Pid) then
begin
Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid);
WriteProcessMemory(Pidhandle, Pointer(Address), @NewValue, Data, Written);
closehandle(Pidhandle);
end else
begin
MessageDlg('OMG What the Fck?! Process Not FOUND!', mtwarning, [mbOK],0);
end;

THe Main overview is that the Program will try to find the Process and If not, a mesage box will appear saying Process Not FOUND!
Hope tt you have learned smth from this tut.

Credits: kaswar.

[/quote]
EMO
EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 184
Puan : 236943
Rep Puanı : 5
Doğum tarihi : 28/11/89
Kayıt tarihi : 18/05/11
Yaş : 34
Nerden : EMO world
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

Sayfa başına dön Aşağa gitmek

Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz