Skip to content

Commit

Permalink
Playground asms
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbetros committed Oct 6, 2019
1 parent ad2595a commit db96bf0
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 12 deletions.
7 changes: 7 additions & 0 deletions playground/AsmBreak.asm
Expand Up @@ -26,6 +26,7 @@ DebugStub_DoAsmBreak:
Call DebugStub_Break
; }
DebugStub_DoAsmBreak_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_DoAsmBreak_Exit
Ret

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

; function ClearAsmBreak {
Expand All @@ -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 {
Expand All @@ -99,6 +102,7 @@ DebugStub_SetINT1_TrapFLAG:
; EAX = [EBP]
Mov EAX, DWORD [EBP]
; EAX | $0100
Or EAX, 0x100
; [EBP] = EAX
Mov DWORD [EBP], EAX

Expand All @@ -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 {
Expand All @@ -132,6 +137,7 @@ DebugStub_ResetINT1_TrapFLAG:
; EAX = [EBP]
Mov EAX, DWORD [EBP]
; EAX & $FEFF
And EAX, 0xFEFF
; [EBP] = EAX
Mov DWORD [EBP], EAX
Expand All @@ -142,4 +148,5 @@ DebugStub_ResetINT1_TrapFLAG:
Pop EBP
; }
DebugStub_ResetINT1_TrapFLAG_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_ResetINT1_TrapFLAG_Exit
Ret
3 changes: 3 additions & 0 deletions playground/CmdMisc.asm
Expand Up @@ -9,6 +9,7 @@ DebugStub_Ping:
Call DebugStub_ComWriteAL
; }
DebugStub_Ping_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_Ping_Exit
Ret

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

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

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

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

; function ProcessCommandBatch {
Expand All @@ -219,4 +222,5 @@ DebugStub_ProcessCommandBatch_Begin:
Call DebugStub_AckCommand
; }
DebugStub_ProcessCommandBatch_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_ProcessCommandBatch_Exit
Ret
22 changes: 22 additions & 0 deletions playground/CmdSend.asm
Expand Up @@ -26,6 +26,7 @@ DebugStub_SendRegisters:
Call DebugStub_ComWrite32
; }
DebugStub_SendRegisters_Exit:
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendRegisters_Exit
Ret

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

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

; function SendStack {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -172,6 +176,8 @@ DebugStub_SendMethodContext_Exit:
; -All
PopAD
; }
Mov DWORD [INTS_LastKnownAddress], DebugStub_SendMethodContext_Exit
Ret

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; function SendCoreDump {
Expand Down Expand Up @@ -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.