Skip to content

Commit 7531c33

Browse files
committed
Misc DOS additions
1 parent 6b136dd commit 7531c33

File tree

1 file changed

+39
-5
lines changed

1 file changed

+39
-5
lines changed

qiling/os/dos/interrupts/int21.py

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99

1010
from .. import utils
1111

12-
# exit
13-
def __leaf_4c(ql: Qiling):
14-
ql.log.info("Program terminated gracefully")
15-
ql.emu_stop()
16-
1712
# write a character to screen
1813
def __leaf_02(ql: Qiling):
1914
ch = ql.arch.regs.dl
@@ -131,6 +126,45 @@ def __leaf_43(ql: Qiling):
131126
ql.arch.regs.cx = 0xffff
132127
ql.os.clear_cf()
133128

129+
130+
def __leaf_48(ql: Qiling):
131+
"""Allocate memory.
132+
"""
133+
134+
size = ql.arch.regs.bx * 0x10
135+
136+
# announce it but do not do anything really
137+
ql.log.debug(f'allocating memory block at {addr:#06x} to {size:#x} bytes')
138+
139+
# success
140+
ql.os.clear_cf()
141+
142+
143+
def __leaf_49(ql: Qiling):
144+
"""Deallocate memory.
145+
"""
146+
...
147+
148+
149+
def __leaf_4a(ql: Qiling):
150+
"""Modify memory allocation.
151+
"""
152+
153+
addr = ql.arch.regs.es
154+
size = ql.arch.regs.bx * 0x10
155+
156+
# announce it but do not do anything really
157+
ql.log.debug(f'resizing memory block at {addr:#06x} to {size:#x} bytes')
158+
159+
# success
160+
ql.os.clear_cf()
161+
162+
163+
def __leaf_4c(ql: Qiling):
164+
ql.log.info("Program terminated gracefully")
165+
ql.emu_stop()
166+
167+
134168
def handler(ql: Qiling):
135169
ah = ql.arch.regs.ah
136170

0 commit comments

Comments
 (0)