Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
17
Task/Machine-code/00DESCRIPTION
Normal file
17
Task/Machine-code/00DESCRIPTION
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
The task requires poking machine code directly into memory and executing it. This is strictly for x86 (32 bit) architectures. The machine code is the opcodes of the following simple program:
|
||||
|
||||
<lang asm>mov EAX, [ESP+4]
|
||||
add EAX, [ESP+8]
|
||||
ret</lang>
|
||||
|
||||
which translates into the following opcodes:
|
||||
(139 68 36 4 3 68 36 8 195)
|
||||
and in Hex this would correspond to the following:
|
||||
("8B" "44" "24" "4" "3" "44" "24" "8" "C3")
|
||||
|
||||
Implement the following in your favorite programming language (take the common lisp code as an example if you wish):
|
||||
<ol>
|
||||
<li> Poke the above opcodes into a memory pointer</li>
|
||||
<li>Excute it with the following arguments: [ESP+4] => unsigned-byte argument of value 7; [ESP+8] => unsigned-byte argument of value 12; The result would be 19.</li>
|
||||
<li>Free the Pointer</li>
|
||||
</ol>
|
||||
Loading…
Add table
Add a link
Reference in a new issue