Function at 0x501638
Capabilities:
Get file attributes
Set file attributes

Disassembly:
mov eax, 0x674b6c
call fcn.006313fc
sub esp, 0xd4
push ebx
mov bl, byte [esp + 0xf0]
xor eax, eax
push ebp
push esi
or esi, 0xffffffff
inc eax
mov dword [esp + 0xc], esi
push edi
cmp bl, al
je 0x50166a
cmp bl, 4
je 0x50166a
xor bh, bh
jmp 0x50166c
mov bh, al
and dword [esp + 0x88], 0
push 0x48
mov dword [esp + 0x90], eax
lea eax, [esp + 0xa0]
push 0
push eax
mov byte [esp + 0x23], bh
mov dword [esp + 0x9c], 2
mov dword [esp + 0xa0], 3
mov dword [esp + 0xa4], 0xb
call fcn.00635a30
mov ecx, dword [esp + 0x10c]
add esp, 0xc
mov edi, dword [esp + 0xf8]
movzx eax, bl
mov ecx, dword [ecx]
push edi
mov ebp, dword [esp + eax*4 + 0x8c]
lea eax, [esp + 0x28]
push eax
mov dword [esp + 0x20], ebp
call fcn.004fd6a4
and dword [esp + 0xec], 0
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x40]
call fcn.00422efb
mov eax, dword [esp + 0x100]
lea ecx, [esp + 0x70]
mov byte [esp + 0xec], 1
mov eax, dword [eax]
add eax, 0x40
push eax
call fcn.00422efb
cmp dword [esp + 0x50], 8
mov eax, dword [esp + 0x3c]
mov byte [esp + 0xec], 2
jae 0x501728
lea eax, [esp + 0x3c]
push eax
call fcn.0045deea
test al, al
jne 0x50178a
cmp dword [esp + 0x38], 8
mov eax, dword [esp + 0x24]
jae 0x501741
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x5c]
push eax
call fcn.0046e883
push eax
lea ecx, [esp + 0x40]
call fcn.0044dbe6
push 0
push 1
lea ecx, [esp + 0x60]
call fcn.0042341c
call fcn.0046e3b9
push eax
lea eax, [esp + 0x5c]
push eax
call fcn.004243aa
push eax
lea ecx, [esp + 0x74]
call fcn.0044dbe6
push 0
push 1
lea ecx, [esp + 0x60]
call fcn.0042341c
cmp dword [esp + 0x50], 8
mov eax, dword [esp + 0x3c]
jae 0x501799
lea eax, [esp + 0x3c]
push eax
call fcn.00460528
cmp dword [edi + 0xc], edx
jb 0x5017bd
ja 0x5017ab
cmp dword [edi + 8], eax
jbe 0x5017bd
mov eax, dword [esp + 0x104]
mov dword [eax], 0xdf
jmp 0x501b08
and dword [esp + 0x1c], 0
and dword [esp + 0x20], 0
cmp dword [esp + 0x38], 8
mov eax, dword [esp + 0x24]
jae 0x5017d6
lea eax, [esp + 0x24]
lea ecx, [esp + 0x1c]
push ecx
push eax
call fcn.00662464
test al, al
je 0x5017f7
mov eax, dword [esp + 0x1c]
cmp eax, dword [edi + 8]
jne 0x5017f7
mov eax, dword [esp + 0x20]
cmp eax, dword [edi + 0xc]
je 0x50181c
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], esi
test bh, bh
je 0x501922
cmp dword [esp + 0x38], 8
mov eax, dword [esp + 0x24]
jae 0x501816
lea eax, [esp + 0x24]
push eax
call fcn.0045f74f
test bh, bh
je 0x501922
cmp byte [0x76b934], 0
jne 0x501850
cmp byte [0x76b933], 0
je 0x501857
cmp dword [esp + 0x50], 8
mov eax, dword [esp + 0x3c]
jae 0x501845
lea eax, [esp + 0x3c]
push eax
call fcn.0051ce96
cmp eax, 1
jne 0x501857
push 0xb
pop ebp
mov dword [esp + 0x18], ebp
cmp dword [esp + 0x38], 8
mov eax, dword [esp + 0x24]
jae 0x501866
lea eax, [esp + 0x24]
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesW]
cmp eax, esi
je 0x50188f
test al, 1
je 0x50188f
cmp dword [esp + 0x38], 8
mov ecx, dword [esp + 0x24]
jae 0x501884
lea ecx, [esp + 0x24]
and eax, 0xfffffffe
push eax
push ecx
call dword [sym.imp.KERNEL32.DLL_SetFileAttributesW]
cmp byte [0x76b932], 0
jne 0x5018a4
mov eax, dword [esp + 0x1c]
and eax, dword [esp + 0x20]
cmp eax, esi
jne 0x5018b0
cmp bl, 4
je 0x5018b0
push 0xa
pop ebp
mov dword [esp + 0x18], ebp
mov ecx, dword [esp + 0x10]
cmp ecx, esi
jne 0x5018d9
cmp dword [esp + 0x38], 8
mov eax, dword [esp + 0x24]
jae 0x5018c7
lea eax, [esp + 0x24]
push 0x80
push ebp
push eax
call fcn.0045eeaa
mov ecx, eax
mov dword [esp + 0x10], ecx
mov ebp, dword [0x76b8e8]
cmp ecx, esi
jne 0x501a77
mov ebx, dword [sym.imp.KERNEL32.DLL_GetLastError]
test ebp, ebp
je 0x501a01
call ebx
cmp dword [esp + 0x18], 0xa
mov ecx, dword [esp + 0x104]
mov dword [ecx], eax
jne 0x5019c4
mov eax, dword [esp + 0x1c]
cmp eax, dword [edi + 8]
jne 0x50198d
mov eax, dword [esp + 0x20]
cmp eax, dword [edi + 0xc]
jne 0x50198d
xor ecx, ecx
inc ecx
jmp 0x501990
cmp bl, 3
jne 0x5018b0
mov eax, dword [esp + 0x1c]
cmp eax, dword [edi + 8]
jne 0x50193d
mov eax, dword [esp + 0x20]
cmp eax, dword [edi + 0xc]
je 0x5018b0
cmp dword [esp + 0x38], 8
mov eax, dword [esp + 0x24]
jae 0x50194c
lea eax, [esp + 0x24]
push eax
call fcn.0045f74f
push dword [esp + 0x10c]
mov ebx, dword [esp + 0x108]
push 0
push ebx
push dword [esp + 0x10c]
push 1
push edi
call fcn.00501638
mov ecx, eax
mov dword [esp + 0x10], ecx
cmp ecx, esi
jne 0x5018d9
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [ebx], eax
jmp 0x501a10
push 6
pop ecx
cmp dword [esp + 0x38], 8
mov eax, dword [esp + 0x24]
mov dword [esp + 0x18], ecx
jae 0x5019a3
lea eax, [esp + 0x24]
push 0x80
push ecx
push eax
call fcn.0045eeaa
mov dword [esp + 0x10], eax
call ebx
mov ecx, dword [esp + 0x104]
mov dword [ecx], eax
mov ecx, dword [esp + 0x10]
jmp 0x5019f8
cmp eax, 0x20
jne 0x501a19
push 0xc8
call dword [sym.imp.KERNEL32.DLL_Sleep]
cmp dword [esp + 0x38], 8
mov eax, dword [esp + 0x24]
jae 0x5019e3
lea eax, [esp + 0x24]
push 0x80
push dword [esp + 0x1c]
push eax
call fcn.0045eeaa
mov ecx, eax
mov dword [esp + 0x10], ecx
dec ebp
cmp ecx, esi
je 0x5018ed
cmp ecx, esi
jne 0x501a77
call ebx
mov ecx, dword [esp + 0x104]
mov dword [ecx], eax
mov esi, dword [esp + 0x10]
jmp 0x501b08
cmp byte [esp + 0xfc], 3
je 0x501a2d
cmp byte [esp + 0x108], 0
je 0x501a3e
cmp eax, 0x490
je 0x501a5c
cmp eax, 2
je 0x501a5c
cmp eax, 3
je 0x501a5c
cmp dword [esp + 0x38], 8
mov ecx, dword [esp + 0x24]
jae 0x501a4d
lea ecx, [esp + 0x24]
push eax
push ecx
push str.Error_opening___s_:__E
call fcn.004790ad
add esp, 0xc
mov eax, dword [esp + 0x104]
cmp dword [eax], 0
jne 0x501b08
mov dword [eax], 2
jmp 0x501b08
mov bl, byte [esp + 0x17]
test bl, bl
je 0x501afc
mov eax, dword [esp + 0x1c]
cmp eax, dword [edi + 8]
jne 0x501a91
mov eax, dword [esp + 0x20]
cmp eax, dword [edi + 0xc]
je 0x501adc
mov eax, dword [esp + 0x100]
push dword [esp + 0x10c]
mov eax, dword [eax]
cmp dword [eax + 0xd8], 0
lea eax, [esp + 0x28]
setne byte [esp + 0x58]
push dword [esp + 0x58]
push dword [esp + 0x10c]
push dword [esp + 0x24]
push edi
push eax
push ecx
call fcn.005044c8
test eax, eax
jne 0x501ad8
lea eax, [esp + 0x10]
push eax
call fcn.0045ee3a
jmp 0x501b08
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x100]
mov eax, dword [eax]
cmp byte [eax + 0xd0], 0
jne 0x501afc
lea eax, [esp + 0x24]
push eax
call fcn.0053a185
mov ecx, dword [esp + 0x10]
mov al, byte [edi + 0x66]
mov esi, ecx
xor al, bl
and al, 1
xor byte [edi + 0x66], al
xor ebx, ebx
lea ecx, [esp + 0x70]
push ebx
push 1
call fcn.0042341c
push ebx
push 1
lea ecx, [esp + 0x44]
call fcn.0042341c
push ebx
push 1
lea ecx, [esp + 0x2c]
call fcn.0042341c
mov ecx, dword [esp + 0xe4]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
leave
ret 0x18