Function at 0x50046c
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x30
mov ebx, dword [ebp + 8]
mov eax, dword [0x597010]
xor eax, ebp
mov dword [ebp - 0x10], eax
mov edi, 0x1126
push ebx
call fcn.00500154
add esp, 4
test al, al
jne 0x50068c
xor eax, eax
lea esi, [ebp - 0x24]
mov dword [esi + 4], eax
mov dword [esi], eax
mov dword [esi + 8], eax
mov ecx, ebx
mov edx, esi
call fcn.005006af
mov bh, al
mov ecx, esi
call fcn.00500746
mov bl, al
mov ecx, esi
mov edx, esi
call fcn.005007ad
mov byte [ebp - 0x31], bl
test bl, bl
jne 0x5004da
test bh, bh
jne 0x5004da
mov edi, 0x7b
test al, al
je 0x50067b
cmp byte [ebp - 0x31], 0
jne 0x50055e
lea ebx, [ebp - 0x20]
lea edi, [ebp - 0x30]
mov ecx, edi
push 0x58df90
call fcn.0042d4b2
movzx eax, byte [ebx + 7]
test al, al
cmovs eax, dword [ebx]
mov edx, dword [ebx - 4]
cmovns edx, esi
mov ecx, edi
push eax
push edx
call fcn.0044e692
mov edi, dword [eax]
mov ecx, dword [eax + 4]
mov edx, dword [eax + 7]
mov dword [ebp - 0x15], edx
mov dword [ebp - 0x18], ecx
mov dl, byte [eax + 0xb]
xor ecx, ecx
mov dword [eax + 4], ecx
mov dword [eax], ecx
mov dword [eax + 8], ecx
cmp byte [ebx + 7], 0
jns 0x50053c
push dword [ebp - 0x24]
mov byte [ebp - 0x38], dl
call fcn.00528424
mov dl, byte [ebp - 0x38]
add esp, 4
mov dword [ebp - 0x24], edi
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x15]
mov dword [ebx + 3], ecx
mov dword [ebx], eax
mov byte [ebp - 0x19], dl
cmp byte [ebp - 0x25], 0
jns 0x50055e
push dword [ebp - 0x30]
call fcn.00528424
add esp, 4
xor edi, edi
dec edi
mov dword [ebp - 0x38], 0
lea ebx, [ebp - 0x18]
lea ecx, [ebp - 0x30]
push ebx
push edi
push 0
push esi
call fcn.0044e7aa
cmp byte [ebp - 0x19], 0
jns 0x500589
push dword [ebp - 0x24]
call fcn.00528424
add esp, 4
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x1c], eax
movsd xmm0, qword [ebp - 0x30]
movsd qword [ebp - 0x24], xmm0
cmp byte [ebp - 0x19], 0
mov eax, esi
jns 0x5005a4
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x5005bb
bt eax, 0xa
jae 0x500626
jmp 0x500677
xor ebx, ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 2]
cmp ecx, 2
jb 0x500616
cmp eax, 0x7b
je 0x500616
test byte [ebp - 0x38], 1
sete dl
or dl, byte [ebp - 0x31]
jne 0x500610
movzx edx, byte [ebp - 0x19]
test dl, dl
cmovs edx, dword [ebp - 0x20]
mov ebx, dword [ebp - 0x24]
lea esi, [ebp - 0x24]
cmovns ebx, esi
test edx, edx
je 0x500610
add edx, edx
test edx, edx
je 0x500610
lea esi, [edx - 2]
cmp word [ebx + edx - 2], 0x5c
mov edx, esi
jne 0x5005f5
mov ebx, 2
cmp esi, 6
je 0x500616
mov dword [ebp - 0x3c], eax
xor ebx, ebx
inc ebx
cmp ecx, 2
jb 0x500620
cmp eax, 0x7b
jne 0x500664
lea esi, [ebp - 0x24]
lea ebx, [ebp - 0x18]
movzx eax, byte [ebp - 0x19]
test al, al
cmovs eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
cmovns ecx, esi
mov dl, 1
mov dword [ebp - 0x38], edx
test eax, eax
je 0x500656
add eax, eax
test eax, eax
je 0x500656
lea edi, [eax - 2]
cmp word [ecx + eax - 2], 0x5c
mov eax, edi
jne 0x500641
sar edi, 1
jmp 0x500659
xor edi, edi
dec edi
cmp edi, 2
ja 0x50056b
jmp 0x500670
test ebx, ebx
jne 0x5006a0
lea esi, [ebp - 0x24]
lea ebx, [ebp - 0x18]
jmp 0x500659
mov edi, 0x1126
jmp 0x50067b
xor eax, eax
mov edi, eax
cmp byte [ebp - 0x19], 0
jns 0x50068c
push dword [ebp - 0x24]
call fcn.00528424
add esp, 4
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00528e13
mov eax, edi
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret
mov edi, 0x1126
cmp ebx, 2
mov eax, dword [ebp - 0x3c]
jne 0x500679
jmp 0x50067b