aboutsummaryrefslogtreecommitdiff
path: root/ia32/elf
diff options
context:
space:
mode:
authorexegete <nikitf-97@mail.ru>2020-10-17 16:40:23 +0300
committerexegete <nikitf-97@mail.ru>2020-10-17 16:40:23 +0300
commit65c54a8986b3519c1949d280e58f46af2eceff85 (patch)
tree0c2a20ec51f0ca2d1472b8df3dd79871e544d99a /ia32/elf
parentb6b9e29c1484c9c8b8af2b382d3a9d796c310217 (diff)
downloadcryptrobber-65c54a8986b3519c1949d280e58f46af2eceff85.tar
cryptrobber-65c54a8986b3519c1949d280e58f46af2eceff85.tar.xz
cryptrobber-65c54a8986b3519c1949d280e58f46af2eceff85.zip
float, constants, ets
Diffstat (limited to 'ia32/elf')
-rw-r--r--ia32/elf/begin.sts1
-rw-r--r--ia32/elf/syscall.sts41
2 files changed, 42 insertions, 0 deletions
diff --git a/ia32/elf/begin.sts b/ia32/elf/begin.sts
index 27b4714..8dab930 100644
--- a/ia32/elf/begin.sts
+++ b/ia32/elf/begin.sts
@@ -125,4 +125,5 @@ _return_stack ?.
# ff ?' # 20 ?'
module ia32/ia32.sts
+module ia32/elf/syscall.sts
module common/common.sts
diff --git a/ia32/elf/syscall.sts b/ia32/elf/syscall.sts
new file mode 100644
index 0000000..3acfef2
--- /dev/null
+++ b/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