I'm in the process of learning to program in assembly. The reason for this is to become a better reverse engineer. My problem is:
I'm building a very basic 64-bit executable in Windows. I want to write a function in ASM (x64 instructions) and call it from my C++ program. I'm using Visual Studio 2019 Community. In fact, the ASM function I wrote is below. All it's supposed to do is grab the address of the Process Environment Block without leveraging the Native/Win32 APIs. How would I call this inside VS?
global getPEB
getPEB:
push rbp
mov rbp, rsp
lea rax, gs:[0x60]
leave
ret