Function at 0x40be40
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x491230
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x4a8040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [esi + 0x98]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test eax, eax
je 0x40beaa
cmp byte [esi + 1], 0
je 0x40beaa
mov byte [eax + 0x10], 0
mov ebx, dword [esi + 0x98]
test ebx, ebx
je 0x40beaa
mov ecx, ebx
call fcn.0042f170
mov eax, dword [0x591c58]
test eax, eax
je 0x40bea4
dec dword [eax + 0x374]
push ebx
call edi
add esp, 4
cmp byte [esi], 0
mov dword [esi + 0x98], 0
je 0x40c72d
cmp byte [esi + 0x2fe0], 0
je 0x40bf2b
mov ebx, dword [esi + 0x20]
test ebx, ebx
je 0x40bf2b
mov eax, dword [0x591c58]
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x14], eax
mov dword [0x591c58], esi
mov dword [esi + 0x2fe4], 0
mov dword [ebp - 0x10], 0
call fcn.00418b70
mov edx, 0x49ed0c
mov dword [ebp - 0x18], eax
mov ecx, ebx
call fcn.00406e20
mov ebx, eax
test ebx, ebx
je 0x40bf33
push ebx
push dword [ebp - 0x10]
mov dword [ebp - 0x1c], 0
push 1
push dword [ebp - 0x18]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0x14
jmp 0x40bf33
mov eax, dword [0x591c58]
mov dword [ebp - 0x14], eax
mov dword [0x591c58], esi
call fcn.0041ae20
mov eax, dword [ebp - 0x14]
xor edx, edx
mov dword [0x591c58], eax
mov dword [ebp - 0x14], edx
cmp dword [esi + 0x2fb8], edx
jle 0x40bfa2
xor ecx, ecx
mov dword [ebp - 0x10], ecx
nop dword [eax + eax]
mov eax, dword [esi + 0x2fc0]
mov ebx, dword [ecx + eax + 4]
test ebx, ebx
je 0x40bf90
mov ecx, ebx
call fcn.0041c130
mov eax, dword [0x591c58]
test eax, eax
je 0x40bf84
dec dword [eax + 0x374]
push ebx
call edi
mov ecx, dword [ebp - 0x10]
add esp, 4
mov edx, dword [ebp - 0x14]
inc edx
add ecx, 8
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], ecx
cmp edx, dword [esi + 0x2fb8]
jl 0x40bf60
xor ebx, ebx
cmp dword [esi + 0x3018], ebx
jle 0x40bfdb
xor ecx, ecx
mov dword [ebp - 0x14], ecx
mov edx, dword [esi + 0x3020]
add edx, ecx
cmp dword [edx + 4], 6
jne 0x40bfcc
mov eax, dword [edx + 0xc]
push edx
push esi
call eax
mov ecx, dword [ebp - 0x14]
add esp, 8
inc ebx
add ecx, 0x14
mov dword [ebp - 0x14], ecx
cmp ebx, dword [esi + 0x3018]
jl 0x40bfb1
xor edx, edx
mov dword [ebp - 0x14], edx
cmp dword [esi + 0x1c00], edx
jle 0x40c031
xor ecx, ecx
mov dword [ebp - 0x10], ecx
nop dword [eax]
mov eax, dword [esi + 0x1c08]
mov ebx, dword [ecx + eax]
test ebx, ebx
je 0x40c01f
mov ecx, ebx
call fcn.00409040
mov eax, dword [0x591c58]
test eax, eax
je 0x40c013
dec dword [eax + 0x374]
push ebx
call edi
mov ecx, dword [ebp - 0x10]
add esp, 4
mov edx, dword [ebp - 0x14]
inc edx
add ecx, 4
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], ecx
cmp edx, dword [esi + 0x1c00]
jl 0x40bff0
mov ecx, dword [esi + 0x1c08]
test ecx, ecx
je 0x40c06e
mov eax, dword [0x591c58]
mov dword [esi + 0x1c04], 0
mov dword [esi + 0x1c00], 0
test eax, eax
je 0x40c05e
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1c08], 0
mov ecx, dword [esi + 0x1c14]
test ecx, ecx
je 0x40c0ab
mov eax, dword [0x591c58]
mov dword [esi + 0x1c10], 0
mov dword [esi + 0x1c0c], 0
test eax, eax
je 0x40c09b
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1c14], 0
mov ecx, dword [esi + 0x1c20]
test ecx, ecx
je 0x40c0e8
mov eax, dword [0x591c58]
mov dword [esi + 0x1c1c], 0
mov dword [esi + 0x1c18], 0
test eax, eax
je 0x40c0d8
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1c20], 0
mov dword [esi + 0x1c48], 0
mov ecx, dword [esi + 0x1c2c]
test ecx, ecx
je 0x40c12f
mov eax, dword [0x591c58]
mov dword [esi + 0x1c28], 0
mov dword [esi + 0x1c24], 0
test eax, eax
je 0x40c11f
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1c2c], 0
mov ecx, dword [esi + 0x1c38]
test ecx, ecx
je 0x40c16c
mov eax, dword [0x591c58]
mov dword [esi + 0x1c34], 0
mov dword [esi + 0x1c30], 0
test eax, eax
je 0x40c15c
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1c38], 0
mov dword [esi + 0x1e18], 0
mov dword [esi + 0x1c50], 0
mov dword [esi + 0x1c4c], 0
mov dword [esi + 0x1cc4], 0
mov dword [esi + 0x1cb0], 0
mov dword [esi + 0x1c58], 0
mov ecx, dword [esi + 0x1d78]
test ecx, ecx
je 0x40c1e5
mov eax, dword [0x591c58]
mov dword [esi + 0x1d74], 0
mov dword [esi + 0x1d70], 0
test eax, eax
je 0x40c1d5
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1d78], 0
mov ecx, dword [esi + 0x1d84]
test ecx, ecx
je 0x40c222
mov eax, dword [0x591c58]
mov dword [esi + 0x1d80], 0
mov dword [esi + 0x1d7c], 0
test eax, eax
je 0x40c212
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1d84], 0
mov ecx, dword [esi + 0x1d90]
test ecx, ecx
je 0x40c25f
mov eax, dword [0x591c58]
mov dword [esi + 0x1d8c], 0
mov dword [esi + 0x1d88], 0
test eax, eax
je 0x40c24f
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1d90], 0
mov ecx, dword [esi + 0x1dc0]
test ecx, ecx
je 0x40c29c
mov eax, dword [0x591c58]
mov dword [esi + 0x1dbc], 0
mov dword [esi + 0x1db8], 0
test eax, eax
je 0x40c28c
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1dc0], 0
mov ecx, dword [esi + 0x1dcc]
test ecx, ecx
je 0x40c2d9
mov eax, dword [0x591c58]
mov dword [esi + 0x1dc8], 0
mov dword [esi + 0x1dc4], 0
test eax, eax
je 0x40c2c9
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1dcc], 0
xor edx, edx
mov dword [esi + 0x1de8], 0
mov dword [esi + 0x1de4], 0
mov dword [esi + 0x1de0], 0
mov dword [ebp - 0x14], edx
cmp dword [esi + 0x1dd0], edx
jle 0x40c3c9
xor ecx, ecx
mov dword [ebp - 0x10], ecx
nop dword [eax]
mov eax, dword [esi + 0x1dd8]
mov ebx, dword [ecx + eax]
test ebx, ebx
je 0x40c3b3
mov dword [ebp - 4], 0
mov eax, dword [ebx + 0x78]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40c350
mov ecx, eax
call fcn.00405170
mov eax, dword [0x591c58]
test eax, eax
je 0x40c348
dec dword [eax + 0x374]
push dword [ebp - 0x18]
call edi
add esp, 4
mov eax, dword [ebx + 0x7c]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40c378
mov ecx, eax
call fcn.00405170
mov eax, dword [0x591c58]
test eax, eax
je 0x40c370
dec dword [eax + 0x374]
push dword [ebp - 0x18]
call edi
add esp, 4
push 0x422f30
push 2
push 0xc
lea eax, [ebx + 0xb0]
mov byte [ebp - 4], 1
push eax
call fcn.0048f8bd
mov dword [ebp - 4], 0xffffffff
mov eax, dword [0x591c58]
test eax, eax
je 0x40c3a7
dec dword [eax + 0x374]
push ebx
call edi
mov ecx, dword [ebp - 0x10]
add esp, 4
mov edx, dword [ebp - 0x14]
inc edx
add ecx, 4
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], ecx
cmp edx, dword [esi + 0x1dd0]
jl 0x40c310
mov ecx, dword [esi + 0x1dd8]
test ecx, ecx
je 0x40c406
mov eax, dword [0x591c58]
mov dword [esi + 0x1dd4], 0
mov dword [esi + 0x1dd0], 0
test eax, eax
je 0x40c3f6
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x1dd8], 0
lea ecx, [esi + 0x2034]
call fcn.00423280
mov ecx, dword [esi + 0x2058]
test ecx, ecx
je 0x40c44e
mov eax, dword [0x591c58]
mov dword [esi + 0x2054], 0
mov dword [esi + 0x2050], 0
test eax, eax
je 0x40c43e
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x2058], 0
mov ecx, dword [esi + 0x2064]
test ecx, ecx
je 0x40c48b
mov eax, dword [0x591c58]
mov dword [esi + 0x2060], 0
mov dword [esi + 0x205c], 0
test eax, eax
je 0x40c47b
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x2064], 0
lea ecx, [esi + 0x1ff0]
call fcn.00423440
mov ecx, dword [esi + 0x2014]
test ecx, ecx
je 0x40c4d3
mov eax, dword [0x591c58]
mov dword [esi + 0x2010], 0
mov dword [esi + 0x200c], 0
test eax, eax
je 0x40c4c3
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x2014], 0
mov ecx, dword [esi + 0x202c]
test ecx, ecx
je 0x40c510
mov eax, dword [0x591c58]
mov dword [esi + 0x2028], 0
mov dword [esi + 0x2024], 0
test eax, eax
je 0x40c500
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x202c], 0
mov ecx, dword [esi + 0x2f90]
test ecx, ecx
je 0x40c54d
mov eax, dword [0x591c58]
mov dword [esi + 0x2f8c], 0
mov dword [esi + 0x2f88], 0
test eax, eax
je 0x40c53d
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x2f90], 0
mov ecx, dword [esi + 0x2f9c]
test ecx, ecx
je 0x40c58a
mov eax, dword [0x591c58]
mov dword [esi + 0x2f98], 0
mov dword [esi + 0x2f94], 0
test eax, eax
je 0x40c57a
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x2f9c], 0
mov ecx, dword [esi + 0x2084]
test ecx, ecx
je 0x40c5c7
mov eax, dword [0x591c58]
mov dword [esi + 0x2080], 0
mov dword [esi + 0x207c], 0
test eax, eax
je 0x40c5b7
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x2084], 0
mov ecx, dword [esi + 0x2090]
test ecx, ecx
je 0x40c604
mov eax, dword [0x591c58]
mov dword [esi + 0x208c], 0
mov dword [esi + 0x2088], 0
test eax, eax
je 0x40c5f4
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x2090], 0
mov ecx, dword [esi + 0x209c]
test ecx, ecx
je 0x40c641
mov eax, dword [0x591c58]
mov dword [esi + 0x2098], 0
mov dword [esi + 0x2094], 0
test eax, eax
je 0x40c631
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x209c], 0
mov ecx, dword [esi + 0x3008]
test ecx, ecx
je 0x40c67e
mov eax, dword [0x591c58]
mov dword [esi + 0x3004], 0
mov dword [esi + 0x3000], 0
test eax, eax
je 0x40c66e
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x3008], 0
mov ecx, dword [esi + 0x2ffc]
test ecx, ecx
je 0x40c6bb
mov eax, dword [0x591c58]
mov dword [esi + 0x2ff8], 0
mov dword [esi + 0x2ff4], 0
test eax, eax
je 0x40c6ab
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x2ffc], 0
cmp dword [esi + 0x3030], 0
je 0x40c6ed
mov ebx, dword [esi + 0x3030]
push 1
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
cmp ebx, eax
je 0x40c6e3
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov dword [esi + 0x3030], 0
mov ecx, dword [esi + 0x303c]
test ecx, ecx
je 0x40c72a
mov eax, dword [0x591c58]
mov dword [esi + 0x3038], 0
mov dword [esi + 0x3034], 0
test eax, eax
je 0x40c71a
dec dword [eax + 0x374]
push ecx
call edi
add esp, 4
mov dword [esi + 0x303c], 0
mov byte [esi], 0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret