Function at 0x51d228
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd0
xor edx, edx
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x10], edx
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x18], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x51db52
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
call fcn.0040a608
push eax
call dword [0x535a3c]
mov dword [ebp - 0x20], eax
imul eax, dword [0x53590c], 0x46
mov dword [0x5359d8], eax
mov eax, dword [0x535874]
mov dword [0x5359f8], eax
mov eax, 0xde
sub eax, dword [0x5359c4]
mov dword [0x535a18], eax
mov eax, dword [0x53586c]
add eax, 4
mov dword [0x53585c], eax
mov eax, dword [0x53586c]
call fcn.004071f4
mov dword [0x53586c], eax
mov eax, dword [0x5359bc]
mov dword [0x535874], eax
cmp dword [ebp - 0x20], 0xffffffff
je 0x51da91
mov eax, dword [0x53589c]
add eax, dword [0x53597c]
mov dword [0x53595c], eax
mov eax, dword [0x5359f8]
mov dword [0x53597c], eax
mov eax, dword [0x5358dc]
imul dword [0x5358e4]
mov dword [0x5359bc], eax
imul eax, dword [0x5359e8], 0x6e
mov dword [0x5359e8], eax
mov eax, dword [0x535884]
add eax, 7
mov dword [0x535a30], eax
mov eax, dword [0x5359d8]
mov dword [0x535a50], eax
mov eax, dword [0x5359d8]
mov dword [0x535a50], eax
mov eax, dword [0x535a50]
cmp eax, dword [0x535a50]
jle 0x51d326
lea eax, [ebp - 0xc]
mov edx, dword [ebp - 0x10]
call fcn.0040a01c
jmp 0x51d33d
lea ecx, [ebp - 0x1c]
mov edx, 0x53597c
mov eax, 0x5358d4
call fcn.005180f4
mov dword [0x535a00], eax
test byte [ebp - 0x1f], 4
je 0x51d909
mov eax, dword [0x5359d0]
sub eax, dword [0x535974]
cmp eax, 0x39
jge 0x51d3c4
xor eax, eax
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 2
jge 0x51d393
inc dword [ebp - 0x1c]
mov eax, dword [0x535a20]
mov edx, 0x51db6c
call fcn.0040aba0
jne 0x51d380
mov eax, dword [0x5359e8]
mov dword [0x53587c], eax
mov eax, dword [0x5359e0]
sub eax, 0x2c
mov dword [0x5358cc], eax
cmp dword [ebp - 0x1c], 2
jl 0x51d362
mov eax, dword [0x53590c]
call fcn.004071f4
mov dword [0x53590c], eax
mov eax, dword [0x53590c]
mov dword [0x53594c], eax
mov eax, dword [0x5359d0]
add eax, 4
mov dword [ebp - 0x30], eax
fild dword [ebp - 0x30]
call fcn.00407638
mov dword [0x53598c], eax
mov eax, dword [0x5359bc]
mov dword [0x535864], eax
mov eax, dword [0x53590c]
cmp eax, dword [0x535864]
jle 0x51d46a
mov eax, dword [0x5358bc]
push eax
mov eax, dword [0x5359ac]
push eax
mov eax, dword [0x535864]
push eax
mov ecx, dword [0x5359f8]
mov edx, dword [0x535a38]
mov eax, dword [ebp - 0x1c]
call fcn.004fafb4
mov dword [0x53596c], eax
mov eax, dword [0x5358b4]
add eax, dword [0x5359ac]
mov edx, dword [0x53598c]
add edx, dword [0x5358b4]
cmp eax, edx
jge 0x51d437
mov eax, dword [0x5359f8]
sub eax, dword [0x5358ec]
mov dword [0x5358f4], eax
jmp 0x51d446
mov eax, dword [0x535984]
add eax, 0xeb
mov dword [0x535974], eax
mov eax, dword [0x5359c8]
mov edx, dword [0x535a20]
call fcn.0040aba0
jne 0x51d479
mov eax, 0xe8
sub eax, dword [0x535a38]
mov dword [0x535a28], eax
jmp 0x51d479
mov eax, dword [0x53587c]
call fcn.004071f4
mov dword [0x53587c], eax
mov ecx, dword [0x535894]
mov edx, dword [0x53595c]
mov eax, dword [0x53596c]
call fcn.004f92d4
mov dword [0x535a38], eax
mov eax, dword [0x5359c4]
add eax, 0x17
mov dword [0x5358dc], eax
test byte [ebp - 0x20], 0x10
je 0x51d535
mov byte [ebp - 5], 0
jmp 0x51db37
mov eax, 0xcc
sub eax, dword [0x535934]
mov dword [0x53596c], eax
mov eax, dword [0x5359d8]
add eax, 4
mov dword [0x5359b4], eax
mov eax, dword [0x53587c]
imul dword [0x535a30]
mov dword [0x5359f8], eax
lea eax, [ebp - 0x18]
mov edx, dword [ebp - 0x18]
call fcn.0040a01c
mov eax, dword [0x5358bc]
mov dword [0x535a48], eax
mov eax, dword [0x535a28]
mov dword [0x53586c], eax
push 0
push 0
push 3
push 0
push 1
push 0x80000000
mov eax, dword [ebp - 4]
call fcn.0040a608
push eax
call dword [0x535a34]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0xffffffff
je 0x51d707
mov eax, dword [0x53589c]
add eax, 0x8d
mov dword [0x5359c4], eax
mov eax, dword [0x535934]
mov dword [0x535a08], eax
fild dword [0x5359e0]
call fcn.00407638
mov dword [0x535a48], eax
mov eax, dword [0x53586c]
cmp eax, dword [0x53592c]
jle 0x51d5f1
mov eax, dword [0x535974]
sub eax, 0x88
mov dword [0x5358ac], eax
lea eax, [ebp - 0x10]
mov edx, 0x51dbc0
call fcn.0040a01c
mov eax, dword [ebp - 0x10]
mov edx, 0x51dbe0
call fcn.0040aba0
jne 0x51d61e
mov eax, dword [0x53593c]
call fcn.004071f4
mov dword [0x53593c], eax
jmp 0x51d62d
imul eax, dword [0x53586c], 0x83
mov dword [0x5359ac], eax
mov eax, dword [ebp - 0x24]
push eax
call dword [0x535998]
mov eax, 0xb1
sub eax, dword [0x535a48]
mov dword [0x5358bc], eax
mov eax, dword [0x5358d4]
add eax, 0x49
mov dword [ebp - 0x30], eax
fild dword [ebp - 0x30]
call fcn.0040762c
mov dword [0x5358f4], eax
mov eax, dword [0x535a40]
mov dword [0x53590c], eax
mov eax, dword [0x53592c]
add eax, 0x47
mov dword [0x53594c], eax
mov eax, dword [0x535974]
add eax, 0x46
mov dword [0x5359ac], eax
mov eax, dword [0x535a30]
add eax, 0xde
mov dword [ebp - 0x30], eax
fild dword [ebp - 0x30]
call fcn.0040762c
mov dword [0x5359e8], eax
mov byte [ebp - 5], 1
jmp 0x51db37
call fcn.00518600
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 0x14]
call fcn.0040aba0
jne 0x51d750
mov eax, dword [0x5359c4]
add eax, 2
mov dword [0x5358dc], eax
mov ecx, dword [0x5359f8]
mov edx, dword [ebp - 0x1c]
mov eax, dword [0x5359d8]
call fcn.00519024
mov dword [0x535a50], eax
fild dword [0x53595c]
call fcn.0040762c
mov dword [0x53594c], eax
jmp 0x51d7b2
mov eax, dword [0x5358ec]
add eax, 0x97
mov dword [0x5359d0], eax
push 0x5358d4
lea eax, [ebp - 0x1c]
push eax
push 0x5359e0
mov ecx, 0x535884
mov edx, 0x5359e8
lea eax, [ebp - 0x1c]
call fcn.0051254c
mov dword [0x5359c4], eax
push 0x5358fc
push 0x5359c4
push 0x535a00
mov ecx, 0x53594c
lea edx, [ebp - 0x1c]
lea eax, [ebp - 0x1c]
call fcn.0051254c
mov dword [0x53586c], eax
mov eax, dword [0x5359f8]
mov dword [0x535864], eax
mov eax, dword [ebp - 0xc]
mov edx, 0x51dc04
call fcn.0040aba0
jne 0x51d7f2
mov eax, dword [0x5358cc]
imul dword [0x5359b4]
mov dword [0x5358dc], eax
mov eax, dword [0x5358f4]
add eax, 0x65
cmp eax, dword [0x535a38]
jge 0x51d832
mov eax, dword [0x53587c]
sub eax, 0x8f
mov dword [0x53595c], eax
jmp 0x51d832
mov eax, dword [0x535a28]
mov dword [0x5359d0], eax
mov eax, dword [0x5359d0]
cmp eax, dword [0x535864]
jge 0x51d818
mov eax, dword [0x5359bc]
add eax, 0x24
mov dword [0x535a48], eax
jmp 0x51d832
push 0x535a40
lea ecx, [ebp - 0x1c]
lea edx, [ebp - 0x1c]
mov eax, 0x53594c
call fcn.00519150
mov dword [0x5359d8], eax
mov eax, dword [0x535a48]
add eax, dword [0x5358e4]
mov dword [0x53593c], eax
mov eax, dword [0x5358d4]
add eax, dword [0x5359b4]
mov dword [0x535974], eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [0x535884]
push eax
mov ecx, dword [ebp - 0x1c]
mov edx, dword [0x5358ec]
mov eax, dword [0x53588c]
call fcn.004fafb4
call sub.kernel32.dll_GetLastError_2
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0x20
sete byte [ebp - 5]
jmp 0x51db37
xor eax, eax
mov dword [ebp - 0x1c], eax
mov ecx, 1
mov edx, dword [0x535a20]
mov eax, 0x51dc40
call fcn.0040ade8
cmp eax, 0x63
jge 0x51d934
mov eax, dword [0x535a00]
mov dword [0x53587c], eax
jmp 0x51d943
mov eax, dword [0x5358ac]
call fcn.004071f4
mov dword [0x5358ac], eax
mov eax, dword [0x53593c]
mov dword [0x5358e4], eax
fild dword [0x535a48]
call fcn.0040762c
mov dword [0x53590c], eax
lea eax, [ebp - 0x10]
push eax
mov ecx, 3
mov edx, 1
mov eax, dword [ebp - 0x18]
call fcn.0040abd8
imul eax, dword [0x53588c], 0xfe
mov dword [0x53596c], eax
inc dword [ebp - 0x1c]
cmp dword [ebp - 0x1c], 0xc
jne 0x51d90e
mov eax, dword [0x535884]
imul dword [0x5358a4]
mov dword [0x5359d8], eax
fild dword [0x535904]
call fcn.00407638
mov dword [0x535a28], eax
lea eax, [ebp - 0x18]
push eax
xor ecx, ecx
mov edx, 1
mov eax, dword [ebp - 0xc]
call fcn.0040abd8
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
je 0x51d9d5
mov eax, dword [ebp - 0x2c]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0xa
jne 0x51d9e5
mov eax, dword [0x5359c4]
mov dword [0x53585c], eax
push 0x535a38
mov ecx, 0x535a18
lea edx, [ebp - 0x1c]
mov eax, 0x5358ec
call fcn.00503774
mov dword [0x5358e4], eax
test byte [ebp - 0x20], 0x10
sete byte [ebp - 5]
jmp 0x51db37
call sub.kernel32.dll_GetLastError_2
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 2
je 0x51daab
cmp dword [ebp - 0x28], 3
je 0x51daab
cmp dword [ebp - 0x28], 0x7b
jne 0x51daaf
xor eax, eax
jmp 0x51dab1
mov al, 1
mov byte [ebp - 5], al
mov eax, dword [0x535944]
mov dword [0x53587c], eax
push 0x5359e0
lea eax, [ebp - 0x1c]
push eax
push 0x5358bc
lea ecx, [ebp - 0x1c]
lea edx, [ebp - 0x1c]
mov eax, 0x535a28
call fcn.004ff010
mov dword [0x53585c], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x1c]
jne 0x51dafd
mov eax, dword [0x5359c4]
mov edx, eax
shl eax, 4
sub eax, edx
mov dword [0x535a48], eax
mov eax, dword [0x535864]
sub eax, dword [0x5359bc]
cmp eax, 0xaf
jge 0x51db1a
lea eax, [ebp - 0xc]
mov edx, dword [ebp - 0xc]
call fcn.0040a01c
lea eax, [ebp - 0xc]
mov edx, 0x51dc64
call fcn.0040a01c
mov eax, dword [0x535a00]
sub eax, dword [0x5359e0]
mov dword [0x5358dc], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51db59
lea eax, [ebp - 0x18]
mov edx, 4
call fcn.00409c54
ret