mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 16:46:16 +00:00
Fix warnings
This commit is contained in:
2
deps/mini-gdbstub
vendored
2
deps/mini-gdbstub
vendored
Submodule deps/mini-gdbstub updated: 4628d9dfd2...25b60f545b
@@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
#define THE_SIZE 30
|
#define THE_SIZE 30
|
||||||
|
|
||||||
extern "C" __declspec(noinline)
|
extern "C" __declspec(noinline) __declspec(dllexport)
|
||||||
__declspec(dllexport)
|
|
||||||
void vulnerable(const uint8_t* data, const size_t size)
|
void vulnerable(const uint8_t* data, const size_t size)
|
||||||
{
|
{
|
||||||
if (size < 10)
|
if (size < 10)
|
||||||
@@ -38,11 +37,6 @@ void vulnerable(const uint8_t* data, const size_t size)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data[0] != 'H' || data[1] != 'u')
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (size < 100)
|
if (size < 100)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ namespace
|
|||||||
application, {}
|
application, {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void)&watch_system_objects;
|
||||||
//watch_system_objects(win_emu);
|
//watch_system_objects(win_emu);
|
||||||
win_emu.buffer_stdout = true;
|
win_emu.buffer_stdout = true;
|
||||||
//win_emu.verbose_calls = true;
|
//win_emu.verbose_calls = true;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
c_function_type* get_function() const
|
c_function_type* get_c_function() const
|
||||||
{
|
{
|
||||||
return +[](Args... args, user_data_pointer user_data) -> ReturnType
|
return +[](Args... args, user_data_pointer user_data) -> ReturnType
|
||||||
{
|
{
|
||||||
@@ -26,6 +26,11 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* get_function() const
|
||||||
|
{
|
||||||
|
return reinterpret_cast<void*>(this->get_c_function());
|
||||||
|
}
|
||||||
|
|
||||||
user_data_pointer get_user_data() const
|
user_data_pointer get_user_data() const
|
||||||
{
|
{
|
||||||
return this->functor_.get();
|
return this->functor_.get();
|
||||||
|
|||||||
@@ -2,8 +2,19 @@
|
|||||||
|
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable: 4505)
|
#pragma warning(disable: 4505)
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#include <unicorn/unicorn.h>
|
#include <unicorn/unicorn.h>
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ namespace unicorn
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
emulator_hook* hook_instruction(int instruction_type,
|
emulator_hook* hook_instruction(int instruction_type,
|
||||||
instruction_hook_callback callback)
|
instruction_hook_callback callback) override
|
||||||
{
|
{
|
||||||
function_wrapper<int, uc_engine*> wrapper([c = std::move(callback)](uc_engine*)
|
function_wrapper<int, uc_engine*> wrapper([c = std::move(callback)](uc_engine*)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -92,28 +92,6 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t get_syscall_id(const std::vector<std::string>& ntdll_syscalls,
|
|
||||||
const std::vector<std::string>& win32u_syscalls, const std::string_view name)
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < ntdll_syscalls.size(); ++i)
|
|
||||||
{
|
|
||||||
if (ntdll_syscalls[i] == name)
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < win32u_syscalls.size(); ++i)
|
|
||||||
{
|
|
||||||
if (win32u_syscalls[i] == name)
|
|
||||||
{
|
|
||||||
return i + 0x1000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw std::runtime_error("Unable to determine syscall id: " + std::string(name));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
requires(std::is_integral_v<T> || std::is_enum_v<T>)
|
requires(std::is_integral_v<T> || std::is_enum_v<T>)
|
||||||
T resolve_argument(x64_emulator& emu, const size_t index)
|
T resolve_argument(x64_emulator& emu, const size_t index)
|
||||||
|
|||||||
Reference in New Issue
Block a user