Function at 0x421850
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4240
call fcn.00525f60
mov eax, dword [0x5a674c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x18]
push ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x4240], eax
mov eax, dword [ebp + 0x14]
push esi
push edi
mov esi, ecx
mov dword [ebp - 0x423c], ebx
cmp eax, 3
je 0x4218b0
cmp eax, 2
je 0x42196e
cmp eax, 1
je 0x42196e
pop edi
pop esi
mov eax, 0x10000
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00525092
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [esi + 4]
mov edi, dword [ebp + 8]
cmp edi, eax
je 0x421910
cmp eax, 0xffffffff
je 0x4218ca
mov ecx, dword [esi]
push ecx
call fcn.0041f8c0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x421898
cmp edi, dword [eax + 0x10]
jge 0x4218e6
push eax
call fcn.0041f630
add esp, 4
mov edx, dword [esi]
cmp dword [edx + 0x10], edi
jge 0x421902
lea ecx, [ecx]
mov eax, dword [esi]
push eax
call fcn.0041f680
mov ecx, dword [esi]
add esp, 4
cmp dword [ecx + 0x10], edi
jl 0x4218f0
mov edx, dword [esi]
push edx
call fcn.004214e0
add esp, 4
mov dword [esi + 4], edi
mov eax, dword [ebp + 0x10]
mov ecx, dword [esi]
push eax
push ebx
push ecx
call fcn.004215f0
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x42193e
pop edi
pop esi
mov eax, 0x600
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00525092
mov esp, ebp
pop ebp
ret 0x14
mov edx, dword [esi]
push edx
call fcn.0041f8c0
add esp, 4
mov eax, edi
neg eax
pop edi
mov dword [esi + 4], 0xffffffff
sbb eax, eax
pop esi
and eax, 0x5000000
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00525092
mov esp, ebp
pop ebp
ret 0x14
or edi, 0xffffffff
cmp dword [esi + 4], edi
je 0x421981
mov eax, dword [esi]
push eax
call fcn.0041f8c0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [ebp + 8]
cmp edi, dword [eax + 4]
jge 0x421898
cmp edi, dword [eax + 0x10]
jge 0x4219a0
push eax
call fcn.0041f630
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x4219b9
mov edx, dword [esi]
push edx
call fcn.0041f680
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x4219a7
lea ecx, [ebp - 0x4234]
push ecx
push edi
mov ecx, esi
call fcn.0041f980
test byte [ebp - 0x412c], 0x10
je 0x421a02
cmp dword [ebp + 0x14], 1
je 0x4219ed
lea edx, [ebp - 0x4230]
push edx
add esi, 0x138
push esi
call fcn.0041fe10
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00525092
mov esp, ebp
pop ebp
ret 0x14
cmp dword [ebp + 0x14], 1
mov edi, ebx
je 0x421ae5
mov al, byte [ebx]
mov ecx, ebx
test al, al
je 0x421ac8
lea ebx, [ebx]
cmp al, 0x2f
je 0x421a28
cmp al, 0x5c
jne 0x421a2b
lea edi, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x421a20
cmp edi, ebx
je 0x421ac8
lea edx, [ebp - 0x108]
mov eax, ebx
sub edx, ebx
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x421a45
sub edi, ebx
mov byte [ebp + edi - 0x109], cl
mov al, byte [ebp - 0x108]
cmp al, 0x2f
je 0x421a73
cmp al, 0x5c
je 0x421a73
cmp byte [ebp - 0x107], 0x3a
je 0x421a73
xor bl, bl
jmp 0x421a75
mov bl, 1
lea eax, [ebp - 0x108]
push 0x559ba8
push eax
call fcn.00525875
lea ecx, [ebp - 0x108]
push 0x559ba4
push ecx
mov edi, eax
call fcn.00525875
add esp, 0x10
test eax, eax
setne dl
test edi, edi
setne al
or dl, al
or dl, bl
jne 0x421ac2
lea ecx, [ebp - 0x108]
push ecx
lea edx, [esi + 0x138]
push edx
call fcn.0041fe10
add esp, 8
mov ebx, dword [ebp - 0x423c]
mov eax, dword [ebp - 0x412c]
push 0
push eax
push 2
push 0
push 0
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x421b02
pop edi
pop esi
mov eax, 0x200
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00525092
mov esp, ebp
pop ebp
ret 0x14
mov ecx, dword [esi]
push ecx
call fcn.004214e0
mov eax, dword [esi]
push 0x4000
lea edx, [ebp - 0x4108]
push edx
push eax
mov byte [ebp - 0x4235], 0
call fcn.004215f0
add esp, 0x10
test eax, eax
js 0x421b67
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x421b6e
push 0
lea ecx, [ebp - 0x423c]
push ecx
push eax
lea edx, [ebp - 0x4108]
push edx
push edi
call ebx
test eax, eax
je 0x421b67
mov ecx, dword [esi]
push 0x4000
lea eax, [ebp - 0x4108]
push eax
push ecx
call fcn.004215f0
add esp, 0xc
test eax, eax
jns 0x421b32
mov byte [ebp - 0x4235], 1
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x421bc5
cmp byte [ebp - 0x4235], 0
jne 0x421bc5
mov eax, dword [ebp - 0x4240]
test eax, eax
je 0x421b9e
mov edx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x4118], edx
mov dword [ebp - 0x4114], eax
lea ecx, [ebp - 0x4118]
push ecx
lea edx, [ebp - 0x4128]
push edx
lea eax, [ebp - 0x4120]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
test eax, eax
jne 0x421bc5
mov byte [ebp - 0x4235], 1
cmp dword [ebp + 0x14], 1
je 0x421bd2
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esi]
push ecx
call fcn.0041f8c0
movzx eax, byte [ebp - 0x4235]
mov ecx, dword [ebp - 4]
add esp, 4
neg eax
pop edi
sbb eax, eax
pop esi
xor ecx, ebp
and eax, 0x400
pop ebx
call fcn.00525092
mov esp, ebp
pop ebp
ret 0x14