pharaon wrote: ↑Sun Feb 04, 2018 10:31 pm
hope you can explain to me what those code lines do
define(address,DayNightCycle:GetDayNightCycleTime+2e)
define(bytes,F3 0F 10 46 74)
assert(address,bytes)
globalalloc(getDayNightCycleTime_ptr,4)
mov [getDayNightCycleTime_ptr],rsi
what is rsi value
In your example, rsi is the base address
an example:
movss xmm0,[rsi+00000074] -> opcode
rsi =
[Link] (ex: 1B73C700)
00000074 (or 74) =
[Link]
rsi+00000074 =
[Link] (ex: 1B73C774 => 0.875 sunSetTime) -> the value that you'll find with CE
What that code does is define the address in memory (ex: DayNightCycle:GetDayNightCycleTime+2) and the number of bytes (ex: F3 0F 10 46 74) then uses the instruction (or function) 'assert' (assertion) to check if the address is maching to the series of bytes, if it does, the script will work, if it does not, the script will not work.
Then it uses 'globalalloc(name, size)' to allocate a certain among of memory (4 if for 32bits and 8 for 64bits) and register the specified name (ex: getDayNightCycleTime_ptr // purely aesthetic).
Then I'll recover that base value with
mov [getDayNightCycleTime_ptr],rsi {move base address (rsi) into the specified allocated name (getDayNightCycleTime_pt)} and be able to create my pointers.
[Link]
And if you want to learn more about, there are many video covering by these many of talented guys, such like
[Link]... and many others.