Function at 0x40f530
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4884b0
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x4bf380]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [edi + 0x40]
mov ebx, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test eax, eax
je 0x40f594
cmp byte [edi + 1], 0
je 0x40f594
mov byte [eax + 0x10], 0
mov esi, dword [edi + 0x40]
test esi, esi
je 0x40f594
mov ecx, esi
call fcn.0042aad0
mov eax, dword [0x56e3a0]
test eax, eax
je 0x40f58e
dec dword [eax + 0xa8]
push esi
call ebx
add esp, 4
cmp byte [edi], 0
mov dword [edi + 0x40], 0
je 0x40fe69
cmp byte [edi + 0x5175], 0
je 0x40f618
mov esi, dword [edi + 0x20]
test esi, esi
je 0x40f618
mov eax, dword [0x56e3a0]
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x18], eax
mov dword [0x56e3a0], edi
mov dword [edi + 0x5178], 0
mov dword [ebp - 0x10], 0
call fcn.0041d8b0
mov edx, 0x490684
mov dword [ebp - 0x14], eax
mov ecx, esi
call fcn.0040ae00
mov esi, eax
test esi, esi
je 0x40f610
push esi
push dword [ebp - 0x10]
mov dword [ebp - 0x1c], 0
push 1
push dword [ebp - 0x14]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0x14
mov eax, dword [ebp - 0x18]
mov dword [0x56e3a0], eax
xor esi, esi
cmp dword [edi + 0x51ac], esi
jle 0x40f65a
xor ecx, ecx
mov dword [ebp - 0x10], ecx
nop word [eax + eax]
mov edx, dword [edi + 0x51b4]
add edx, ecx
cmp dword [edx + 4], 6
jne 0x40f64b
mov eax, dword [edx + 0xc]
push edx
push edi
call eax
mov ecx, dword [ebp - 0x10]
add esp, 8
inc esi
add ecx, 0x14
mov dword [ebp - 0x10], ecx
cmp esi, dword [edi + 0x51ac]
jl 0x40f630
xor esi, esi
lea ecx, [edi + 0x3d68]
mov dword [ebp - 0x10], ecx
cmp dword [edi + 0x3d60], esi
jle 0x40f6ab
nop dword [eax]
mov eax, dword [ecx]
mov eax, dword [eax + esi*4]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40f6a0
mov ecx, eax
call fcn.0040c7e0
mov eax, dword [0x56e3a0]
test eax, eax
je 0x40f692
dec dword [eax + 0xa8]
push dword [ebp - 0x18]
call ebx
add esp, 4
lea ecx, [edi + 0x3d68]
inc esi
cmp esi, dword [edi + 0x3d60]
jl 0x40f670
jmp 0x40f6ae
mov dword [ebp - 0x10], ecx
mov ecx, dword [ecx]
test ecx, ecx
je 0x40f6e6
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3d64], 0
mov dword [edi + 0x3d60], 0
test eax, eax
je 0x40f6d7
dec dword [eax + 0xa8]
push ecx
call ebx
mov eax, dword [ebp - 0x10]
add esp, 4
mov dword [eax], 0
mov ecx, dword [edi + 0x3d74]
test ecx, ecx
je 0x40f723
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3d70], 0
mov dword [edi + 0x3d6c], 0
test eax, eax
je 0x40f713
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3d74], 0
mov ecx, dword [edi + 0x3d80]
test ecx, ecx
je 0x40f760
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3d7c], 0
mov dword [edi + 0x3d78], 0
test eax, eax
je 0x40f750
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3d80], 0
mov dword [edi + 0x3da8], 0
mov ecx, dword [edi + 0x3d8c]
test ecx, ecx
je 0x40f7a7
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3d88], 0
mov dword [edi + 0x3d84], 0
test eax, eax
je 0x40f797
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3d8c], 0
mov ecx, dword [edi + 0x3d98]
test ecx, ecx
je 0x40f7e4
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3d94], 0
mov dword [edi + 0x3d90], 0
test eax, eax
je 0x40f7d4
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3d98], 0
mov dword [edi + 0x3f5c], 0
mov dword [edi + 0x3db0], 0
mov dword [edi + 0x3dac], 0
mov dword [edi + 0x3e2c], 0
mov dword [edi + 0x3e18], 0
mov dword [edi + 0x3db4], 0
mov ecx, dword [edi + 0x3ef4]
test ecx, ecx
je 0x40f85d
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3ef0], 0
mov dword [edi + 0x3eec], 0
test eax, eax
je 0x40f84d
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3ef4], 0
mov ecx, dword [edi + 0x3f00]
test ecx, ecx
je 0x40f89a
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3efc], 0
mov dword [edi + 0x3ef8], 0
test eax, eax
je 0x40f88a
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3f00], 0
mov ecx, dword [edi + 0x3f0c]
test ecx, ecx
je 0x40f8d7
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3f08], 0
mov dword [edi + 0x3f04], 0
test eax, eax
je 0x40f8c7
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3f0c], 0
mov ecx, dword [edi + 0x3f3c]
test ecx, ecx
je 0x40f914
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3f38], 0
mov dword [edi + 0x3f34], 0
test eax, eax
je 0x40f904
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3f3c], 0
mov ecx, dword [edi + 0x3f48]
test ecx, ecx
je 0x40f951
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3f44], 0
mov dword [edi + 0x3f40], 0
test eax, eax
je 0x40f941
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3f48], 0
xor ecx, ecx
mov dword [ebp - 0x10], ecx
cmp dword [edi + 0x3f50], ecx
jle 0x40fa0f
mov eax, dword [edi + 0x3f58]
mov esi, dword [eax + ecx*4]
test esi, esi
je 0x40f9ff
mov dword [ebp - 4], 0
mov eax, dword [esi + 0x30]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40f9a2
mov ecx, eax
call fcn.00408ea0
mov eax, dword [0x56e3a0]
test eax, eax
je 0x40f99a
dec dword [eax + 0xa8]
push dword [ebp - 0x18]
call ebx
add esp, 4
mov eax, dword [esi + 0x34]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40f9ca
mov ecx, eax
call fcn.00408ea0
mov eax, dword [0x56e3a0]
test eax, eax
je 0x40f9c2
dec dword [eax + 0xa8]
push dword [ebp - 0x18]
call ebx
add esp, 4
push 0x41e2d0
push 2
push 0xc
lea eax, [esi + 0x64]
mov byte [ebp - 4], 1
push eax
call fcn.00485f37
mov dword [ebp - 4], 0xffffffff
mov eax, dword [0x56e3a0]
test eax, eax
je 0x40f9f6
dec dword [eax + 0xa8]
push esi
call ebx
mov ecx, dword [ebp - 0x10]
add esp, 4
inc ecx
mov dword [ebp - 0x10], ecx
cmp ecx, dword [edi + 0x3f50]
jl 0x40f962
mov ecx, dword [edi + 0x3f58]
test ecx, ecx
je 0x40fa4c
mov eax, dword [0x56e3a0]
mov dword [edi + 0x3f54], 0
mov dword [edi + 0x3f50], 0
test eax, eax
je 0x40fa3c
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x3f58], 0
lea ecx, [edi + 0x41bc]
call fcn.0041e3f0
mov ecx, dword [edi + 0x41e4]
test ecx, ecx
je 0x40fa94
mov eax, dword [0x56e3a0]
mov dword [edi + 0x41e0], 0
mov dword [edi + 0x41dc], 0
test eax, eax
je 0x40fa84
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x41e4], 0
mov ecx, dword [edi + 0x41f0]
test ecx, ecx
je 0x40fad1
mov eax, dword [0x56e3a0]
mov dword [edi + 0x41ec], 0
mov dword [edi + 0x41e8], 0
test eax, eax
je 0x40fac1
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x41f0], 0
xor esi, esi
cmp dword [edi + 0x4160], esi
jle 0x40fb1c
xor ecx, ecx
mov dword [ebp - 0x10], ecx
mov eax, dword [edi + 0x4168]
mov edx, dword [eax + ecx + 0x18]
test edx, edx
je 0x40fb06
mov eax, dword [0x56e3a0]
test eax, eax
je 0x40fafd
dec dword [eax + 0xa8]
push edx
call ebx
mov ecx, dword [ebp - 0x10]
add esp, 4
mov dword [ebp - 4], 0xffffffff
inc esi
add ecx, 0x1c
mov dword [ebp - 0x10], ecx
cmp esi, dword [edi + 0x4160]
jl 0x40fae0
mov ecx, dword [edi + 0x4168]
test ecx, ecx
je 0x40fb59
mov eax, dword [0x56e3a0]
mov dword [edi + 0x4164], 0
mov dword [edi + 0x4160], 0
test eax, eax
je 0x40fb49
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x4168], 0
lea ecx, [edi + 0x4180]
call fcn.0041e5a0
cmp dword [edi + 0x4174], 0
mov dword [ebp - 0x10], 0
jle 0x40fbd2
xor ecx, ecx
mov dword [ebp - 0x14], ecx
nop dword [eax]
mov esi, dword [edi + 0x417c]
add esi, ecx
lea ecx, [esi + 0x10]
mov dword [ebp - 4], 3
call fcn.0042a160
mov ecx, dword [esi + 0x20]
test ecx, ecx
je 0x40fbb3
mov eax, dword [0x56e3a0]
test eax, eax
je 0x40fbad
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], 0xffffffff
add ecx, 0x68
mov eax, dword [ebp - 0x10]
inc eax
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], eax
cmp eax, dword [edi + 0x4174]
jl 0x40fb80
mov ecx, dword [edi + 0x417c]
test ecx, ecx
je 0x40fc0f
mov eax, dword [0x56e3a0]
mov dword [edi + 0x4178], 0
mov dword [edi + 0x4174], 0
test eax, eax
je 0x40fbff
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x417c], 0
mov ecx, dword [edi + 0x41b4]
test ecx, ecx
je 0x40fc4c
mov eax, dword [0x56e3a0]
mov dword [edi + 0x41b0], 0
mov dword [edi + 0x41ac], 0
test eax, eax
je 0x40fc3c
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x41b4], 0
mov ecx, dword [edi + 0x5144]
test ecx, ecx
je 0x40fc89
mov eax, dword [0x56e3a0]
mov dword [edi + 0x5140], 0
mov dword [edi + 0x513c], 0
test eax, eax
je 0x40fc79
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x5144], 0
mov ecx, dword [edi + 0x5150]
test ecx, ecx
je 0x40fcc6
mov eax, dword [0x56e3a0]
mov dword [edi + 0x514c], 0
mov dword [edi + 0x5148], 0
test eax, eax
je 0x40fcb6
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x5150], 0
mov ecx, dword [edi + 0x4210]
test ecx, ecx
je 0x40fd03
mov eax, dword [0x56e3a0]
mov dword [edi + 0x420c], 0
mov dword [edi + 0x4208], 0
test eax, eax
je 0x40fcf3
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x4210], 0
mov ecx, dword [edi + 0x421c]
test ecx, ecx
je 0x40fd40
mov eax, dword [0x56e3a0]
mov dword [edi + 0x4218], 0
mov dword [edi + 0x4214], 0
test eax, eax
je 0x40fd30
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x421c], 0
mov ecx, dword [edi + 0x4228]
test ecx, ecx
je 0x40fd7d
mov eax, dword [0x56e3a0]
mov dword [edi + 0x4224], 0
mov dword [edi + 0x4220], 0
test eax, eax
je 0x40fd6d
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x4228], 0
mov ecx, dword [edi + 0x519c]
test ecx, ecx
je 0x40fdba
mov eax, dword [0x56e3a0]
mov dword [edi + 0x5198], 0
mov dword [edi + 0x5194], 0
test eax, eax
je 0x40fdaa
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x519c], 0
mov ecx, dword [edi + 0x5190]
test ecx, ecx
je 0x40fdf7
mov eax, dword [0x56e3a0]
mov dword [edi + 0x518c], 0
mov dword [edi + 0x5188], 0
test eax, eax
je 0x40fde7
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x5190], 0
cmp dword [edi + 0x51c4], 0
je 0x40fe29
mov esi, dword [edi + 0x51c4]
push 1
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
cmp esi, eax
je 0x40fe1f
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov dword [edi + 0x51c4], 0
mov ecx, dword [edi + 0x51d0]
test ecx, ecx
je 0x40fe66
mov eax, dword [0x56e3a0]
mov dword [edi + 0x51cc], 0
mov dword [edi + 0x51c8], 0
test eax, eax
je 0x40fe56
dec dword [eax + 0xa8]
push ecx
call ebx
add esp, 4
mov dword [edi + 0x51d0], 0
mov byte [edi], 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