flat assembler
Message board for the users of flat assembler.

Index > Windows > error:about ReadProcessMemory buffer size

Author
Thread Post new topic Reply to topic
zjlcc



Joined: 23 Jul 2003
Posts: 32
Location: china
zjlcc 15 Dec 2004, 06:11
Code:
format PE GUI 4.0 on 'nul'

entry start

include 'myinclude.inc'

start:
  invoke GetStartupInfo,startinfo
  invoke CreateProcess,Notepad_EXE,NULL,NULL,NULL,FALSE,20h,NULL,NULL,startinfo,pinfo
  mov eax,1009000h ;eax is notepad.exe address in my xp os,so sorry ,but it`s no important  
  invoke ReadProcessMemory,dword[pinfo],eax,buf,buf_size,0
  invoke ExitProcess,0

  Notepad_EXE db 'd:\windows\notepad.exe',0
  buf_size=40960       ;ReadProcessMemory can read!
;  buf_size=40960+1     ;ReadProcessMemory can not read! why?
  buf rb buf_size
  startinfo STARTUPINFO
  pinfo PROCESSINFO
    
Post 15 Dec 2004, 06:11
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld 15 Dec 2004, 09:14
maybe that?
Win32 Programmes's Guide wrote:
lpBaseAddress

Points to the base address in the specified process to be read. Before any data transfer occurs, the system verifies that all data in the base address and memory of the specified size is accessible for read access. If this is the case, the function proceeds; otherwise, the function fails.
Post 15 Dec 2004, 09:14
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
zjlcc



Joined: 23 Jul 2003
Posts: 32
Location: china
zjlcc 15 Dec 2004, 10:09
i find it
thank mike.dld Very Happy
Post 15 Dec 2004, 10:09
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.