summaryrefslogtreecommitdiff
path: root/vstdlib/getstackptr64.masm
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /vstdlib/getstackptr64.masm
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'vstdlib/getstackptr64.masm')
-rw-r--r--vstdlib/getstackptr64.masm17
1 files changed, 17 insertions, 0 deletions
diff --git a/vstdlib/getstackptr64.masm b/vstdlib/getstackptr64.masm
new file mode 100644
index 0000000..52354b6
--- /dev/null
+++ b/vstdlib/getstackptr64.masm
@@ -0,0 +1,17 @@
+; call cpuid with args in eax, ecx
+; store eax, ebx, ecx, edx to p
+PUBLIC GetStackPtr64
+.CODE
+
+GetStackPtr64 PROC FRAME
+; unsigned char* GetStackPtr64(void);
+ .endprolog
+
+ mov rax, rsp ; get stack ptr
+ add rax, 8h ; account for 8-byte return value of this function
+
+ ret
+
+GetStackPtr64 ENDP
+_TEXT ENDS
+END