本文整理汇总了C++中VirtualMachine::add_new_function方法的典型用法代码示例。如果您正苦于以下问题:C++ VirtualMachine::add_new_function方法的具体用法?C++ VirtualMachine::add_new_function怎么用?C++ VirtualMachine::add_new_function使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VirtualMachine
的用法示例。
在下文中一共展示了VirtualMachine::add_new_function方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vmtest
//.........这里部分代码省略.........
// vmhandle.d_xor(T_EAX,T_EBX);
// vmhandle.d_xor(T_EAX,T_EBX);
// pcode->v_pop_register(T_INVALID);
//pcode->v_push_register(T_EAX);
// pcode->v_push_register(T_EBX);
// vmhandle.w_push_imm_sx(0xf7ea);
vmhandle.upset_register_array( vmhandle.pcode->register_store_in );
vmhandle.start();
//vmhandle.r_get_mem(T_ESP,T_EAX,0,0);
// vmhandle.push(T_ESP,false);
// vmhandle.d_sub(T_EAX,T_EBX);
//pcode->v_pop_register(T_EFLAG);
//pcode->v_pop_register(T_EAX);
//vmhandle.set_protect_grade(true);
//vmhandle.d_add(T_EAX,T_EBX);
//vmhandle.pop(T_INVALID);
//vmhandle.pop(T_INVALID);
//vmhandle.r_get_mem( T_ESP,0,0,0 );
//vmhandle.pop( T_EAX );
//vmhandle.d_and( T_EAX,0 ,true);
//vmhandle.pop( T_INVALID );
// vmhandle.pop( T_EAX );
//vmhandle.upset_register_array( vmhandle.pcode->register_store_out );
//vmhandle.recover_vm_context( );
//RegisterStore reg_bak;
//reg_bak = vmhandle.pcode->register_store_in ;
//vmhandle.pcode->register_store_in = vmhandle.pcode->register_store_out;
//vmhandle.save_vm_context( );
vmhandle.popf( );
//vmhandle.pushf( );
//vmhandle.pushad( );
//vmhandle.push( T_EAX ) ;
vmhandle.exit( );
// vmhandle.pcode->register_store_in = reg_bak;
//vmhandle.exit( );
//vmhandle.push( T_EFLAG );
//vmhandle.pop(T_EAX);
//vmhandle.d_push_imm(0xffffffff);
//vmhandle.pop(T_EBX);
//vmhandle.b_push_imm(0xFF);
// vmhandle.d_not(T_EAX);
//vmhandle.d_xor(T_EAX,T_EDX);
//pcode->v_pop_register(T_EFLAG32);
// vmhandle.w_xor(T_DX,T_BX);
// vmhandle.w_xor(T_DX,T_AX);
//pcode->v_push_register(T_DL);
//pcode->v_push_register(T_DH);
// pcode->v_pop_register(T_AL);
//vmhandle.d_not(T_EDX);
//vmhandle.popf();
//pcode->v_pop_register(T_EDX);
//pcode->v_pop_register(T_AH);
//vmhandle.b_or(T_AL,T_DH);
//vmhandle.popf();
//pcode->v_pop_register(T_AL);
//vmhandle.d_add(T_EBX,T_EDX);
// pcode->v_pop_register(T_ECX);
//pcode->v_pop_register(T_AL);
// vmhandle.w_xor(T_AX,T_DX);
//vmhandle.popf();
//pcode->v_pop_register(T_DX);
//vmhandle.exit();
long key = pcode.get_original_key();
ppcode_block_info info = pvm->add_new_function(0x401000+pvm->vm_info.size,&pcode,0x401000,123456,key);
memcpy(&buf[size],info->buf,info->size);
size += info->size;
//delete pcode;
file = fopen("code","wb");
fwrite(buf,1,size,file);
fclose(file);
delete [] buf;
// delete pcode;
return 0;
}