Function at 0x4050c0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4305c0
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x43900c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [0x4393a8]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov dword [ebp - 0x10], 6
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x40525d
cmp byte [ebx + 1], 0
je 0x40525d
mov byte [eax + 0x10], 0
mov esi, dword [ebx + 0x2c]
mov dword [ebp - 0x1c], esi
test esi, esi
je 0x40525d
mov ecx, esi
mov dword [ebp - 4], 0
call fcn.00424170
mov ecx, esi
call fcn.00424380
lea ecx, [esi + 0x3c]
xor esi, esi
mov dword [ebp - 0x14], ecx
cmp dword [ecx], esi
jle 0x4051d2
mov eax, dword [ecx + 8]
mov edi, dword [eax + esi*4]
test edi, edi
je 0x4051c3
mov ecx, edi
call fcn.00426be0
mov ecx, dword [0x4393a8]
test ecx, ecx
je 0x4051b2
movsx eax, word [ecx + 0x5c24]
mov edx, dword [ecx + 0x3dd8]
add eax, 0xb85
mov dword [ebp - 0x18], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x4051a8
movsx eax, word [ecx + 0x5c24]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x18]
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push edi
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call edi
mov ecx, dword [ebp - 0x14]
add esp, 4
jmp 0x4051c9
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
inc esi
cmp esi, dword [ecx]
jl 0x405147
call fcn.00401010
mov esi, dword [ebp - 0x1c]
lea ecx, [esi + 0x54]
mov byte [esi + 0x18], 0
call fcn.00417c40
lea ecx, [esi + 0x48]
call fcn.00417c40
mov ecx, dword [ebp - 0x14]
call fcn.00417c40
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [0x4393a8]
test ecx, ecx
je 0x405257
movsx eax, word [ecx + 0x5c24]
mov edx, dword [ecx + 0x3dd8]
add eax, 0xb85
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40524d
movsx eax, word [ecx + 0x5c24]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push esi
call edi
add esp, 4
lea ecx, [ebx + 0x3bfc]
mov dword [ebx + 0x2c], 0
call fcn.00401010
cmp byte [ebx], 0
je 0x405aad
cmp byte [ebx + 0x5b24], 0
je 0x4052d8
mov esi, dword [ebx + 0x20]
test esi, esi
je 0x4052d8
mov eax, dword [0x4393a8]
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x14], 0
mov dword [eax + 0x5b28], 0
call fcn.00416c00
mov edx, 0x431ef0
mov ecx, esi
mov edi, eax
call fcn.00403aa0
mov esi, eax
test esi, esi
je 0x4052d8
push esi
push dword [ebp - 0x14]
mov dword [ebp - 0x1c], 0
push 1
push edi
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 [ebx + 0x5b5c]
mov esi, dword [ebx + 0x5b64]
lea eax, [eax + eax*4]
lea edi, [esi + eax*4]
cmp esi, edi
je 0x405307
nop
cmp dword [esi + 4], 6
jne 0x405300
mov eax, dword [esi + 0xc]
push esi
push ebx
call eax
add esp, 8
add esi, 0x14
cmp esi, edi
jne 0x4052f0
lea ecx, [ebx + 0x3e10]
xor esi, esi
cmp dword [ecx], esi
jle 0x405397
mov eax, dword [ecx + 8]
mov edi, dword [eax + esi*4]
test edi, edi
je 0x405392
mov ecx, edi
call fcn.004062d0
mov ecx, dword [0x4393a8]
test ecx, ecx
je 0x405382
movsx eax, word [ecx + 0x5c24]
mov edx, dword [ecx + 0x3dd8]
add eax, 0xb85
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405378
movsx eax, word [ecx + 0x5c24]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
lea ecx, [ebx + 0x3e10]
inc esi
cmp esi, dword [ecx]
jl 0x405317
call fcn.00401010
lea ecx, [ebx + 0x3e1c]
call fcn.00401010
lea ecx, [ebx + 0x3e28]
call fcn.00401010
mov dword [ebx + 0x3e58], 0
mov esi, dword [ebx + 0x3e3c]
test esi, esi
je 0x405445
mov ecx, dword [0x4393a8]
mov dword [ebx + 0x3e38], 0
mov dword [ebx + 0x3e34], 0
test ecx, ecx
je 0x40542d
movsx edx, word [ecx + 0x5c24]
lea eax, [ecx + 0x5c28]
mov edi, dword [ecx + 0x3dd8]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x405423
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push esi
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call esi
add esp, 4
mov dword [ebx + 0x3e3c], 0
jmp 0x40544b
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea ecx, [ebx + 0x3e40]
call fcn.00401010
or eax, 0xffffffff
mov dword [ebx + 0x47f4], 0
mov dword [ebx + 0x3e60], 0
lea edi, [ebx + 0x4570]
mov dword [ebx + 0x3e5c], 0
mov ecx, 0x46
mov dword [ebx + 0x3ed4], 0
mov dword [ebx + 0x3ec0], 0
mov dword [ebx + 0x3e64], 0
rep stosd dword es:[edi], eax
lea ecx, [ebx + 0x4688]
call fcn.00401010
lea ecx, [ebx + 0x4694]
call fcn.00401010
mov edi, dword [ebx + 0x4780]
test edi, edi
je 0x405544
mov ecx, dword [0x4393a8]
mov dword [ebx + 0x477c], 0
mov dword [ebx + 0x4778], 0
test ecx, ecx
je 0x405534
movsx eax, word [ecx + 0x5c24]
mov edx, dword [ecx + 0x3dd8]
add eax, 0xb85
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40552a
movsx eax, word [ecx + 0x5c24]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4780], 0
mov edi, dword [ebx + 0x478c]
test edi, edi
je 0x4055d0
mov ecx, dword [0x4393a8]
mov dword [ebx + 0x4788], 0
mov dword [ebx + 0x4784], 0
test ecx, ecx
je 0x4055c0
movsx eax, word [ecx + 0x5c24]
mov edx, dword [ecx + 0x3dd8]
add eax, 0xb85
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x4055b6
movsx eax, word [ecx + 0x5c24]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push edi
call esi
add esp, 4
mov dword [ebx + 0x478c], 0
lea ecx, [ebx + 0x4790]
call fcn.00401010
lea ecx, [ebx + 0x47c0]
call fcn.00401010
lea ecx, [ebx + 0x47cc]
call fcn.00401010
mov edi, dword [ebx + 0x47e0]
test edi, edi
je 0x40567d
mov ecx, dword [0x4393a8]
mov dword [ebx + 0x47dc], 0
mov dword [ebx + 0x47d8], 0
test ecx, ecx
je 0x40566d
movsx eax, word [ecx + 0x5c24]
mov edx, dword [ecx + 0x3dd8]
add eax, 0xb85
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405663
movsx eax, word [ecx + 0x5c24]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push edi
call esi
add esp, 4
mov dword [ebx + 0x47e0], 0
lea ecx, [ebx + 0x47e8]
call fcn.00417f30
lea ecx, [ebx + 0x4ac4]
call fcn.00417ce0
mov edi, dword [ebx + 0x4aec]
test edi, edi
je 0x40571f
mov ecx, dword [0x4393a8]
mov dword [ebx + 0x4ae8], 0
mov dword [ebx + 0x4ae4], 0
test ecx, ecx
je 0x40570f
movsx eax, word [ecx + 0x5c24]
mov edx, dword [ecx + 0x3dd8]
add eax, 0xb85
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405705
movsx eax, word [ecx + 0x5c24]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4aec], 0
mov edi, dword [ebx + 0x4af8]
test edi, edi
je 0x4057ab
mov ecx, dword [0x4393a8]
mov dword [ebx + 0x4af4], 0
mov dword [ebx + 0x4af0], 0
test ecx, ecx
je 0x40579b
movsx eax, word [ecx + 0x5c24]
mov edx, dword [ecx + 0x3dd8]
add eax, 0xb85
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405791
movsx eax, word [ecx + 0x5c24]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4af8], 0
xor edi, edi
lea eax, [ebx + 0x4a70]
mov dword [ebp - 0x14], eax
cmp dword [ebx + 0x4a68], edi
jle 0x4057e3
xor esi, esi
mov ecx, dword [eax]
add ecx, esi
call fcn.004014d0
inc edi
lea eax, [ebx + 0x4a70]
add esi, 0x1c
cmp edi, dword [ebx + 0x4a68]
jl 0x4057c0
lea eax, [ebx + 0x4a70]
jmp 0x4057e6
mov dword [ebp - 0x14], eax
mov esi, dword [eax]
test esi, esi
je 0x405866
mov ecx, dword [0x4393a8]
mov dword [ebx + 0x4a6c], 0
mov dword [ebx + 0x4a68], 0
test ecx, ecx
je 0x40584f
movsx edx, word [ecx + 0x5c24]
lea eax, [ecx + 0x5c28]
mov edi, dword [ecx + 0x3dd8]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x405845
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push esi
call edi
mov eax, dword [ebp - 0x14]
add esp, 4
mov dword [eax], 0
jmp 0x40586c
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea ecx, [ebx + 0x4a88]
call fcn.00417e10
cmp dword [ebx + 0x4a7c], 0
lea esi, [ebx + 0x4a84]
mov dword [ebp - 0x14], 0
jle 0x4058d8
xor ecx, ecx
mov dword [ebp - 0x18], ecx
mov esi, dword [esi]
add esi, ecx
lea ecx, [esi + 0x10]
mov dword [ebp - 4], 1
call fcn.00423b70
lea ecx, [esi + 0x18]
call fcn.00417c40
mov ecx, dword [ebp - 0x18]
lea esi, [ebx + 0x4a84]
mov dword [ebp - 4], 0xffffffff
add ecx, 0x68
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], eax
cmp eax, dword [ebx + 0x4a7c]
jl 0x405892
lea esi, [ebx + 0x4a84]
mov edx, dword [esi]
mov dword [ebp - 0x14], edx
test edx, edx
je 0x405968
mov ecx, dword [0x4393a8]
mov dword [ebx + 0x4a80], 0
mov dword [ebx + 0x4a7c], 0
test ecx, ecx
je 0x40595c
mov eax, dword [ecx + 0x3dd8]
mov dword [ebp - 0x18], eax
movsx eax, word [ecx + 0x5c24]
mov edx, dword [ebp - 0x18]
add eax, 0xb85
cmp dword [ecx + eax*8], edx
mov edx, dword [ebp - 0x14]
lea eax, [ecx + eax*8]
je 0x405952
movsx eax, word [ecx + 0x5c24]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x18]
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
mov edx, dword [ebp - 0x14]
inc word [eax + 6]
inc dword [ecx + 0x5c20]
push edx
call edi
add esp, 4
mov dword [esi], 0
lea ecx, [ebx + 0x4ab4]
call fcn.00401010
lea ecx, [ebx + 0x5a8c]
call fcn.00401010
lea ecx, [ebx + 0x5a98]
call fcn.00401010
lea ecx, [ebx + 0x4b34]
call fcn.00401010
lea ecx, [ebx + 0x4b40]
call fcn.00401010
lea ecx, [ebx + 0x4b4c]
call fcn.00401010
lea ecx, [ebx + 0x59a0]
mov dword [ebx + 0x599c], 0
call fcn.00401010
lea ecx, [ebx + 0x5b44]
call fcn.00401010
mov eax, dword [ebx + 0x5b40]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x405a4d
mov ecx, dword [0x4393a8]
mov dword [ebx + 0x5b3c], 0
mov dword [ebx + 0x5b38], 0
test ecx, ecx
je 0x405a3d
movsx edx, word [ecx + 0x5c24]
lea eax, [ecx + 0x5c28]
mov esi, dword [ecx + 0x3dd8]
lea eax, [eax + edx*8]
cmp dword [eax], esi
je 0x405a30
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5c24], ax
cwde
add eax, 0xb85
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], esi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5c20]
mov eax, dword [ebp - 0x1c]
push eax
call edi
add esp, 4
mov dword [ebx + 0x5b40], 0
cmp dword [ebx + 0x5b94], 0
je 0x405a7f
mov esi, dword [ebx + 0x5b94]
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 0x405a75
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov dword [ebx + 0x5b94], 0
lea ecx, [ebx + 0x5b98]
call fcn.00401010
lea ecx, [ebx + 0x5bc4]
call fcn.00401010
lea ecx, [ebx + 0x5bd0]
call fcn.00401010
mov dword [ebx + 0x5bdc], 0
mov byte [ebx], 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