@@ -756,3 +756,145 @@ def hook_EtwNotificationRegister(ql: Qiling, address: int, params):
756756 ql .mem .write_ptr (reg_handle_ptr , handle .id )
757757
758758 return STATUS_SUCCESS
759+
760+ # NTSYSAPI
761+ # VOID RtlRaiseException(
762+ # PEXCEPTION_RECORD ExceptionRecord
763+ # );
764+ @winsdkapi (cc = STDCALL , params = {
765+ 'ExceptionRecord' : PVOID
766+ }, passthru = True )
767+ def hook_RtlRaiseException (ql : Qiling , address : int , params ):
768+ return
769+
770+ # NTSYSAPI
771+ # PRUNTIME_FUNCTION RtlVirtualUnwind(
772+ # DWORD HandlerType,
773+ # DWORD64 ImageBase,
774+ # DWORD64 ControlPc,
775+ # PRUNTIME_FUNCTION FunctionEntry,
776+ # PCONTEXT ContextRecord,
777+ # PVOID* HandlerData,
778+ # PDWORD64 EstablisherFrame,
779+ # PKNONVOLATILE_CONTEXT_POINTERS ContextPointers
780+ # );
781+ @winsdkapi (cc = STDCALL , params = {
782+ 'HandlerType' : DWORD ,
783+ 'ImageBase' : PVOID ,
784+ 'ControlPc' : PVOID ,
785+ 'FunctionEntry' : PVOID ,
786+ 'ContextRecord' : PVOID ,
787+ 'HandlerData' : PVOID ,
788+ 'EstablisherFrame' : PVOID ,
789+ 'ContextPointers' : PVOID
790+ }, passthru = True )
791+ def hook_RtlVirtualUnwind (ql : Qiling , address : int , params ):
792+ return
793+
794+ # NTSYSAPI
795+ # VOID RtlUnwindEx(
796+ # PVOID TargetFrame,
797+ # PVOID TargetIp,
798+ # PEXCEPTION_RECORD ExceptionRecord,
799+ # PVOID ReturnValue,
800+ # PCONTEXT OriginalContext,
801+ # PUNWIND_HISTORY_TABLE HistoryTable
802+ # );
803+ @winsdkapi (cc = STDCALL , params = {
804+ 'TargetFrame' : PVOID ,
805+ 'TargetIp' : PVOID ,
806+ 'ExceptionRecord' : PVOID ,
807+ 'ReturnValue' : PVOID ,
808+ 'OriginalContext' : PVOID ,
809+ 'HistoryTable' : PVOID
810+ }, passthru = True )
811+ def hook_RtlUnwindEx (ql : Qiling , address : int , params ):
812+ return
813+
814+ # NTSYSAPI
815+ # BOOLEAN RtlDispatchException(
816+ # PEXCEPTION_RECORD ExceptionRecord,
817+ # PCONTEXT ContextRecord
818+ # );
819+ @winsdkapi (cc = STDCALL , params = {
820+ 'ExceptionRecord' : PVOID ,
821+ 'ContextRecord' : PVOID
822+ }, passthru = True )
823+ def hook_RtlDispatchException (ql : Qiling , address : int , params ):
824+ return
825+
826+ # NTSYSAPI
827+ # VOID RtlRestoreContext(
828+ # PCONTEXT ContextRecord,
829+ # PEXCEPTION_RECORD ExceptionRecord
830+ # );
831+ @winsdkapi (cc = CDECL , params = {
832+ 'ContextRecord' : PVOID ,
833+ 'ExceptionRecord' : PVOID
834+ }, passthru = True )
835+ def hook_RtlRestoreContext (ql : Qiling , address : int , params ):
836+ return
837+
838+ # NTSYSAPI
839+ # VOID RtlCaptureContext(
840+ # PCONTEXT ContextRecord
841+ # );
842+ @winsdkapi (cc = STDCALL , params = {
843+ 'ContextRecord' : PVOID
844+ }, passthru = True )
845+ def hook_RtlCaptureContext (ql : Qiling , address : int , params ):
846+ return
847+
848+ # NTSYSAPI
849+ # VOID RtlCaptureContext2(
850+ # PCONTEXT ContextRecord,
851+ # ULONG Flags
852+ # );
853+ @winsdkapi (cc = STDCALL , params = {
854+ 'ContextRecord' : PVOID ,
855+ 'Flags' : DWORD
856+ }, passthru = True )
857+ def hook_RtlCaptureContext2 (ql : Qiling , address : int , params ):
858+ return
859+
860+ # NTSYSAPI
861+ # NTSTATUS RtlInitializeExtendedContext2(
862+ # USHORT Version,
863+ # USHORT ContextFlags,
864+ # ULONG ExtensionCount,
865+ # ULONG *ExtensionSizes,
866+ # ULONG BufferSize,
867+ # PVOID Buffer,
868+ # PCONTEXT Context,
869+ # ULONG *LengthReturned
870+ # );
871+ @winsdkapi (cc = STDCALL , params = {
872+ 'Version' : WORD ,
873+ 'ContextFlags' : WORD ,
874+ 'ExtensionCount' : DWORD ,
875+ 'ExtensionSizes' : PVOID ,
876+ 'BufferSize' : DWORD ,
877+ 'Buffer' : PVOID ,
878+ 'Context' : PVOID ,
879+ 'LengthReturned' : PVOID
880+ }, passthru = True )
881+ def hook_RtlInitializeExtendedContext2 (ql : Qiling , address : int , params ):
882+ return
883+
884+ # NTSYSAPI
885+ # NTSTATUS RtlGetExtendedContextLength2(
886+ # USHORT Version,
887+ # USHORT ContextFlags,
888+ # ULONG ExtensionCount,
889+ # ULONG *ExtensionSizes,
890+ # PULONG Length
891+ # );
892+ @winsdkapi (cc = STDCALL , params = {
893+ 'Version' : WORD ,
894+ 'ContextFlags' : WORD ,
895+ 'ExtensionCount' : DWORD ,
896+ 'ExtensionSizes' : PVOID ,
897+ 'Length' : PVOID
898+ }, passthru = True )
899+ def hook_RtlGetExtendedContextLength2 (ql : Qiling , address : int , params ):
900+ return
0 commit comments