Skip to content
Permalink
Browse files

Playground asms

  • Loading branch information
charlesbetros committed Oct 6, 2019
1 parent ad2595a commit db96bf03074ac666303de8b6486b8f649ca11725
@@ -26,6 +26,7 @@ DebugStub_DoAsmBreak:
Call DebugStub_Break
; }
DebugStub_DoAsmBreak_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_DoAsmBreak_Exit
Ret

; function SetAsmBreak {
@@ -55,6 +56,7 @@ DebugStub_SetAsmBreak:
Mov BYTE [EDI], AL
; }
DebugStub_SetAsmBreak_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SetAsmBreak_Exit
Ret

; function ClearAsmBreak {
@@ -76,6 +78,7 @@ DebugStub_ClearAsmBreak:
Mov DWORD [DebugStub_AsmBreakEIP], 0x0
; }
DebugStub_ClearAsmBreak_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_ClearAsmBreak_Exit
Ret

; function SetINT1_TrapFLAG {
@@ -99,6 +102,7 @@ DebugStub_SetINT1_TrapFLAG:
; EAX = [EBP]
Mov EAX, DWORD [EBP]
; EAX | $0100
Or EAX, 0x100
; [EBP] = EAX
Mov DWORD [EBP], EAX

@@ -111,6 +115,7 @@ DebugStub_SetINT1_TrapFLAG:
Pop EBP
; }
DebugStub_SetINT1_TrapFLAG_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SetINT1_TrapFLAG_Exit
Ret

; function ResetINT1_TrapFLAG {
@@ -132,6 +137,7 @@ DebugStub_ResetINT1_TrapFLAG:
; EAX = [EBP]
Mov EAX, DWORD [EBP]
; EAX & $FEFF
And EAX, 0xFEFF
; [EBP] = EAX
Mov DWORD [EBP], EAX
@@ -142,4 +148,5 @@ DebugStub_ResetINT1_TrapFLAG:
Pop EBP
; }
DebugStub_ResetINT1_TrapFLAG_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_ResetINT1_TrapFLAG_Exit
Ret
@@ -9,6 +9,7 @@ DebugStub_Ping:
Call DebugStub_ComWriteAL
; }
DebugStub_Ping_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_Ping_Exit
Ret

; function TraceOn {
@@ -18,6 +19,7 @@ DebugStub_TraceOn:
Mov DWORD [DebugStub_TraceMode], 0x1
; }
DebugStub_TraceOn_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_TraceOn_Exit
Ret

; function TraceOff {
@@ -27,4 +29,5 @@ DebugStub_TraceOff:
Mov DWORD [DebugStub_TraceMode], 0x0
; }
DebugStub_TraceOff_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_TraceOff_Exit
Ret
@@ -38,7 +38,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block1_End:
; if AL = #Vs2Ds_TraceOn {
@@ -49,7 +49,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block2_End:
; if AL = #Vs2Ds_Break {
@@ -62,7 +62,7 @@ DebugStub_ProcessCommand:
; Break()
Call DebugStub_Break
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block3_End:
; if AL = #Vs2Ds_BreakOnAddress {
@@ -73,7 +73,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block4_End:
; if AL = #Vs2Ds_SendMethodContext {
@@ -84,7 +84,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block5_End:
; if AL = #Vs2Ds_SendMemory {
@@ -95,7 +95,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block6_End:
; if AL = #Vs2Ds_SendRegisters {
@@ -106,7 +106,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block7_End:
; if AL = #Vs2Ds_SendFrame {
@@ -117,7 +117,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block8_End:
; if AL = #Vs2Ds_SendStack {
@@ -128,7 +128,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block9_End:
; if AL = #Vs2Ds_Ping {
@@ -139,7 +139,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block10_End:
; if AL = #Vs2Ds_SetINT3 {
@@ -150,7 +150,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block11_End:
; if AL = #Vs2Ds_ClearINT3 {
@@ -161,7 +161,7 @@ DebugStub_ProcessCommand:
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
Jmp DebugStub_ProcessCommand_Exit
; }
DebugStub_ProcessCommand_Block12_End:

@@ -173,6 +173,8 @@ DebugStub_ProcessCommand_Exit:
; -EAX
Pop EAX
; }
Mov DWORD [INTS_LastKnownAddress], DebugStub_ProcessCommand_Exit
Ret

; function AckCommand {
DebugStub_AckCommand:
@@ -199,6 +201,7 @@ DebugStub_AckCommand:
Call DebugStub_ComWriteAL
; }
DebugStub_AckCommand_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_AckCommand_Exit
Ret

; function ProcessCommandBatch {
@@ -219,4 +222,5 @@ DebugStub_ProcessCommandBatch_Begin:
Call DebugStub_AckCommand
; }
DebugStub_ProcessCommandBatch_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_ProcessCommandBatch_Exit
Ret
@@ -26,6 +26,7 @@ DebugStub_SendRegisters:
Call DebugStub_ComWrite32
; }
DebugStub_SendRegisters_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendRegisters_Exit
Ret

; function SendFrame {
@@ -51,6 +52,7 @@ DebugStub_SendFrame:
Call DebugStub_ComWriteX
; }
DebugStub_SendFrame_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendFrame_Exit
Ret

; AL contains channel
@@ -96,6 +98,7 @@ DebugStub_SendCommandOnChannel:
DebugStub_SendCommandOnChannel_Block1_End:
; }
DebugStub_SendCommandOnChannel_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendCommandOnChannel_Exit
Ret

; function SendStack {
@@ -126,6 +129,7 @@ DebugStub_SendStack:
DebugStub_SendStack_Block1_End:
; }
DebugStub_SendStack_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendStack_Exit
Ret

; sends a stack value
@@ -172,6 +176,8 @@ DebugStub_SendMethodContext_Exit:
; -All
PopAD
; }
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendMethodContext_Exit
Ret

; none
; saveregs
@@ -214,6 +220,8 @@ DebugStub_SendMemory_Exit:
; -All
PopAD
; }
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendMemory_Exit
Ret

; Modifies: EAX, ESI
; function SendTrace {
@@ -239,6 +247,7 @@ DebugStub_SendTrace:
Call DebugStub_ComWrite32
; }
DebugStub_SendTrace_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendTrace_Exit
Ret

; Input: Stack
@@ -301,6 +310,7 @@ DebugStub_SendText_Finalize:
Pop EBP
; }
DebugStub_SendText_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendText_Exit
Ret

; Input: Stack
@@ -332,6 +342,7 @@ Mov EBP, ESP
Pop EBP
; }
DebugStub_SendSimpleNumber_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendSimpleNumber_Exit
Ret

; Input: Stack
@@ -365,6 +376,7 @@ Mov EBP, ESP
Pop EBP
; }
DebugStub_SendKernelPanic_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendKernelPanic_Exit
Ret

; Input: Stack
@@ -401,6 +413,7 @@ DebugStub_SendSimpleLongNumber:
Pop EBP
; }
DebugStub_SendSimpleLongNumber_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendSimpleLongNumber_Exit
Ret

; Input: Stack
@@ -433,6 +446,7 @@ DebugStub_SendComplexNumber:
Pop EBP
; }
DebugStub_SendComplexNumber_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendComplexNumber_Exit
Ret

; Input: Stack
@@ -469,6 +483,7 @@ DebugStub_SendComplexLongNumber:
Pop EBP
; }
DebugStub_SendComplexLongNumber_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendComplexLongNumber_Exit
Ret

; Input: Stack
@@ -489,6 +504,7 @@ DebugStub_SendPtr:
Call DebugStub_ComWrite32
; }
DebugStub_SendPtr_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendPtr_Exit
Ret

; Input: Stack
@@ -509,6 +525,7 @@ DebugStub_SendStackCorruptionOccurred:
Call DebugStub_ComWrite32
; }
DebugStub_SendStackCorruptionOccurred_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendStackCorruptionOccurred_Exit
Ret

; Input: Stack
@@ -529,6 +546,7 @@ DebugStub_SendStackOverflowOccurred:
Call DebugStub_ComWrite32
; }
DebugStub_SendStackOverflowOccurred_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendStackOverflowOccurred_Exit
Ret

; Input: None
@@ -551,6 +569,7 @@ DebugStub_SendInterruptOccurred:
Call DebugStub_ComWriteEAX
; }
DebugStub_SendInterruptOccurred_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendInterruptOccurred_Exit
Ret

; Input: Stack
@@ -571,6 +590,7 @@ DebugStub_SendNullReferenceOccurred:
Call DebugStub_ComWrite32
; }
DebugStub_SendNullReferenceOccurred_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendNullReferenceOccurred_Exit
Ret

; Input: Stack
@@ -614,6 +634,7 @@ DebugStub_SendMessageBox_WriteChar:
Jmp DebugStub_SendMessageBox_WriteChar
; }
DebugStub_SendMessageBox_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendMessageBox_Exit
Ret

; function SendCoreDump {
@@ -678,4 +699,5 @@ DebugStub_SendCoreDump:
DebugStub_SendCoreDump_Block2_End:
; }
DebugStub_SendCoreDump_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendCoreDump_Exit
Ret

0 comments on commit db96bf0

Please sign in to comment.
You can’t perform that action at this time.