Write a toy program, learn the machine code for learning X86 instructions, ^

xiaoxiao2021-03-06  58

//Arrayexec.cpp//complie with: g arrayexec.cpp -o arrayexec.exe // orcl arrayexec.cpp # include #define size 1024 // Equivalent code // void call (int * n) // {// n = 990; //} typedef void (* f) (int *);

INT main () {char installation; int OP = 0;

INST [OP ] = 0x55; // push% EBP INST [OP ] = 0x8b; // MOV% ESP% EBP INST [OP ] = 0xEC; INST [OP ] = 0x8b; // MOV 8 (% EBP),% EAX INST [OP ] = 0x45; INST [OP ] = 0x08; INST [OP ] = 0xc7; // Move $ 16, (% EAX) inst [op ] = 0x00; installation; inst [op ] = 0x10; inst [op ] = 0x00; INST [OP ] = 0x00; INST [OP ] = 0x00; INST [OP ] = 0x5d; // POP% EBP INST [OP ] = 0xc3; // Ret

INT n = 9; //vc7.1 compiler, like f function = (f) array; does not assign funcion = (f) (void *) institution institution, FUNCION (& N); // Call (& n) Printf ("% I / N", N);}

转载请注明原文地址:https://www.9cbs.com/read-83595.html

New Post(0)