Skip to content

Improvement suggestions #18

Open
Open
@Mecanik

Description

@Mecanik

Hi,

Please consider the following improvements:

  1. If one does not use anything else but these definitions, NTSTATUS will be missing, you can just add:
#ifndef SW3_HEADER_H_
#define SW3_HEADER_H_

#include <windows.h>

#ifndef _NTDEF_
typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
typedef NTSTATUS* PNTSTATUS;
#endif
  1. If one needs to use another definition set like phnt, the definitions will clash at compile time. My suggestion is to rename the structures/definitions with a prefix like:
typedef struct _SW3_SYSTEM_HANDLE
{
	ULONG ProcessId;
	BYTE ObjectTypeNumber;
	BYTE Flags;
	USHORT Handle;
	PVOID Object;
	ACCESS_MASK GrantedAccess;
} SW3_SYSTEM_HANDLE, *PSW3SYSTEM_HANDLE;

Same for functions (there is no reason we cannot name them as we wish):

EXTERN_C NTSTATUS Sw3NtCreateProcess(
	OUT PHANDLE ProcessHandle,
	IN ACCESS_MASK DesiredAccess,
	IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
	IN HANDLE ParentProcess,
	IN BOOLEAN InheritObjectTable,
	IN HANDLE SectionHandle OPTIONAL,
	IN HANDLE DebugPort OPTIONAL,
	IN HANDLE ExceptionPort OPTIONAL);

This would prevent the "already defined" compiling issue. Perhaps add a flag like --custom-prefix which would prefix the functions/structured/definitions as the user specifies.

  1. Instead of the current initial see, you might want to consider using xoshiro prng.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions