added more lifters...

merge-requests/11/head
_xeroxz 4 years ago
parent 2d3b22a7ac
commit bc0a1d7b5b

@ -19,6 +19,8 @@ namespace vm::lifters
extern vm::lifters::lifter_t lregq, lregdw; extern vm::lifters::lifter_t lregq, lregdw;
extern vm::lifters::lifter_t addq, adddw, addw; extern vm::lifters::lifter_t addq, adddw, addw;
extern vm::lifters::lifter_t sregq, sregdw, sregw; extern vm::lifters::lifter_t sregq, sregdw, sregw;
extern vm::lifters::lifter_t lconstq, lconstdw, lconstw;
extern vm::lifters::lifter_t vmexit;
inline std::map< vm::handler::mnemonic_t, lifter_callback_t > all = { inline std::map< vm::handler::mnemonic_t, lifter_callback_t > all = {
// lreg lifters... // lreg lifters...
@ -28,5 +30,11 @@ namespace vm::lifters
addq, adddw, addw, addq, adddw, addw,
// sreg lifters... // sreg lifters...
sregq, sregdw, sregw }; sregq, sregdw, sregw,
// lconst lifters...
lconstq, lconstdw, lconstw,
// vmexit lifter...
vmexit };
} // namespace vm::lifters } // namespace vm::lifters

@ -0,0 +1,22 @@
#include <vmlifters.hpp>
namespace vm::lifters
{
vm::lifters::lifter_t lconstq = {
// push imm<N>
vm::handler::LCONSTQ, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 64 ) );
} };
vm::lifters::lifter_t lconstdw = {
// push imm<N>
vm::handler::LCONSTDW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 32 ) );
} };
vm::lifters::lifter_t lconstw = {
// push imm<N>
vm::handler::LCONSTW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 16 ) );
} };
} // namespace vm::lifters

@ -0,0 +1,8 @@
#include <vmlifters.hpp>
namespace vm::lifters
{
vm::lifters::lifter_t vmexit = {
// ret
vm::handler::VMEXIT, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) { blk->vexit(); } };
}

@ -168,8 +168,10 @@
<ClCompile Include="src\vmhandler.cpp" /> <ClCompile Include="src\vmhandler.cpp" />
<ClCompile Include="src\vminstrs.cpp" /> <ClCompile Include="src\vminstrs.cpp" />
<ClCompile Include="src\vmlifters\add.cpp" /> <ClCompile Include="src\vmlifters\add.cpp" />
<ClCompile Include="src\vmlifters\lconst.cpp" />
<ClCompile Include="src\vmlifters\lreg.cpp" /> <ClCompile Include="src\vmlifters\lreg.cpp" />
<ClCompile Include="src\vmlifters\sreg.cpp" /> <ClCompile Include="src\vmlifters\sreg.cpp" />
<ClCompile Include="src\vmlifters\vmexit.cpp" />
<ClCompile Include="src\vmprofiles\add.cpp" /> <ClCompile Include="src\vmprofiles\add.cpp" />
<ClCompile Include="src\vmprofiles\call.cpp" /> <ClCompile Include="src\vmprofiles\call.cpp" />
<ClCompile Include="src\vmprofiles\div.cpp" /> <ClCompile Include="src\vmprofiles\div.cpp" />

@ -267,5 +267,11 @@
<ClCompile Include="src\vmlifters\sreg.cpp"> <ClCompile Include="src\vmlifters\sreg.cpp">
<Filter>Source Files\vmlifters</Filter> <Filter>Source Files\vmlifters</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="src\vmlifters\lconst.cpp">
<Filter>Source Files\vmlifters</Filter>
</ClCompile>
<ClCompile Include="src\vmlifters\vmexit.cpp">
<Filter>Source Files\vmlifters</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
</Project> </Project>
Loading…
Cancel
Save