All pastes #604744 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-07-05 19:24 UTC
rendered paste body
FileMapping:
  xor   eax,eax
  push  eax                               ; dwMaximumSizeLow
  push  ecx                               ; dwMaximumSizeLow
  push  eax                               ; dwMaximumSizeHigh
  push  00000004h                         ; flProtect (PAGE_READWRITE)
  push  eax                               ; lpAttributes
  push  [ebp + FileHandle]                ; hFile
  call  [ebp + AddrCreateFileMappingA]    ; CreateFileMappingA
  ret



MapFile:
  xor   eax, eax
  push  ecx                               ; dwNumberOfBytesToMap
  push  eax                               ; dwFileOffsetLow
  push  eax                               ; dwFileOffsetHigh
  push  00000004h OR 00000002h            ; dwDesiredAccess (FILE_MAP_WRITE|FILE_MAP_READ)
  push  [ebp + FileMap]                   ; hFileMappingObject
  call  [ebp + AddrMapViewOfFile]         ; MapViewOfFile
  ret