rework endswitch disassemble

This commit is contained in:
xensik 2022-08-06 15:53:03 +02:00
parent 32d4ec28d7
commit 06a30ddd99
8 changed files with 80 additions and 64 deletions

View File

@ -365,15 +365,17 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
{
const auto value = script_->read<std::uint32_t>();
if (value < 0x40000 && value > 0)
if (value < 0x40000)
{
const auto data = stack_->read_c_string();
if (data.data()[0] != 0x01)
{
inst->data.push_back("case");
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
inst->data.push_back(utils::string::quote(data, false));
}
else if (value == 0)
{
else
inst->data.push_back("default");
stack_->read_c_string();
}
else
{

View File

@ -365,15 +365,17 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
{
const auto value = script_->read<std::uint32_t>();
if (value < 0x40000 && value > 0)
if (value < 0x40000)
{
const auto data = stack_->read_c_string();
if (data.data()[0] != 0x01)
{
inst->data.push_back("case");
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
inst->data.push_back(utils::string::quote(data, false));
}
else if (value == 0)
{
else
inst->data.push_back("default");
stack_->read_c_string();
}
else
{

View File

@ -364,15 +364,17 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
{
const auto value = script_->read<std::uint32_t>();
if (value < 0x40000 && value > 0)
if (value < 0x40000)
{
const auto data = stack_->read_c_string();
if (data.data()[0] != 0x01)
{
inst->data.push_back("case");
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
inst->data.push_back(utils::string::quote(data, false));
}
else if (value == 0)
{
else
inst->data.push_back("default");
stack_->read_c_string();
}
else
{

View File

@ -364,15 +364,17 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
{
const auto value = script_->read<std::uint32_t>();
if (value < 0x40000 && value > 0)
if (value < 0x40000)
{
const auto data = stack_->read_c_string();
if (data.data()[0] != 0x01)
{
inst->data.push_back("case");
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
inst->data.push_back(utils::string::quote(data, false));
}
else if (value == 0)
{
else
inst->data.push_back("default");
stack_->read_c_string();
}
else
{

View File

@ -364,15 +364,17 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
{
const auto value = script_->read<std::uint32_t>();
if (value < 0x40000 && value > 0)
if (value < 0x40000)
{
const auto data = stack_->read_c_string();
if (data.data()[0] != 0x01)
{
inst->data.push_back("case");
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
inst->data.push_back(utils::string::quote(data, false));
}
else if (value == 0)
{
else
inst->data.push_back("default");
stack_->read_c_string();
}
else
{

View File

@ -365,15 +365,17 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
{
const auto value = script_->read<std::uint32_t>();
if (value < 0x40000 && value > 0)
if (value < 0x40000)
{
const auto data = stack_->read_c_string();
if (data.data()[0] != 0x01)
{
inst->data.push_back("case");
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
inst->data.push_back(utils::string::quote(data, false));
}
else if (value == 0)
{
else
inst->data.push_back("default");
stack_->read_c_string();
}
else
{

View File

@ -366,15 +366,17 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
{
const auto value = script_->read<std::uint32_t>();
if (value < 0x40000 && value > 0)
if (value < 0x40000)
{
const auto data = stack_->read_c_string();
if (data.data()[0] != 0x01)
{
inst->data.push_back("case");
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
inst->data.push_back(utils::string::quote(data, false));
}
else if (value == 0)
{
else
inst->data.push_back("default");
stack_->read_c_string();
}
else
{

View File

@ -417,15 +417,17 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
{
const auto value = script_->read<std::uint32_t>();
if (value < 0x40000 && value > 0)
if (value < 0x80000)
{
const auto data = stack_->read_c_string();
if (data.data()[0] != 0x01)
{
inst->data.push_back("case");
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
inst->data.push_back(utils::string::quote(data, false));
}
else if (value == 0)
{
else
inst->data.push_back("default");
stack_->read_c_string();
}
else
{