Page 1 of 1

Cannot assign a Value to a memory record

Posted: Thu Nov 25, 2021 4:04 pm
by S1N74X
Hi,

noob question maybe but is it a bug or am i missing something ?

mr = al.createMemoryRecord() --self explanory
mr.setAddress(DEADBEEF) --self explanory
mr.Description = "something" --self explanory
mr.Type = 4 --for float Value
mr.Value = 10 <<------- I would expect the value to be assigned here
But the Result is ?? instead
Any suggestions or tips ?

Thanks for any usefull help.

Re: Cannot assign a Value to a memory record

Posted: Thu Nov 25, 2021 5:33 pm
by Eric
is the address correct ?

Re: Cannot assign a Value to a memory record

Posted: Fri Nov 26, 2021 1:24 pm
by S1N74X
Eric wrote:
Thu Nov 25, 2021 5:33 pm
is the address correct ?
Its not a "real" Address. Its a created one.
I felt that this would be possible.

Re: Cannot assign a Value to a memory record

Posted: Fri Nov 26, 2021 1:39 pm
by LeFiXER
S1N74X wrote:
Fri Nov 26, 2021 1:24 pm
Its not a "real" Address. Its a created one.
I felt that this would be possible.
The address has to exist to be able to write a value to it.

Re: Cannot assign a Value to a memory record

Posted: Fri Nov 26, 2021 4:16 pm
by S1N74X
LeFiXER wrote:
Fri Nov 26, 2021 1:39 pm
S1N74X wrote:
Fri Nov 26, 2021 1:24 pm
Its not a "real" Address. Its a created one.
I felt that this would be possible.
The address has to exist to be able to write a value to it.
Ok. Is it possible to create a real Address in LUA or get the Address of a LUA Variable ?
Creating a symbol wont help
ASM :
alloc(bla,8),
registersymbol(bla)
bla :
dq (float)123.456

"bla" will hold the Value 123.456 but no Address

Re: Cannot assign a Value to a memory record

Posted: Fri Nov 26, 2021 4:54 pm
by LeFiXER
S1N74X wrote:
Fri Nov 26, 2021 4:16 pm
Ok. Is it possible to create a real Address in LUA or get the Address of a LUA Variable ?
Creating a symbol wont help
ASM :
alloc(bla,8),
registersymbol(bla)
bla :
dq (float)123.456

"bla" will hold the Value 123.456 but no Address
There are some functions you can use:

Code: Select all

allocateMemory(size, BaseAddress OPTIONAL, Protection OPTIONAL): Allocates some memory into the target process
deAlloc(address, size OPTIONAL): Frees allocated memory
Note: case sensitive

It's worth reading through the celua.txt file [Link].

A symbol is a reference to the address with a more memorable identifier than just a bunch of alphanumeric characters.

"bla" is the reference to the address, "[bla]" is the value held at the address "bla". You could use Lua to get the address after the symbol has been registered:

Code: Select all

local myaddress = getAddressSafe('bla')
if myaddress ~= nil then
  print(string.format("%X", myaddress))
end

Re: Cannot assign a Value to a memory record

Posted: Mon Nov 29, 2021 12:24 pm
by S1N74X
LeFiXER wrote:
Fri Nov 26, 2021 4:54 pm
S1N74X wrote:
Fri Nov 26, 2021 4:16 pm
Ok. Is it possible to create a real Address in LUA or get the Address of a LUA Variable ?
Creating a symbol wont help
ASM :
alloc(bla,8),
registersymbol(bla)
bla :
dq (float)123.456

"bla" will hold the Value 123.456 but no Address
>> A symbol is a :!: reference to the address :!: with a more memorable identifier than just a bunch of alphanumeric characters <<
>> :!: 'bla" :!: is the reference to the address , :!: "[bla]" :!: is the value held at the address "bla" <<
Thank you very much.
That fixed my Problem :)
+1

Re: Cannot assign a Value to a memory record

Posted: Mon Nov 29, 2021 12:26 pm
by LeFiXER
S1N74X wrote:
Mon Nov 29, 2021 12:24 pm
Thank you very much.
That fixed my Problem :)
+1
You're welcome :). Glad I could help.