title: What is the GENERIC_WRITE constant hex value in windows?
body: <p>I'm trying to open a file for writing using the CreatFileA system call in assembly in x64, however in order to do so I need to specify the desired access. I don't know what the constant is for GENERIC_WRITE, the GENERIC_READ constant is 80000000h.</p>
  
  <pre><code>; create the file
  lea rcx, fileName
  mov rdx, 40000000h
  xor r8, r8
  xor r9, r9
  mov QWORD PTR [rsp+48h-28h], 2
  mov QWORD PTR [rsp+48h-20h], 80h
  mov QWORD PTR [rsp+48h-18h], 0
  call CreateFileA
  mov FD2, rax
  
  ; write to the new file
  lea rcx, FD2
  lea rdx, buffer
  mov r8, len
  lea r9, written
  mov QWORD PTR [rsp+48h-28h], 0
  call WriteFile
  mov writeResult, rax
  </code></pre>