Function at 0x405260
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x423c
call fcn.0040a4e0
mov eax, dword [0x413030]
xor eax, dword [esp + 0x423c]
push ebp
mov ebp, dword [esp + 0x4250]
cmp ebp, 3
push esi
mov dword [esp + 0x4240], eax
push edi
mov esi, ecx
je 0x4052aa
cmp ebp, 2
je 0x40535f
cmp ebp, 1
je 0x40535f
mov eax, 0x10000
jmp 0x40559a
mov eax, dword [esi + 4]
mov edi, dword [esp + 0x424c]
cmp edi, eax
je 0x405312
cmp eax, 0xffffffff
je 0x4052c8
mov eax, dword [esi]
push eax
call fcn.00402f40
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x4052a0
cmp edi, dword [eax + 0x10]
jge 0x4052e4
push eax
call fcn.00402b90
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x405304
jmp 0x4052f0
mov edx, dword [esi]
push edx
call fcn.00402be0
mov eax, dword [esi]
mov ecx, dword [eax + 0x10]
add esp, 4
cmp ecx, edi
jl 0x4052f0
mov ecx, dword [esi]
push ecx
call fcn.00404eb0
add esp, 4
mov dword [esi + 4], edi
mov edx, dword [esp + 0x4254]
mov eax, dword [esp + 0x4250]
mov ecx, dword [esi]
push edx
push eax
push ecx
call fcn.00404fd0
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x40533d
mov eax, 0x600
jmp 0x40559a
mov edx, dword [esi]
push edx
call fcn.00402f40
add esp, 4
mov eax, edi
neg eax
sbb eax, eax
mov dword [esi + 4], 0xffffffff
and eax, 0x5000000
jmp 0x40559a
mov eax, dword [esi + 4]
or edi, 0xffffffff
cmp eax, edi
je 0x405374
mov eax, dword [esi]
push eax
call fcn.00402f40
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [esp + 0x424c]
cmp edi, dword [eax + 4]
jge 0x4052a0
cmp edi, dword [eax + 0x10]
jge 0x405397
push eax
call fcn.00402b90
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x4053b4
mov edi, edi
mov edx, dword [esi]
push edx
call fcn.00402be0
mov eax, dword [esi]
mov ecx, dword [eax + 0x10]
add esp, 4
cmp ecx, edi
jl 0x4053a0
lea ecx, [esp + 0x118]
push ecx
push edi
mov ecx, esi
call fcn.00403040
test byte [esp + 0x220], 0x10
je 0x4053f1
cmp ebp, 1
je 0x4053ea
lea edx, [esp + 0x11c]
push edx
add esi, 0x138
push esi
call fcn.004034c0
add esp, 8
xor eax, eax
jmp 0x40559a
cmp ebp, 1
mov edi, dword [esp + 0x4250]
push ebx
je 0x4054c3
mov al, byte [edi]
test al, al
mov ebx, edi
mov ecx, edi
je 0x4054a5
cmp al, 0x2f
je 0x405418
cmp al, 0x5c
jne 0x40541b
lea ebx, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x405410
cmp ebx, edi
je 0x4054a5
lea edx, [esp + 0x18]
mov eax, edi
sub edx, edi
nop
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x405430
sub ebx, edi
mov byte [esp + ebx + 0x17], cl
mov al, byte [esp + 0x18]
cmp al, 0x2f
je 0x405457
cmp al, 0x5c
je 0x405457
cmp byte [esp + 0x19], 0x3a
mov byte [esp + 0x13], cl
jne 0x40545c
mov byte [esp + 0x13], 1
lea eax, [esp + 0x18]
push 0x410be0
push eax
call fcn.0040a450
lea ecx, [esp + 0x20]
test eax, eax
push 0x410bdc
push ecx
setne bl
call fcn.0040a450
add esp, 0x10
test eax, eax
mov al, byte [esp + 0x13]
setne dl
or bl, dl
or bl, al
jne 0x4054a5
lea eax, [esp + 0x18]
push eax
lea ecx, [esi + 0x138]
push ecx
call fcn.004034c0
add esp, 8
mov edx, dword [esp + 0x224]
push 0
push edx
push 2
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4054d2
mov eax, 0x200
jmp 0x405599
mov eax, dword [esi]
push eax
call fcn.00404eb0
mov edx, dword [esi]
push 0x4000
lea ecx, [esp + 0x250]
push ecx
push edx
xor bl, bl
call fcn.00404fd0
add esp, 0x10
test eax, eax
jl 0x40553a
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x405540
push 0
lea ecx, [esp + 0x18]
push ecx
push eax
lea edx, [esp + 0x254]
push edx
push edi
call ebp
test eax, eax
je 0x40553e
mov ecx, dword [esi]
push 0x4000
lea eax, [esp + 0x24c]
push eax
push ecx
call fcn.00404fd0
add esp, 0xc
test eax, eax
jge 0x4054fe
mov ebp, dword [esp + 0x425c]
mov bl, 1
jmp 0x405547
mov bl, 1
mov ebp, dword [esp + 0x425c]
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x405576
test bl, bl
jne 0x405576
lea edx, [esp + 0x238]
push edx
lea eax, [esp + 0x22c]
push eax
lea ecx, [esp + 0x238]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp ebp, 1
je 0x405582
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esi]
push edx
call fcn.00402f40
add esp, 4
neg bl
sbb ebx, ebx
and ebx, 0x400
mov eax, ebx
pop ebx
mov ecx, dword [esp + 0x4244]
xor ecx, dword [esp + 0x4248]
pop edi
pop esi
pop ebp
call fcn.0040a21b
add esp, 0x423c
ret 0x10