I have found a code cave in an executable and want to call winapi functions.

What do i have to write in the assembly window to create a string which can later be referenced?

For learning i changed not used existing strings in the executable (with an hexeditor) and pushed their address on the stack. This works. But how can i create them by myself?

(this is a crosspost from stackoverflow)

1 Answer 1


In most standalone assemblers you can use the db directive to put literal bytes or character strings into the program. However, I'm not sure if it will work in ollydbg since its assembler is mainly intended for assembling instructions, not data. I would suggest instead to use the hex dump window for that. (I think it can be used for editing text)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.