summaryrefslogtreecommitdiff
path: root/asm/rich4_clib.asm
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2021-05-11 20:03:00 +0800
committerIru Cai <mytbk920423@gmail.com>2021-05-11 20:03:00 +0800
commit43a2bb0a40157f246bb61702653bfc010d1ca36f (patch)
tree1a4954ce7f3b29bba900fa3ee7671ef0a02002e2 /asm/rich4_clib.asm
parent4c2bb0c68250e45d0a0f82a6f84fe893b54219ee (diff)
downloadrich4-43a2bb0a40157f246bb61702653bfc010d1ca36f.tar.xz
move out part of fopen()
Diffstat (limited to 'asm/rich4_clib.asm')
-rw-r--r--asm/rich4_clib.asm66
1 files changed, 66 insertions, 0 deletions
diff --git a/asm/rich4_clib.asm b/asm/rich4_clib.asm
new file mode 100644
index 0000000..d1e3b86
--- /dev/null
+++ b/asm/rich4_clib.asm
@@ -0,0 +1,66 @@
+global clib_fopen
+extern fcn_00457135
+extern fcn_004590b9
+extern fcn_00457254
+
+section .text
+
+fcn_00457366:
+push ebx
+push esi
+push edi
+sub esp, 4
+mov eax, esp
+push eax
+mov edx, dword [esp + 0x1c]
+push edx
+call fcn_00457135 ; call 0x457135
+mov ebx, eax
+add esp, 8
+test eax, eax
+je short loc_004573b8 ; je 0x4573b8
+push 0
+call fcn_004590b9 ; call 0x4590b9
+add esp, 4
+mov edx, eax
+test eax, eax
+je short loc_004573b6 ; je 0x4573b6
+push eax
+mov ecx, dword [esp + 0x20]
+push ecx
+mov esi, dword [esp + 8]
+push esi
+mov edx, dword [esp + 0x24]
+xor eax, eax
+push ebx
+mov al, byte [edx]
+push eax
+mov edi, dword [esp + 0x28]
+push edi
+call fcn_00457254 ; call 0x457254
+add esp, 0x18
+mov edx, eax
+
+loc_004573b6:
+mov eax, edx
+
+loc_004573b8:
+add esp, 4
+pop edi
+pop esi
+pop ebx
+ret
+
+clib_fopen:
+push ebx
+push 0
+mov edx, dword [esp + 0x10]
+push edx
+mov ebx, dword [esp + 0x10]
+push ebx
+call fcn_00457366 ; call 0x457366
+add esp, 0xc
+pop ebx
+ret
+
+section .data