Function at 0x481970
Capabilities:
Get file attributes
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc54
mov eax, dword [0x51c080]
xor eax, esp
mov dword [esp + 0xc50], eax
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
cmp dword [eax + 0x800], ebx
push esi
push edi
mov dword [esp + 0x18], eax
mov esi, ecx
mov byte [esp + 0xf], bl
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], ebx
je 0x481c04
cmp esi, ebx
je 0x481c04
mov eax, esi
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4819c0
sub eax, edx
sar eax, 1
je 0x481c04
mov eax, esi
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4819e0
sub eax, edx
sar eax, 1
cmp eax, 0x400
jae 0x481c04
push ebx
push 0x80
push 3
push ebx
push 1
push bind
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x481bb7
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
je 0x481bb7
cmp eax, ebx
je 0x481a6c
add eax, 1
push eax
push 0x40
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp eax, ebx
mov dword [esp + 0x14], eax
je 0x481bb7
mov edx, dword [esp + 0x10]
push ebx
lea ecx, [esp + 0x14]
push ecx
push edx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x481bb7
xor eax, eax
mov dword [esp + 0x1e], eax
mov dword [esp + 0x22], eax
mov dword [esp + 0x26], eax
mov word [esp + 0x2a], ax
lea eax, [esp + 0x2c]
push eax
push ebx
push ebx
push edi
mov word [esp + 0x2c], bx
call dword [sym.imp.KERNEL32.dll_GetFileTime]
test eax, eax
je 0x481aa6
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
push esi
mov dword [esp + 0x54], ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
movzx ecx, word [esp + 0x1e]
movzx edx, word [esp + 0x22]
mov dword [esp + 0x54], eax
movzx eax, word [esp + 0x1c]
mov dword [esp + 0x48], eax
movzx eax, word [esp + 0x24]
mov dword [esp + 0x44], ecx
movzx ecx, word [esp + 0x26]
mov dword [esp + 0x40], edx
movzx edx, word [esp + 0x28]
push 0x800
mov dword [esp + 0x40], eax
lea eax, [esp + 0x45c]
push ebx
push eax
mov dword [esp + 0x58], ebx
mov dword [esp + 0x44], ecx
mov dword [esp + 0x40], edx
call fcn.004ab450
add esp, 0xc
push 0x400
lea ecx, [esp + 0x5c]
push ebx
push ecx
call fcn.004ab450
add esp, 0xc
push esi
lea edx, [esp + 0x45c]
push 0x400
push edx
call fcn.004a9ecb
mov esi, dword [esp + 0x24]
mov eax, esi
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x481b37
sub eax, edx
sar eax, 1
cmp word [esp + eax*2 + 0x458], 0x5c
lea eax, [esp + eax*2 + 0x458]
jne 0x481b5b
add eax, 2
push ebx
push ebx
push 0x400
lea ecx, [esp + 0x64]
push ecx
push 0xffffffffffffffff
push eax
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
je 0x481bb7
mov ecx, dword [esi + 0x800]
lea edx, [esp + 0x34]
push edx
lea edx, [esp + 0x5c]
call fcn.00484a50
add esp, 4
test eax, eax
jne 0x481bb2
mov ecx, dword [esp + 0x14]
cmp ecx, ebx
je 0x481bb2
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x481bb2
push eax
mov eax, ecx
mov ecx, dword [esi + 0x800]
call fcn.00484fe0
add esp, 4
mov byte [esp + 0xf], 1
cmp edi, ebx
je 0x481bc7
cmp edi, 0xffffffff
je 0x481bc7
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x481bd6
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x18]
mov ecx, dword [eax + 0x800]
push ecx
call fcn.004850e0
mov al, byte [esp + 0x13]
add esp, 4
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xc50]
xor ecx, esp
call fcn.004a998e
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [esp + 0xc5c]
pop edi
pop esi
pop ebx
xor ecx, esp
xor al, al
call fcn.004a998e
mov esp, ebp
pop ebp
ret 4