All pastes #828178 Raw Edit

Untitled

public text v1 · immutable
#828178 ·published 2007-12-22 08:26 UTC
rendered paste body
.386
.model flat,stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

.data
windowname db "Hi there :p",0
writebuf db 90h,90h,90h,90h,90h
er_01 db "Blah Blah",0 ;just in case
er_02 db "error...",0                 ;same
er_03 db "error",0            ;here too

.data?
hInstance dd ?
windowhandle dd ?
processid dd ?
hProcess dd ?

.code
start:
;--> get the handle of our module
    invoke GetModuleHandle,NULL
    mov hInstance,eax
;-->CHECK IF PROCESS LAUNCHED BLAH BLAH
    invoke FindWindow,NULL,addr windowname
    test al,al
    jz eror_1
    mov windowhandle,eax
;-->get the processid from the windowhandle
    invoke GetWindowThreadProcessId,windowhandle,addr processid
;--> finally open the process
    invoke OpenProcess,PROCESS_ALL_ACCESS,FALSE,processid
    test al,al
    mov hProcess,eax
    jz eror_3
;-->Write process stuff here							     
  WRITEPROCESSMEMORY STUFF HERE
invoke writeprocessmemory blah blah
end start