Function at 0x4219e0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4240
call fcn.005260d0
mov eax, dword [0x5a574c]
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 0x421a40
cmp eax, 2
je 0x421afe
cmp eax, 1
je 0x421afe
pop edi
pop esi
mov eax, 0x10000
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00525222
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [esi + 4]
mov edi, dword [ebp + 8]
cmp edi, eax
je 0x421aa0
cmp eax, 0xffffffff
je 0x421a5a
mov ecx, dword [esi]
push ecx
call fcn.0041fa50
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x421a28
cmp edi, dword [eax + 0x10]
jge 0x421a76
push eax
call fcn.0041f7c0
add esp, 4
mov edx, dword [esi]
cmp dword [edx + 0x10], edi
jge 0x421a92
lea ecx, [ecx]
mov eax, dword [esi]
push eax
call fcn.0041f810
mov ecx, dword [esi]
add esp, 4
cmp dword [ecx + 0x10], edi
jl 0x421a80
mov edx, dword [esi]
push edx
call fcn.00421670
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.00421780
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x421ace
pop edi
pop esi
mov eax, 0x600
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00525222
mov esp, ebp
pop ebp
ret 0x14
mov edx, dword [esi]
push edx
call fcn.0041fa50
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.00525222
mov esp, ebp
pop ebp
ret 0x14
or edi, 0xffffffff
cmp dword [esi + 4], edi
je 0x421b11
mov eax, dword [esi]
push eax
call fcn.0041fa50
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [ebp + 8]
cmp edi, dword [eax + 4]
jge 0x421a28
cmp edi, dword [eax + 0x10]
jge 0x421b30
push eax
call fcn.0041f7c0
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x421b49
mov edx, dword [esi]
push edx
call fcn.0041f810
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x421b37
lea ecx, [ebp - 0x4234]
push ecx
push edi
mov ecx, esi
call fcn.0041fb10
test byte [ebp - 0x412c], 0x10
je 0x421b92
cmp dword [ebp + 0x14], 1
je 0x421b7d
lea edx, [ebp - 0x4230]
push edx
add esi, 0x138
push esi
call fcn.0041ffa0
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00525222
mov esp, ebp
pop ebp
ret 0x14
cmp dword [ebp + 0x14], 1
mov edi, ebx
je 0x421c75
mov al, byte [ebx]
mov ecx, ebx
test al, al
je 0x421c58
lea ebx, [ebx]
cmp al, 0x2f
je 0x421bb8
cmp al, 0x5c
jne 0x421bbb
lea edi, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x421bb0
cmp edi, ebx
je 0x421c58
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 0x421bd5
sub edi, ebx
mov byte [ebp + edi - 0x109], cl
mov al, byte [ebp - 0x108]
cmp al, 0x2f
je 0x421c03
cmp al, 0x5c
je 0x421c03
cmp byte [ebp - 0x107], 0x3a
je 0x421c03
xor bl, bl
jmp 0x421c05
mov bl, 1
lea eax, [ebp - 0x108]
push 0x558a48
push eax
call fcn.00525a05
lea ecx, [ebp - 0x108]
push 0x558a44
push ecx
mov edi, eax
call fcn.00525a05
add esp, 0x10
test eax, eax
setne dl
test edi, edi
setne al
or dl, al
or dl, bl
jne 0x421c52
lea ecx, [ebp - 0x108]
push ecx
lea edx, [esi + 0x138]
push edx
call fcn.0041ffa0
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 0x421c92
pop edi
pop esi
mov eax, 0x200
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00525222
mov esp, ebp
pop ebp
ret 0x14
mov ecx, dword [esi]
push ecx
call fcn.00421670
mov eax, dword [esi]
push 0x4000
lea edx, [ebp - 0x4108]
push edx
push eax
mov byte [ebp - 0x4235], 0
call fcn.00421780
add esp, 0x10
test eax, eax
js 0x421cf7
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x421cfe
push 0
lea ecx, [ebp - 0x423c]
push ecx
push eax
lea edx, [ebp - 0x4108]
push edx
push edi
call ebx
test eax, eax
je 0x421cf7
mov ecx, dword [esi]
push 0x4000
lea eax, [ebp - 0x4108]
push eax
push ecx
call fcn.00421780
add esp, 0xc
test eax, eax
jns 0x421cc2
mov byte [ebp - 0x4235], 1
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x421d55
cmp byte [ebp - 0x4235], 0
jne 0x421d55
mov eax, dword [ebp - 0x4240]
test eax, eax
je 0x421d2e
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 0x421d55
mov byte [ebp - 0x4235], 1
cmp dword [ebp + 0x14], 1
je 0x421d62
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esi]
push ecx
call fcn.0041fa50
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.00525222
mov esp, ebp
pop ebp
ret 0x14