diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2020-10-18 18:22:31 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2020-10-18 18:22:31 +0300 |
commit | df0d6a4503a26508553510b4050eaa79f52e4e4e (patch) | |
tree | 2517b6070319270a4cb0df9dcf3814b16ecaece9 /sts/ia32/elf/syscall.sts | |
parent | 9eadc7bac8863b7fd3a39edc9ba31cf4d3b5ab95 (diff) | |
download | cryptrobber-df0d6a4503a26508553510b4050eaa79f52e4e4e.tar cryptrobber-df0d6a4503a26508553510b4050eaa79f52e4e4e.tar.xz cryptrobber-df0d6a4503a26508553510b4050eaa79f52e4e4e.zip |
Another step to release.
Diffstat (limited to 'sts/ia32/elf/syscall.sts')
-rw-r--r-- | sts/ia32/elf/syscall.sts | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sts/ia32/elf/syscall.sts b/sts/ia32/elf/syscall.sts new file mode 100644 index 0000000..3acfef2 --- /dev/null +++ b/sts/ia32/elf/syscall.sts @@ -0,0 +1,41 @@ +defasm sys_exit + # b8 ?' # 1 ?. ; mov eax, 1 + # 31 ?' # db ?' ; xor ebx, ebx + # cd ?' # 80 ?' ; int 0x80 +; no need in next since this is the last instruction + +_data_segment ?choose + ?$ ?? _iobuf # 0 ?. +_code_segment ?choose + +defasm sys_read + # b8 ?' # 3 ?. ; mov eax, 3 + # 31 ?' # db ?' ; xor ebx, ebx + # b9 ?' _iobuf ?. ; mov ecx, _iobuf + # ba ?' # 1 ?. ; mov edx, 1 + # cd ?' # 80 ?' ; int 0x80 + # 31 ?' # db ?' ; xor ebx, ebx + # 8a ?' # 1d ?' _iobuf ?. ; mov bl, [_iobuf] + # 53 ?' ; push ebx + # 50 ?' ; push eax +next + +defasm sys_write + # 58 ?' ; pop eax + # a2 ?' _iobuf ?. ; mov [_iobuf], al + # b8 ?' # 4 ?. ; mov eax, 4 + # bb ?' # 1 ?. ; mov ebx, 1 + # b9 ?' _iobuf ?. ; mov ecx, _iobuf + # ba ?' # 1 ?. ; mov edx, 1 + # cd ?' # 80 ?' ; int 0x80 +next + +defasm sys_write_err + # 58 ?' ; pop eax + # a2 ?' _iobuf ?. ; mov [_iobuf], al + # b8 ?' # 4 ?. ; mov eax, 4 + # bb ?' # 2 ?. ; mov ebx, 2 + # b9 ?' _iobuf ?. ; mov ecx, _iobuf + # ba ?' # 1 ?. ; mov edx, 1 + # cd ?' # 80 ?' ; int 0x80 +next |