News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

DLL's and Functions

Started by Static, July 26, 2005, 12:11:57 PM

Previous topic - Next topic

psylem

Looks like you are returning a memory location address instead of the actual value at that location.

Nonameo

Welcome aboard

I'd use wsprintf

----------------

.data
format   db "%i",0

.data?
output  db 20 dup (?)

.code
;lets say the value from readprocessmemory is in eax
invoke wsprintf, offset output, offset format, eax

------------

that should return a string in "output" of your value

-Nonameo-

tenkey

Quote from: Static on July 28, 2005, 10:41:26 AM
Yea I guess it will be more or less the same as delphi. It only uses 2 data types as I previously said, String and Real. Someone at the gamemaker forums said:
QuoteGameMaker can only pass real values as IEEE double precision floating points (64-bits). Return values must also be doubles.
I don't know if that means anything to you.
But when I set the return to be ty_real, then use a built-in gamemaker function to turn it into a string, I ALWAYS end up with 9223372036854775808

So ty_real is a REAL8. Integers will need to be converted. There are two ways a REAL8 can be passed back. Either through the double register EDX:EAX, or via the FP stack. I don't know what Delphi uses.

Someone may need to correct my FP code, but do something like the following...
.data
one REAL8 1.0
ten REAL8 10.0

.code
fld one
mov eax,dword ptr [ten+0]
mov edx,dword ptr [ten+4]
ret


If you get 1, then the ty_real value is returned on the FP stack (the FLD instruction does this).
If you get 10, the register pair EDX and EAX holds the ty_real return value. EAX will hold the "least significant" bits, and EDX will hold the "most significant" bits.
If you get something else, you will need to consult your experts again.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8