summaryrefslogtreecommitdiff
path: root/asm/rich4_clib.asm
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2021-05-11 20:09:47 +0800
committerIru Cai <mytbk920423@gmail.com>2021-05-11 20:09:47 +0800
commita5622c7b9b4734ab1d24f47f41d742874c68b424 (patch)
tree9871ee59f596dedb4501142b0c57488280d9b773 /asm/rich4_clib.asm
parent43a2bb0a40157f246bb61702653bfc010d1ca36f (diff)
downloadrich4-a5622c7b9b4734ab1d24f47f41d742874c68b424.tar.xz
move out part of fclose()
Diffstat (limited to 'asm/rich4_clib.asm')
-rw-r--r--asm/rich4_clib.asm34
1 files changed, 34 insertions, 0 deletions
diff --git a/asm/rich4_clib.asm b/asm/rich4_clib.asm
index d1e3b86..cb550e5 100644
--- a/asm/rich4_clib.asm
+++ b/asm/rich4_clib.asm
@@ -1,7 +1,12 @@
global clib_fopen
+global clib_fclose
extern fcn_00457135
extern fcn_004590b9
extern fcn_00457254
+extern fcn_00457902
+extern ref_00488f60
+extern ref_00488f64
+extern ref_004991d4
section .text
@@ -63,4 +68,33 @@ add esp, 0xc
pop ebx
ret
+clib_fclose:
+push ebx
+mov ebx, dword [esp + 8]
+call dword [ref_00488f60] ; ucall: call dword [0x488f60]
+mov eax, dword [ref_004991d4] ; mov eax, dword [0x4991d4]
+
+loc_004578d5:
+test eax, eax
+jne short loc_004578e6 ; jne 0x4578e6
+call dword [ref_00488f64] ; ucall: call dword [0x488f64]
+mov eax, 0xffffffff
+pop ebx
+ret
+
+loc_004578e6:
+cmp ebx, dword [eax + 4]
+je short loc_004578ef ; je 0x4578ef
+mov eax, dword [eax]
+jmp short loc_004578d5 ; jmp 0x4578d5
+
+loc_004578ef:
+call dword [ref_00488f64] ; ucall: call dword [0x488f64]
+push 1
+push ebx
+call fcn_00457902 ; call 0x457902
+add esp, 8
+pop ebx
+ret
+
section .data