1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-07-01 00:31:51 +00:00

Fix formatting

This commit is contained in:
momo5502
2022-04-25 19:47:22 +02:00
parent 4ec4055e4b
commit c58f6c9742
9 changed files with 74 additions and 64 deletions

View File

@ -90,7 +90,8 @@ namespace
}); });
memcpy(buffer.get(), request.source_data, request.source_data_size); memcpy(buffer.get(), request.source_data, request.source_data_size);
translation_hints = generate_translation_hints(request.process_id, request.target_address, request.source_data_size); translation_hints = generate_translation_hints(request.process_id, request.target_address,
request.source_data_size);
if (!translation_hints) if (!translation_hints)
{ {

View File

@ -15,7 +15,7 @@ VOID
KeGenericCallDpc( KeGenericCallDpc(
_In_ PKDEFERRED_ROUTINE Routine, _In_ PKDEFERRED_ROUTINE Routine,
_In_opt_ PVOID Context _In_opt_ PVOID Context
); );
// ---------------------------------------- // ----------------------------------------
@ -25,7 +25,7 @@ _IRQL_requires_same_
VOID VOID
KeSignalCallDpcDone( KeSignalCallDpcDone(
_In_ PVOID SystemArgument1 _In_ PVOID SystemArgument1
); );
// ---------------------------------------- // ----------------------------------------
@ -35,7 +35,7 @@ _IRQL_requires_same_
LOGICAL LOGICAL
KeSignalCallDpcSynchronize( KeSignalCallDpcSynchronize(
_In_ PVOID SystemArgument2 _In_ PVOID SystemArgument2
); );
// ---------------------------------------- // ----------------------------------------
@ -51,7 +51,7 @@ MmAllocateContiguousNodeMemory(
_In_opt_ PHYSICAL_ADDRESS BoundaryAddressMultiple, _In_opt_ PHYSICAL_ADDRESS BoundaryAddressMultiple,
_In_ ULONG Protect, _In_ ULONG Protect,
_In_ NODE_REQUIREMENT PreferredNode _In_ NODE_REQUIREMENT PreferredNode
); );
#endif #endif
// ---------------------------------------- // ----------------------------------------
@ -61,7 +61,7 @@ VOID
NTAPI NTAPI
RtlCaptureContext( RtlCaptureContext(
_Out_ PCONTEXT ContextRecord _Out_ PCONTEXT ContextRecord
); );
// ---------------------------------------- // ----------------------------------------
@ -81,7 +81,7 @@ VOID
KeStackAttachProcess( KeStackAttachProcess(
__inout PEPROCESS PROCESS, __inout PEPROCESS PROCESS,
__out PRKAPC_STATE ApcState __out PRKAPC_STATE ApcState
); );
// ---------------------------------------- // ----------------------------------------
@ -89,7 +89,7 @@ NTKERNELAPI
VOID VOID
KeUnstackDetachProcess( KeUnstackDetachProcess(
__in PRKAPC_STATE ApcState __in PRKAPC_STATE ApcState
); );
// ---------------------------------------- // ----------------------------------------
@ -98,7 +98,7 @@ NTSTATUS
PsLookupProcessByProcessId( PsLookupProcessByProcessId(
IN HANDLE ProcessId, IN HANDLE ProcessId,
OUT PEPROCESS* Process OUT PEPROCESS* Process
); );
// ---------------------------------------- // ----------------------------------------
@ -106,7 +106,7 @@ NTKERNELAPI
PVOID PVOID
PsGetProcessSectionBaseAddress( PsGetProcessSectionBaseAddress(
__in PEPROCESS Process __in PEPROCESS Process
); );
// ---------------------------------------- // ----------------------------------------
@ -115,7 +115,7 @@ PPEB
NTAPI NTAPI
PsGetProcessPeb( PsGetProcessPeb(
IN PEPROCESS Process IN PEPROCESS Process
); );
// ---------------------------------------- // ----------------------------------------
@ -123,7 +123,7 @@ NTKERNELAPI
PCSTR PCSTR
PsGetProcessImageFileName( PsGetProcessImageFileName(
__in PEPROCESS Process __in PEPROCESS Process
); );
// ---------------------------------------- // ----------------------------------------
@ -142,7 +142,7 @@ NtCreateFile(
_In_ ULONG CreateOptions, _In_ ULONG CreateOptions,
_In_reads_bytes_opt_(EaLength) PVOID EaBuffer, _In_reads_bytes_opt_(EaLength) PVOID EaBuffer,
_In_ ULONG EaLength _In_ ULONG EaLength
); );
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -48,7 +48,7 @@ namespace process
this->own_ = obj.own_; this->own_ = obj.own_;
this->handle_ = obj.handle_; this->handle_ = obj.handle_;
if(this->own_ && this->handle_) if (this->own_ && this->handle_)
{ {
ObReferenceObject(this->handle_); ObReferenceObject(this->handle_);
} }

View File

@ -134,12 +134,21 @@ namespace std
}; };
template<class T> template <class T>
struct remove_extent { typedef T type; }; struct remove_extent
{
typedef T type;
};
template<class T> template <class T>
struct remove_extent<T[]> { typedef T type; }; struct remove_extent<T[]>
{
typedef T type;
};
template<class T, std::size_t N> template <class T, std::size_t N>
struct remove_extent<T[N]> { typedef T type; }; struct remove_extent<T[N]>
{
typedef T type;
};
} }

View File

@ -52,7 +52,7 @@ std::vector<uint8_t> load_resource(const int id)
auto* const handle = LoadResource(nullptr, res); auto* const handle = LoadResource(nullptr, res);
if (!handle) return {}; if (!handle) return {};
const auto* data_ptr =static_cast<uint8_t*>(LockResource(handle)); const auto* data_ptr = static_cast<uint8_t*>(LockResource(handle));
const auto data_size = SizeofResource(nullptr, res); const auto data_size = SizeofResource(nullptr, res);
std::vector<uint8_t> data{}; std::vector<uint8_t> data{};
@ -78,7 +78,7 @@ void unsafe_main(const int /*argc*/, char* /*argv*/[])
{ {
const auto driver_file = extract_driver(); const auto driver_file = extract_driver();
driver driver{ driver_file, "MomoLul"}; driver driver{driver_file, "MomoLul"};
const driver_device driver_device{R"(\\.\HelloDev)"}; const driver_device driver_device{R"(\\.\HelloDev)"};
std::string pid_str{}; std::string pid_str{};