code *nteh_setsp(int op) { code cs; cs.Iop = op; cs.Irm = modregrm(2,SP,BPRM); cs.Iflags = 0; cs.Irex = 0; cs.IFL1 = FLconst; // EBP offset of __context.esp cs.IEV1.Vint = nteh_EBPoffset_esp(); return gen(CNIL,&cs); // MOV ESP,__context[EBP].esp }
code *nteh_setsp(int op) { code cs; cs.Iop = op; cs.Irm = modregrm(2,SP,BPRM); cs.Iflags = 0; cs.Irex = 0; cs.IFL1 = FLconst; // EBP offset of __context.esp cs.IEV1.Vint = nteh_EBPoffset_esp(); CodeBuilder cdb; cdb.gen(&cs); // MOV ESP,__context[EBP].esp return cdb.finish(); }