Implement svcOutputDebugString

This commit is contained in:
Ryan Teal 2019-07-02 22:34:08 +01:00
parent 80955679e0
commit e108d4a0be
No known key found for this signature in database
GPG Key ID: 8DBEE0F12C7E2D23

View File

@ -1,12 +1,24 @@
#include <cstdint>
#include <string>
#include <syslog.h>
#include <utility>
#include "core/arm/cpu.h"
#include "core/arm/memory.h"
#include "svc.h"
using namespace core::cpu;
namespace core::kernel {
static uint32_t OutputDebugString() {
std::string debug(GetRegister(UC_ARM64_REG_X1), '\0');
memory::Read((void*)debug.data(), GetRegister(UC_ARM64_REG_X0), GetRegister(UC_ARM64_REG_X1));
syslog(LOG_DEBUG, "svcOutputDebugString: %s", debug.c_str());
return 0;
}
std::pair<int, uint32_t(*)()> svcTable[] =
{
{0x00, nullptr},
{0x01, nullptr},
{0x02, nullptr},
{0x03, nullptr},
@ -45,7 +57,7 @@ namespace core::kernel {
{0x24, nullptr},
{0x25, nullptr},
{0x26, nullptr},
{0x27, nullptr},
{0x27, OutputDebugString},
{0x28, nullptr},
{0x29, nullptr},
{0x2a, nullptr},