Machine code: Difference between revisions

Content added Content deleted
No edit summary
Line 1,542: Line 1,542:
mov [rbx].mem, rax
mov [rbx].mem, rax
invoke printf, CSTR("[mexec->Init] - [rbx].mem addr: 0x%X",10), [rbx].mem
invoke printf, CSTR("[mexec->Init] - [rbx].mem addr: 0x%X",10), [rbx].mem
;; Memory probably wont be executable by default from Malloc, So we make it
;; Memory wont be executable by default from Malloc, So we make it
;; so with mprotect. Not sure about windows, Might need to use a VirtualProtect
;; so with mprotect. Not sure about windows, Might need to use a VirtualProtect
;; call..
;; call..
Line 1,586: Line 1,586:


endif ;; __MEMEXEC_CLASS__
endif ;; __MEMEXEC_CLASS__
.data
a1 dq 7
a2 dq 12


.code
.code
Line 1,592: Line 1,595:
mov pmem, _NEW(memexec)
mov pmem, _NEW(memexec)
pmem->run(7,12)
pmem->run(a1,a2)
invoke printf, CSTR("[pmem->run(%i, %i)] - returned: %i",10), 7, 12, rax
invoke printf, CSTR("[pmem->run(%i, %i)] - returned: %i",10), a1, a2, rax
_DELETE(pmem)
_DELETE(pmem)
invoke exit, 0
invoke exit, 0