Function at 0x436040
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4340
call fcn.0046f060
mov eax, dword [0x4af6f0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 0x14]
push edi
mov edi, ecx
cmp esi, 3
je 0x4363b5
cmp esi, 2
je 0x43608d
cmp esi, 1
je 0x43608d
pop edi
pop esi
mov eax, 0x10000
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ebfa
mov esp, ebp
pop ebp
ret 0x10
cmp dword [edi + 4], 0xffffffff
je 0x43609d
push dword [edi]
call fcn.00438c30
add esp, 4
mov eax, dword [edi]
mov ecx, dword [ebp + 8]
mov dword [edi + 4], 0xffffffff
cmp ecx, dword [eax + 4]
jge 0x436075
cmp ecx, dword [eax + 0x10]
jge 0x4360bf
push eax
call fcn.00438cc0
mov ecx, dword [ebp + 8]
add esp, 4
mov eax, dword [edi]
cmp dword [eax + 0x10], ecx
jge 0x436121
mov esi, dword [edi]
test esi, esi
je 0x436117
cmp dword [esi + 0x18], 0
je 0x436117
mov edx, dword [esi + 0x10]
inc edx
cmp edx, dword [esi + 4]
je 0x436117
mov ecx, dword [esi + 0x50]
mov eax, dword [esi + 0x48]
add ecx, dword [esi + 0x4c]
add eax, 0x2e
push 0
push 0
push 0
push 0
add eax, ecx
mov dword [esi + 0x10], edx
add dword [esi + 0x14], eax
lea eax, [esi + 0x78]
push 0
push 0
push eax
lea eax, [esi + 0x28]
push eax
push esi
call fcn.004393e0
mov ecx, dword [ebp + 8]
add esp, 0x24
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov eax, dword [edi]
cmp dword [eax + 0x10], ecx
jl 0x4360c6
mov esi, dword [ebp + 0x14]
lea eax, [ebp - 0x4338]
push eax
push ecx
mov ecx, edi
call fcn.00435690
test byte [ebp - 0x4230], 0x10
je 0x436181
cmp esi, 1
je 0x43616c
push 0x103
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x4334]
push eax
call fcn.00435b80
lea eax, [ebp - 0x20c]
push eax
lea eax, [edi + 0x138]
push eax
call fcn.00435570
add esp, 0x14
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ebfa
mov esp, ebp
pop ebp
ret 0x10
cmp esi, 1
je 0x436299
movzx eax, word [ebx]
mov edx, ebx
mov ecx, ebx
test ax, ax
je 0x43627d
lea ebx, [ebx]
cmp ax, 0x2f
je 0x4361ac
cmp ax, 0x5c
jne 0x4361af
lea edx, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x4361a0
cmp edx, ebx
je 0x43627d
lea esi, [ebp - 0x20c]
mov ecx, ebx
sub esi, ebx
lea ecx, [ecx]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [esi + ecx - 2], ax
test ax, ax
jne 0x4361d0
sub edx, ebx
sar edx, 1
lea edx, [edx*2 - 2]
cmp edx, 0x208
jae 0x43646f
xor eax, eax
mov word [ebp + edx - 0x20c], ax
mov ax, word [ebp - 0x20c]
cmp ax, 0x2f
je 0x436225
cmp ax, 0x5c
je 0x436225
cmp word [ebp - 0x20a], 0x3a
mov byte [ebp - 0x4339], 0
jne 0x43622c
mov byte [ebp - 0x4339], 1
lea eax, [ebp - 0x20c]
push 0x491788
push eax
call fcn.0046e870
mov esi, eax
lea eax, [ebp - 0x20c]
push 0x491790
push eax
call fcn.0046e870
add esp, 0x10
test eax, eax
setne cl
test esi, esi
setne al
or cl, al
or cl, byte [ebp - 0x4339]
jne 0x43627d
lea eax, [ebp - 0x20c]
push eax
lea eax, [edi + 0x138]
push eax
call fcn.00435570
add esp, 8
push 0
push dword [ebp - 0x4230]
push 2
push 0
push 0
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4362b6
pop edi
pop esi
mov eax, 0x200
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ebfa
mov esp, ebp
pop ebp
ret 0x10
push dword [edi]
call fcn.00438d80
push 0x4000
lea eax, [ebp - 0x420c]
mov byte [ebp - 0x4339], 0
push eax
push dword [edi]
call fcn.00439070
add esp, 0x10
test eax, eax
js 0x436343
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x43634a
push 0
lea ecx, [ebp - 0x4340]
push ecx
push eax
lea eax, [ebp - 0x420c]
push eax
push ebx
call esi
test eax, eax
je 0x436343
mov ecx, dword [0x4af081]
add ecx, dword [ebp - 0x4340]
mov eax, dword [0x4af085]
adc eax, 0
mov dword [0x4af081], ecx
push eax
push ecx
mov ecx, 0x4af010
mov dword [0x4af085], eax
call fcn.004293d0
push 0x4000
lea eax, [ebp - 0x420c]
push eax
push dword [edi]
call fcn.00439070
add esp, 0xc
test eax, eax
jns 0x4362e4
mov byte [ebp - 0x4339], 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x43637b
cmp byte [ebp - 0x4339], 0
jne 0x43637b
lea eax, [ebp - 0x421c]
push eax
lea eax, [ebp - 0x422c]
push eax
lea eax, [ebp - 0x4224]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x436388
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [edi]
call fcn.00438c30
add esp, 4
xor eax, eax
cmp byte [ebp - 0x4339], al
mov ecx, 0x400
cmovne eax, ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ebfa
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [edi + 4]
mov esi, dword [ebp + 8]
cmp esi, eax
je 0x436413
cmp eax, 0xffffffff
je 0x4363ce
push dword [edi]
call fcn.00438c30
add esp, 4
mov eax, dword [edi]
mov dword [edi + 4], 0xffffffff
cmp esi, dword [eax + 4]
jge 0x436075
cmp esi, dword [eax + 0x10]
jge 0x4363ee
push eax
call fcn.00438cc0
add esp, 4
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jge 0x436406
push dword [edi]
call fcn.00438d10
mov eax, dword [edi]
add esp, 4
cmp dword [eax + 0x10], esi
jl 0x4363f5
push dword [edi]
call fcn.00438d80
add esp, 4
mov dword [edi + 4], esi
push dword [ebp + 0x10]
push ebx
push dword [edi]
call fcn.00439070
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x43643f
pop edi
pop esi
mov eax, 0x600
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ebfa
mov esp, ebp
pop ebp
ret 0x10
push dword [edi]
call fcn.00438c30
mov ecx, dword [ebp - 4]
add esp, 4
neg esi
mov dword [edi + 4], 0xffffffff
sbb esi, esi
xor ecx, ebp
and esi, 0x5000000
pop edi
mov eax, esi
pop esi
pop ebx
call fcn.0046ebfa
mov esp, ebp
pop ebp
ret 0x10
call fcn.0046fea6
int3