first of all, I know if I was writing pure assembly, I could (and would..) simply write the strings in the .data section or similar. However, in my use-case, that is not an option.
I am using python, and the keystone framework, so no .data section. The task is to execute CreateFile (Windows assembly). How in the world do you make a string like "C:\mine.exe" and put it into RCX??
I have tried qword...I've tried pushing 3 separate values onto the stack and then pointing the stack to rcx. Any direction I can get would be helpful. rax holds the address of CreateFileA (well, its stub in kernel32.dll anyway). RCX = 1.tx (trying to be simple...just something small as a test.
" mov QWORD PTR [rsp+48], 0 ;"
" mov DWORD PTR [rsp+40], 128 ;"
" mov DWORD PTR [rsp+32], 2 ;"
" xor r9d, r9d ;"
" xor r8d, r8d ;"
" mov edx, 1073741824 ;"
" mov rcx, 0x00000000312e7479 ;"
" int3 ;"
" call rax ;"
" mov QWORD PTR hFile$[rsp], rax ;"
The below code shows another method, in which I store the values on the stack, then try and point rsp to rcx.
" mov QWORD PTR [rsp+48], 0 ;"
" mov DWORD PTR [rsp+40], 128 ;"
" mov DWORD PTR [rsp+32], 2 ;"
" xor r9d, r9d ;"
" xor r8d, r8d ;"
" mov edx, 1073741824 ;"
" push 2e747874h ;"
" push 5c746573h ;"
" push 656e7473h ;"
" push 6f63756dh ;"
" push 696e5c44h ;"
" push 5c61646dh ;"
" push 73657273h ;"
" push 433a5c55h ;"
" int3 ;"
" mov rcx, rsp ;"
" call rax ;"
" mov QWORD PTR hFile$[rsp], rax ;"