Function at 0x4037d0
Capabilities:
Check if file exists
Get file attributes
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x428d82
mov eax, dword fs:[0]
push eax
sub esp, 0xc60
mov eax, dword [0x438040]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0xc18], edx
mov dword [ebp - 0xc50], ecx
mov eax, dword [ebp + 0x10]
mov edx, ecx
mov edi, dword [ebp + 0xc]
lea ecx, [ebp - 0xc14]
mov dword [ebp - 0xc30], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc34], edi
mov dword [ebp - 0xc20], eax
call fcn.00403680
mov dword [ebp - 4], 0
mov esi, dword [ebp - 0xc14]
cmp dword [esi], 0x72613c21
jne 0x4041a2
cmp dword [esi + 4], 0xa3e6863
jne 0x4041a2
lea ecx, [edi + 1]
nop word [eax + eax]
mov al, byte [edi]
inc edi
test al, al
jne 0x403860
mov edx, dword [ebp - 0xc30]
sub edi, ecx
mov dword [ebp - 0xc58], edi
lea ecx, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x403878
sub edx, ecx
mov dword [ebp - 0xc48], edx
cmp edi, edx
jae 0x403894
cmp edx, 0x10
jae 0x4041a2
lea edi, [esi + 0x42]
cmp byte [edi], 0x60
je 0x40389f
inc edi
jmp 0x403897
push 0xa
lea eax, [esi + 0x38]
add edi, 2
push 0
push eax
call fcn.00412c7d
add esp, 0xc
lea ecx, [edi + eax]
lea edi, [ecx + 0x3a]
mov eax, edi
nop word [eax + eax]
cmp byte [eax], 0x60
je 0x4038c8
inc eax
jmp 0x4038c0
push 0xa
mov dword [ebp - 0xc40], eax
lea eax, [ecx + 0x30]
push 0
push eax
call fcn.00412c7d
mov ecx, dword [ebp - 0xc40]
add ecx, 0x32
push 0xa
add eax, ecx
push 0
push eax
mov dword [ebp - 0xc24], eax
call fcn.00412c7d
add esp, 0x18
nop dword [eax]
cmp byte [edi], 0x60
je 0x403908
inc edi
jmp 0x403900
push 0xa
push 0
push dword [ebp - 0xc24]
call fcn.00412c7d
mov eax, dword [edi + 2]
mov dword [ebp - 0xc24], eax
lea eax, [edi + 6]
push 0x14
mov dword [ebp - 0xc54], eax
mov dword [ebp - 0xc2c], 0
mov dword [ebp - 0xc28], 0
call fcn.0040ee95
add esp, 0x10
mov dword [eax], eax
mov dword [eax + 4], eax
mov dword [eax + 8], eax
mov word [eax + 0xc], 0x101
mov dword [ebp - 0xc2c], eax
mov byte [ebp - 4], 1
mov edi, dword [ebp - 0xc20]
push 0x4314d0
push edi
call dword [sym.imp.SHLWAPI.dll_StrCmpIW]
mov dword [ebp - 0xc4c], eax
test eax, eax
je 0x403b76
call fcn.0040db30
mov ecx, eax
test ecx, ecx
je 0x4041e3
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0xc1c], eax
push dword [ebp - 0xc18]
lea edx, [ebp - 0xc1c]
mov byte [ebp - 4], 2
mov ecx, edi
call fcn.00403350
mov edi, eax
add esp, 4
test edi, edi
je 0x403a0c
mov byte [ebp - 4], 1
or eax, 0xffffffff
mov edx, dword [ebp - 0xc1c]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4039e0
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0xc2c]
push dword [eax + 4]
lea eax, [ebp - 0xc2c]
push eax
mov ecx, eax
call fcn.0040ba70
push 0x14
push dword [ebp - 0xc2c]
call fcn.0040e95e
add esp, 8
jmp 0x4041a7
mov edi, dword [ebp - 0xc1c]
cmp word [edi], 0
je 0x403b5a
mov esi, dword [ebp - 0xc18]
push 0x3d
push edi
call dword [sym.imp.SHLWAPI.dll_StrChrW]
test eax, eax
jne 0x403a46
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x403a34
sub ecx, edx
sar ecx, 1
lea eax, [edi + ecx*2]
cmp word [edi], 0x3f
je 0x403ae0
mov ecx, 0x8664
cmp si, cx
je 0x403ae0
mov ecx, 0xaa64
cmp si, cx
je 0x403ae0
mov ecx, 0x1c0
cmp si, cx
je 0x403ae0
sub eax, edi
lea ecx, [ebp - 0xc3c]
sar eax, 1
push eax
push edi
call fcn.0040a690
push eax
mov edx, 0x4314d8
mov byte [ebp - 4], 4
lea ecx, [ebp - 0xc20]
call fcn.0040a150
add esp, 4
push eax
lea eax, [ebp - 0xc60]
mov byte [ebp - 4], 5
push eax
lea ecx, [ebp - 0xc2c]
call fcn.0040b150
mov byte [ebp - 4], 4
or eax, 0xffffffff
mov edx, dword [ebp - 0xc20]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x403ad4
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0xc3c]
jmp 0x403b12
sub eax, edi
lea ecx, [ebp - 0xc38]
sar eax, 1
push eax
push edi
call fcn.0040a690
push eax
lea eax, [ebp - 0xc44]
mov byte [ebp - 4], 3
push eax
lea ecx, [ebp - 0xc2c]
call fcn.0040b150
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0xc38]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x403b2a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, edi
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x403b30
sub ecx, edx
sar ecx, 1
lea edi, [edi + ecx*2]
add edi, 2
cmp word [edi], ax
jne 0x403a22
mov edi, dword [ebp - 0xc1c]
mov esi, dword [ebp - 0xc14]
mov byte [ebp - 4], 1
add edi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x403b76
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0xc34]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFindExtensionA]
call edi
push dword [ebp - 0xc30]
mov dword [ebp - 0xc20], eax
call edi
push 0x5ff
mov dword [ebp - 0xc18], eax
lea eax, [ebp - 0x60f]
push 0
push eax
call fcn.004105f0
push 0x5ff
lea eax, [ebp - 0xc0f]
push 0
push eax
call fcn.004105f0
add esp, 0x18
cmp dword [ebp - 0xc4c], 0
jne 0x403d7e
mov eax, dword [ebp - 0xc34]
mov esi, dword [ebp - 0xc20]
sub esi, eax
mov byte [ebp - 0x610], 0x7f
push esi
push eax
lea eax, [ebp - 0x60f]
push eax
call fcn.00410070
lea ecx, [ebp - 0x610]
add esp, 0xc
dec ecx
nop dword [eax + eax]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x403c00
mov edi, dword [str._NULL_THUNK_DATA]
mov eax, dword [0x4314e0]
mov dword [ecx], edi
mov dword [ecx + 4], eax
mov eax, dword [0x4314e4]
mov dword [ecx + 8], eax
mov eax, dword [0x4314e8]
mov dword [ecx + 0xc], eax
mov al, byte [0x4314ec]
mov byte [ecx + 0x10], al
mov eax, dword [ebp - 0xc18]
mov ecx, dword [ebp - 0xc30]
sub eax, ecx
push eax
mov dword [ebp - 0xc18], eax
lea eax, [ebp - 0xc0f]
push ecx
push eax
mov byte [ebp - 0xc10], 0x7f
call fcn.00410070
lea ecx, [ebp - 0xc10]
add esp, 0xc
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x403c65
mov eax, dword [0x4314e0]
mov dword [ecx], edi
mov dword [ecx + 4], eax
mov eax, dword [0x4314e4]
mov dword [ecx + 8], eax
mov eax, dword [0x4314e8]
mov dword [ecx + 0xc], eax
mov al, byte [0x4314ec]
mov byte [ecx + 0x10], al
lea ecx, [ebp - 0x410]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x403c98
mov edi, dword [str.__IMPORT_DESCRIPTOR_]
mov eax, dword [0x4314f4]
mov dword [ecx], edi
mov dword [ecx + 4], eax
mov eax, dword [0x4314f8]
mov dword [ecx + 8], eax
mov eax, dword [0x4314fc]
mov dword [ecx + 0xc], eax
mov eax, dword [0x431500]
mov dword [ecx + 0x10], eax
mov al, byte [0x431504]
push esi
push dword [ebp - 0xc34]
mov byte [ecx + 0x14], al
lea eax, [ebp - 0x3fc]
push eax
call fcn.00410070
lea ecx, [ebp - 0xa10]
add esp, 0xc
dec ecx
nop
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x403cf0
mov eax, dword [0x4314f4]
mov dword [ecx], edi
mov dword [ecx + 4], eax
mov eax, dword [0x4314f8]
mov dword [ecx + 8], eax
mov eax, dword [0x4314fc]
mov dword [ecx + 0xc], eax
mov eax, dword [0x431500]
mov dword [ecx + 0x10], eax
mov al, byte [0x431504]
mov byte [ecx + 0x14], al
mov eax, dword [ebp - 0xc18]
push eax
push dword [ebp - 0xc30]
lea eax, [ebp - 0x9fc]
push eax
call fcn.00410070
lea edi, [ebp - 0x210]
add esp, 0xc
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x403d47
mov ecx, 6
mov esi, str.__NULL_IMPORT_DESCRIPTOR
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x810]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x403d63
mov ecx, 6
mov esi, str.__NULL_IMPORT_DESCRIPTOR
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0xc14]
xor eax, eax
mov dword [ebp - 0xc20], eax
cmp dword [ebp - 0xc24], eax
je 0x4040dd
mov ecx, dword [ebp - 0xc54]
mov eax, dword [ecx + eax*4]
add eax, esi
mov dword [ebp - 0xc18], eax
lea edi, [eax + 0x3a]
cmp byte [edi], 0x60
je 0x403dae
inc edi
jmp 0x403da6
push 0xa
add eax, 0x30
push 0
push eax
call fcn.00412c7d
add esp, 0xc
cmp word [edi + 2], 0
jne 0x4040c4
mov eax, 0xffff
cmp word [edi + 4], ax
jne 0x4040c4
mov esi, dword [ebp - 0xc18]
mov dword [ebp - 0xc3c], esi
call fcn.0040db30
mov ecx, eax
test ecx, ecx
je 0x4041e3
test esi, esi
je 0x4041ed
mov eax, dword [ecx]
push 1
push 0x10
mov eax, dword [eax]
call eax
test eax, eax
je 0x4041f7
cmp dword [eax + 8], 0x10
lea ecx, [eax + 0x10]
mov dword [ebp - 0xc1c], ecx
jl 0x4041ed
mov dword [eax + 4], 0x10
mov byte [eax + 0x20], 0
test ecx, ecx
jne 0x403e41
call fcn.00411fa6
mov dword [eax], 0x16
call fcn.00411ecc
jmp 0x403e47
movups xmm0, xmmword [esi]
movups xmmword [ecx], xmm0
lea ecx, [ebp - 0xc1c]
mov byte [ebp - 4], 6
call fcn.0040a470
mov esi, dword [ebp - 0xc1c]
mov ecx, dword [esi - 0xc]
test ecx, ecx
je 0x403e8c
lea eax, [ecx - 1]
test eax, eax
js 0x4041ed
cmp eax, ecx
jg 0x4041ed
cmp byte [eax + esi], 0x2f
jne 0x403e8c
cmp eax, dword [esi - 8]
jg 0x4041ed
mov dword [esi - 0xc], eax
mov byte [eax + esi], 0
push 0x431524
push esi
call fcn.00418134
add esp, 8
test eax, eax
jne 0x403edf
lea edx, [edi + 0x16]
mov ecx, edx
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x403ea6
sub ecx, esi
inc edx
add edx, ecx
mov dword [ebp - 0xc3c], edx
jne 0x403ebe
xor ecx, ecx
jmp 0x403ecc
mov ecx, edx
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x403ec3
sub ecx, esi
push ecx
push edx
lea ecx, [ebp - 0xc1c]
call fcn.0040d380
mov esi, dword [ebp - 0xc1c]
lea eax, [edi + 0x16]
push eax
push 0x431528
call fcn.0040cf70
mov eax, dword [ebp - 0xc34]
add esp, 8
test eax, eax
je 0x4041e3
push eax
push esi
call fcn.00417e71
add esp, 8
test eax, eax
jne 0x4040a2
cmp dword [ebp - 0xc4c], eax
je 0x403fec
movzx eax, word [edi + 0x14]
shr eax, 2
and eax, 7
cmp eax, 4
ja case.default.0x403f2f
jmp dword [eax*4 + 0x4041fc]
lea eax, [edi + 0x16]
push eax
push 0x431538
call fcn.0040cf70
add esp, 8
jmp 0x4040a2
lea eax, [edi + 0x16]
push eax
lea ecx, [ebp - 0xc40]
call fcn.0040a8b0
mov eax, dword [ebp - 0xc2c]
lea ecx, [ebp - 0xc2c]
mov dword [ebp - 0xc5c], eax
lea eax, [ebp - 0xc40]
push eax
lea eax, [ebp - 0xc6c]
push eax
call fcn.0040c300
mov eax, dword [ebp - 0xc64]
mov dword [ebp - 0xc38], eax
cmp byte [eax + 0xd], 0
jne 0x403fb0
mov eax, dword [eax + 0x10]
test eax, eax
je 0x4041e3
push eax
push dword [ebp - 0xc40]
call fcn.00418134
add esp, 8
test eax, eax
jns 0x403fbc
mov eax, dword [ebp - 0xc2c]
mov dword [ebp - 0xc38], eax
mov edx, dword [ebp - 0xc40]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x403fda
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0xc5c]
cmp dword [ebp - 0xc38], eax
je 0x4040a2
lea eax, [edi + 0x16]
push eax
push 0x431528
call fcn.0040cf70
mov eax, dword [ebp - 0xc58]
mov edi, dword [ebp - 0xc3c]
inc eax
push eax
push 0
push edi
call fcn.004105f0
mov eax, dword [ebp - 0xc48]
add esp, 0x14
cmp eax, 0x10
jae 0x404091
mov edi, dword [ebp - 0xc30]
xor ecx, ecx
mov eax, dword [ebp - 0xc18]
sub edi, eax
nop
mov dl, byte [edi + eax]
test dl, dl
je 0x40406c
mov byte [eax], dl
inc ecx
inc eax
cmp ecx, 0x10
jne 0x404030
mov edx, dword [ebp - 0xc18]
jmp 0x404076
lea eax, [edi + 0x16]
push eax
push 0x431550
call fcn.0040cf70
add esp, 8
jmp 0x4040a2
push eax
lea eax, [edi + 0x16]
push eax
push 0x431584
call fcn.0040cf70
jmp 0x40409f
mov edx, dword [ebp - 0xc18]
mov byte [ecx + edx], 0x2f
inc ecx
cmp ecx, 0x10
je 0x4040a2
mov eax, 0x10
sub eax, ecx
push eax
lea eax, [ecx + edx]
push 0x20
push eax
call fcn.004105f0
jmp 0x40409f
inc eax
push eax
push dword [ebp - 0xc30]
push edi
call fcn.00410070
add esp, 0xc
or eax, 0xffffffff
mov byte [ebp - 4], 1
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4040be
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0xc14]
mov eax, dword [ebp - 0xc20]
inc eax
mov dword [ebp - 0xc20], eax
cmp eax, dword [ebp - 0xc24]
jne 0x403d92
mov eax, dword [ebp - 0xc2c]
push dword [eax + 4]
lea eax, [ebp - 0xc2c]
push eax
mov ecx, eax
call fcn.0040ba70
push 0x14
push dword [ebp - 0xc2c]
call fcn.0040e95e
mov eax, dword [esi - 0xc]
add esp, 8
mov edi, dword [ebp - 0xc50]
mov dword [ebp - 0xc24], eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0xc48], eax
cmp eax, 0xffffffff
je 0x404136
test al, 1
je 0x404136
mov ecx, eax
and ecx, 0xfffffffe
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push 0
push 0x2000080
push 2
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x404180
push 0
lea eax, [ebp - 0xc24]
push eax
push dword [ebp - 0xc24]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x404177
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x404186
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp - 0xc48]
cmp eax, 0xffffffff
je 0x40419e
push eax
push dword [ebp - 0xc50]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
xor edi, edi
jmp 0x4041a7
mov edi, 0xb
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4041c6
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040e950
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.0040d910
push 0x80070057
call fcn.0040d910
call fcn.0040d6a0
aas
inc eax
add byte [edi + edi + 0x40], cl
add byte [edi + edi + 0x40], cl
add byte [edi + edi + 0x40], cl
add byte [eax + 0x40], cl
inc eax
add byte [ebp - 0x75], dl
push ebp
mov ebp, esp