Code: Select all
; _h v2 w64
Obj := {msg: 'hello world'}
PASS := 'MyPassword'
PATH := 'C:\DumpedObj.bin'
FileDelete(PATH)
; ObjDump: all modes + password
; ObjLoad: no size, no password
MsgBox '[Dump] Mode: blank + password'
MsgBox 'size: ' size := ObjDump(PATH, Obj, , PASS)
MsgBox 'msg: ' ObjLoad(PATH).msg ; reads key, but shouldnt
FileDelete(PATH)
MsgBox '[Dump] Mode: 0 + password'
MsgBox 'size: ' size := ObjDump(PATH, Obj, 0, PASS)
MsgBox 'msg: ' ObjLoad(PATH).msg ; reads key, but shouldnt
FileDelete(PATH)
MsgBox '[Dump] Mode: 1 + password'
MsgBox 'size: ' size := ObjDump(PATH, Obj, 1, PASS)
MsgBox 'msg: ' ObjLoad(PATH).msg ; reads key, but shouldnt
FileDelete(PATH)
; MsgBox '[Dump] Mode: 2 + password'
; MsgBox 'size: ' size := ObjDump(PATH, Obj, 2, PASS)
; MsgBox 'msg: ' ObjLoad(PATH).msg ; exception Out of Memory
; FileDelete(PATH)
; MsgBox '[Dump] Mode: 3 + password'
; MsgBox 'size: ' size := ObjDump(PATH, Obj, 3, PASS)
; MsgBox 'msg: ' ObjLoad(PATH).msg ; exception Out of Memory
; FileDelete(PATH)
MsgBox '[Load] different params'
MsgBox 'size: ' size := ObjDump(PATH, Obj, , PASS)
; MsgBox 'msg: ' ObjLoad(PATH, size, PASS).msg ; exception, Too Many Parameters Passed to Function
; MsgBox 'msg: ' ObjLoad(PATH, , PASS).msg ; exception, Too Many Parameters Passed to Function
MsgBox 'msg: ' ObjLoad(PATH, size).msg ; reads key, but shouldnt
if u dump with modes '', 0, 1, the object can be loaded anyway, without supplying a password. it is my understanding that this shouldnt be allowed
modes 2, 3 dont permit this, although the error message is a bit peculiar
if u try to ObjLoad() according to the signature in the docs:
u get "Too Many Parameters Passed to Function"OutputVar := ObjLoad(AddressOrPath , Size, Password)
i think the error is in ObjRawLoad towards the end, when u do aObject->Invoke(....