Function at 0x40cd80
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x453a50
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push esi
push edi
mov eax, dword [0x45e040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [0x45e6e8]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x10], 6
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x40cf29
cmp byte [ebx + 1], 0
je 0x40cf29
mov byte [eax + 0x10], 0
mov esi, dword [ebx + 0x2c]
mov dword [ebp - 0x14], esi
test esi, esi
je 0x40cf29
mov ecx, esi
mov dword [ebp - 4], 0
call fcn.0042e900
mov ecx, esi
call fcn.0042eb00
add esi, 0x3c
xor edx, edx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x18], edx
cmp dword [esi], edx
jle 0x40cea3
xor ecx, ecx
mov ebx, esi
mov dword [ebp - 0x1c], ecx
mov eax, dword [ebx + 8]
mov esi, dword [ecx + eax]
test esi, esi
je 0x40ce8b
mov ecx, esi
call fcn.004311a0
mov ecx, dword [0x45e6e8]
test ecx, ecx
je 0x40ce7f
movsx eax, word [ecx + 0x5ea4]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbd5
mov dword [ebp - 0x24], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40ce75
movsx eax, word [ecx + 0x5ea4]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x24]
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
push esi
call edi
mov ecx, dword [ebp - 0x1c]
add esp, 4
mov edx, dword [ebp - 0x18]
inc edx
add ecx, 4
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x1c], ecx
cmp edx, dword [ebx]
jl 0x40ce14
mov ebx, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x20]
mov ecx, esi
call fcn.00407b90
mov eax, dword [ebp - 0x14]
lea ecx, [eax + 0x54]
mov byte [eax + 0x18], 0
call fcn.00421cf0
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx + 0x48]
call fcn.00421cf0
mov ecx, esi
call fcn.00421cf0
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [0x45e6e8]
test ecx, ecx
je 0x40cf21
movsx edx, word [ecx + 0x5ea4]
lea eax, [ecx + 0x5ea8]
mov esi, dword [ecx + 0x3f10]
lea eax, [eax + edx*8]
cmp dword [eax], esi
je 0x40cf17
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], esi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
push dword [ebp - 0x14]
call edi
add esp, 4
lea ecx, [ebx + 0x3d30]
mov dword [ebx + 0x2c], 0
call fcn.00407b90
cmp byte [ebx], 0
je 0x40d76d
cmp byte [ebx + 0x5d84], 0
je 0x40cfa7
mov esi, dword [ebx + 0x20]
test esi, esi
je 0x40cfa7
mov eax, dword [0x45e6e8]
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x20], 0
mov dword [eax + 0x5d88], 0
call fcn.00420c30
mov edx, 0x45535c
mov dword [ebp - 0x2c], eax
mov ecx, esi
call fcn.0040aba0
mov esi, eax
test esi, esi
je 0x40cfa7
push esi
push dword [ebp - 0x20]
mov dword [ebp - 0x24], 0
push 1
push dword [ebp - 0x2c]
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 + 0x5dbc]
mov esi, dword [ebx + 0x5dc4]
lea eax, [eax + eax*4]
lea eax, [esi + eax*4]
mov dword [ebp - 0x2c], eax
cmp esi, eax
je 0x40cfda
cmp dword [esi + 4], 6
jne 0x40cfd3
mov eax, dword [esi + 0xc]
push esi
push ebx
call eax
mov eax, dword [ebp - 0x2c]
add esp, 8
add esi, 0x14
cmp esi, eax
jne 0x40cfc0
xor ecx, ecx
lea edx, [ebx + 0x3f48]
mov dword [ebp - 0x20], ecx
cmp dword [edx], ecx
jle 0x40d083
xor edi, edi
nop
mov eax, dword [edx + 8]
mov esi, dword [edi + eax]
test esi, esi
je 0x40d06e
mov ecx, esi
call fcn.0040df90
mov ecx, dword [0x45e6e8]
test ecx, ecx
je 0x40d05b
movsx eax, word [ecx + 0x5ea4]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbd5
mov dword [ebp - 0x2c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40d051
movsx eax, word [ecx + 0x5ea4]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x2c]
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, dword [ebp - 0x20]
lea edx, [ebx + 0x3f48]
add esp, 4
inc ecx
add edi, 4
mov dword [ebp - 0x20], ecx
cmp ecx, dword [edx]
jl 0x40cff0
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, edx
call fcn.00407b90
lea ecx, [ebx + 0x3f54]
call fcn.00407b90
lea ecx, [ebx + 0x3f60]
call fcn.00407b90
mov dword [ebx + 0x3f94], 0
mov esi, dword [ebx + 0x3f74]
test esi, esi
je 0x40d132
mov ecx, dword [0x45e6e8]
mov dword [ebx + 0x3f70], 0
mov dword [ebx + 0x3f6c], 0
test ecx, ecx
je 0x40d122
movsx eax, word [ecx + 0x5ea4]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbd5
mov dword [ebp - 0x2c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40d118
movsx eax, word [ecx + 0x5ea4]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x2c]
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
push esi
call edi
add esp, 4
mov dword [ebx + 0x3f74], 0
lea ecx, [ebx + 0x3f78]
call fcn.00407b90
or eax, 0xffffffff
mov dword [ebx + 0x4a2c], 0
mov dword [ebx + 0x3f9c], 0
lea edi, [ebx + 0x4770]
mov dword [ebx + 0x3f98], 0
mov ecx, 0x4d
mov dword [ebx + 0x4014], 0
mov dword [ebx + 0x4000], 0
mov dword [ebx + 0x3fa0], 0
rep stosd dword es:[edi], eax
lea ecx, [ebx + 0x48a4]
call fcn.00407b90
lea ecx, [ebx + 0x48b0]
call fcn.00407b90
mov esi, dword [ebx + 0x49b8]
test esi, esi
je 0x40d224
mov ecx, dword [0x45e6e8]
mov dword [ebx + 0x49b4], 0
mov dword [ebx + 0x49b0], 0
test ecx, ecx
je 0x40d20c
movsx edx, word [ecx + 0x5ea4]
lea eax, [ecx + 0x5ea8]
mov edi, dword [ecx + 0x3f10]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x40d202
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
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 + 0x49b8], 0
jmp 0x40d22a
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edi, dword [ebx + 0x49c4]
test edi, edi
je 0x40d2b2
mov ecx, dword [0x45e6e8]
mov dword [ebx + 0x49c0], 0
mov dword [ebx + 0x49bc], 0
test ecx, ecx
je 0x40d2a2
movsx eax, word [ecx + 0x5ea4]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbd5
mov dword [ebp - 0x2c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40d298
movsx eax, word [ecx + 0x5ea4]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x2c]
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
push edi
call esi
add esp, 4
mov dword [ebx + 0x49c4], 0
lea ecx, [ebx + 0x49c8]
call fcn.00407b90
lea ecx, [ebx + 0x49f8]
call fcn.00407b90
lea ecx, [ebx + 0x4a04]
call fcn.00407b90
mov edi, dword [ebx + 0x4a18]
test edi, edi
je 0x40d35b
mov ecx, dword [0x45e6e8]
mov dword [ebx + 0x4a14], 0
mov dword [ebx + 0x4a10], 0
test ecx, ecx
je 0x40d34b
movsx eax, word [ecx + 0x5ea4]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbd5
mov dword [ebp - 0x2c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40d341
movsx eax, word [ecx + 0x5ea4]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x2c]
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4a18], 0
lea ecx, [ebx + 0x4a20]
call fcn.004220f0
lea ecx, [ebx + 0x4d10]
call fcn.00421d90
mov edi, dword [ebx + 0x4d38]
test edi, edi
je 0x40d3f9
mov ecx, dword [0x45e6e8]
mov dword [ebx + 0x4d34], 0
mov dword [ebx + 0x4d30], 0
test ecx, ecx
je 0x40d3e9
movsx eax, word [ecx + 0x5ea4]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbd5
mov dword [ebp - 0x2c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40d3df
movsx eax, word [ecx + 0x5ea4]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x2c]
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4d38], 0
mov edi, dword [ebx + 0x4d44]
test edi, edi
je 0x40d481
mov ecx, dword [0x45e6e8]
mov dword [ebx + 0x4d40], 0
mov dword [ebx + 0x4d3c], 0
test ecx, ecx
je 0x40d471
movsx eax, word [ecx + 0x5ea4]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbd5
mov dword [ebp - 0x2c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40d467
movsx eax, word [ecx + 0x5ea4]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x2c]
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4d44], 0
xor edi, edi
lea eax, [ebx + 0x4cb8]
mov dword [ebp - 0x20], eax
cmp dword [ebx + 0x4cb0], edi
jle 0x40d4b9
xor esi, esi
mov ecx, dword [eax]
add ecx, esi
call fcn.004080b0
inc edi
lea eax, [ebx + 0x4cb8]
add esi, 0x1c
cmp edi, dword [ebx + 0x4cb0]
jl 0x40d496
lea eax, [ebx + 0x4cb8]
jmp 0x40d4bc
mov dword [ebp - 0x20], eax
mov esi, dword [eax]
test esi, esi
je 0x40d53c
mov ecx, dword [0x45e6e8]
mov dword [ebx + 0x4cb4], 0
mov dword [ebx + 0x4cb0], 0
test ecx, ecx
je 0x40d525
movsx edx, word [ecx + 0x5ea4]
lea eax, [ecx + 0x5ea8]
mov edi, dword [ecx + 0x3f10]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x40d51b
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push esi
call edi
mov eax, dword [ebp - 0x20]
add esp, 4
mov dword [eax], 0
jmp 0x40d542
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea ecx, [ebx + 0x4cd4]
call fcn.00421ed0
cmp dword [ebx + 0x4cc8], 0
mov dword [ebp - 0x20], 0
jle 0x40d5a0
xor ecx, ecx
mov dword [ebp - 0x1c], ecx
mov esi, dword [ebx + 0x4cd0]
add esi, ecx
lea ecx, [esi + 0x14]
mov dword [ebp - 4], 1
call fcn.0042e2e0
lea ecx, [esi + 0x1c]
call fcn.00421cf0
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 4], 0xffffffff
add ecx, 0x6c
mov eax, dword [ebp - 0x20]
inc eax
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], eax
cmp eax, dword [ebx + 0x4cc8]
jl 0x40d562
mov esi, dword [ebx + 0x4cd0]
test esi, esi
je 0x40d628
mov ecx, dword [0x45e6e8]
mov dword [ebx + 0x4ccc], 0
mov dword [ebx + 0x4cc8], 0
test ecx, ecx
je 0x40d618
movsx eax, word [ecx + 0x5ea4]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbd5
mov dword [ebp - 0x2c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40d60e
movsx eax, word [ecx + 0x5ea4]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x2c]
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
push esi
call edi
add esp, 4
mov dword [ebx + 0x4cd0], 0
lea ecx, [ebx + 0x4d00]
call fcn.00407b90
lea ecx, [ebx + 0x5cec]
call fcn.00407b90
lea ecx, [ebx + 0x5cf8]
call fcn.00407b90
lea ecx, [ebx + 0x4d80]
call fcn.00407b90
lea ecx, [ebx + 0x4d8c]
call fcn.00407b90
lea ecx, [ebx + 0x4d98]
call fcn.00407b90
lea ecx, [ebx + 0x5bec]
mov dword [ebx + 0x5be8], 0
call fcn.00407b90
lea ecx, [ebx + 0x5da4]
call fcn.00407b90
mov eax, dword [ebx + 0x5da0]
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x40d70d
mov ecx, dword [0x45e6e8]
mov dword [ebx + 0x5d9c], 0
mov dword [ebx + 0x5d98], 0
test ecx, ecx
je 0x40d6fd
movsx edx, word [ecx + 0x5ea4]
lea eax, [ecx + 0x5ea8]
mov esi, dword [ecx + 0x3f10]
lea eax, [eax + edx*8]
cmp dword [eax], esi
je 0x40d6f0
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5ea4], ax
cwde
add eax, 0xbd5
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], esi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ea0]
mov eax, dword [ebp - 0x2c]
push eax
call edi
add esp, 4
mov dword [ebx + 0x5da0], 0
cmp dword [ebx + 0x5df4], 0
je 0x40d73f
mov esi, dword [ebx + 0x5df4]
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 0x40d735
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov dword [ebx + 0x5df4], 0
lea ecx, [ebx + 0x5df8]
call fcn.00407b90
lea ecx, [ebx + 0x5e24]
call fcn.00407b90
lea ecx, [ebx + 0x5e30]
call fcn.00407b90
mov dword [ebx + 0x5e3c], 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