Function at 0x408510
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov dword [ebp - 4], 0
test esi, esi
je 0x408863
mov ecx, dword [esi]
test ecx, ecx
je 0x40853a
mov eax, dword [ecx]
mov edx, dword [eax + 4]
call edx
jmp 0x40853f
mov eax, 0x4334c8
push 0x4348d8
mov ecx, eax
call dword [sym.imp.MSVCR100.dll_public:_bool___thiscall_type_info::operator_class_type_info_const__const]
test al, al
je 0x408863
mov eax, dword [esi]
add eax, 4
mov dword [ebp - 8], eax
je 0x408863
mov ebx, dword [ebp + 8]
call fcn.004067d0
mov eax, dword [ebx + 0x10]
add eax, 8
cmp eax, dword [ebx + 0x14]
jb 0x40857d
lea esi, [ebx + 4]
call fcn.0040cef0
mov eax, dword [ebx + 0x10]
lea ecx, [eax + 8]
mov dword [ebx + 0x10], ecx
test eax, eax
je 0x408594
mov dword [eax], 0
mov byte [eax + 4], 1
mov edx, dword [ebx]
mov esi, dword [edx]
push 0x5b
call fcn.00407e30
add esp, 4
call fcn.004067d0
mov eax, dword [ebx + 0x10]
add eax, 8
cmp eax, dword [ebx + 0x14]
jb 0x4085ba
lea esi, [ebx + 4]
call fcn.0040cef0
mov eax, dword [ebx + 0x10]
lea ecx, [eax + 8]
mov dword [ebx + 0x10], ecx
test eax, eax
je 0x4085d1
mov dword [eax], 0
mov byte [eax + 4], 0
mov edx, dword [ebx]
mov esi, dword [edx]
push 0x7b
call fcn.00407e30
mov eax, dword [ebp - 8]
mov eax, dword [eax + 4]
mov edi, dword [eax]
add esp, 4
cmp edi, eax
je 0x40863d
cmp dword [edi + 0x1c], 8
lea eax, [edi + 8]
jb 0x4085fb
mov eax, dword [eax]
mov dword [ebp + 0xc], eax
jmp 0x4085fe
mov dword [ebp + 0xc], eax
cmp word [eax], 0
mov esi, eax
je 0x40860f
add esi, 2
cmp word [esi], 0
jne 0x408606
call fcn.004067d0
mov eax, dword [ebp + 0xc]
sub esi, eax
sar esi, 1
push esi
push eax
push ebx
call fcn.004068f0
lea ecx, [edi + 0x24]
push ecx
push ebx
call fcn.00406b70
mov edi, dword [edi]
mov edx, dword [ebp - 8]
add dword [ebp - 4], eax
add esp, 8
cmp edi, dword [edx + 4]
jne 0x4085eb
add dword [ebx + 0x10], 0xfffffff8
mov eax, dword [ebx + 0x10]
cmp dword [eax], 0
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
je 0x4086c8
mov eax, dword [ebx]
mov esi, dword [eax]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x408676
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x408676
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0xa
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x4086a2
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x4086a2
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0
inc dword [esi + 0xc]
mov eax, dword [ebx + 0x10]
sub eax, dword [ebx + 0xc]
movzx edx, word [ebx + 0x20]
mov ecx, dword [ebx]
shr eax, 3
imul eax, dword [ebx + 0x24]
push edx
push ecx
call fcn.00407ea0
add esp, 8
mov edx, dword [ebx]
mov esi, dword [edx]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x4086ef
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x4086ef
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0x7d
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x40871b
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40871b
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0
inc dword [esi + 0xc]
mov edx, dword [ebx + 0x10]
cmp edx, dword [ebx + 0xc]
jne 0x40874e
mov eax, dword [ebx]
mov esi, dword [eax]
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40874e
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
add dword [ebx + 0x10], 0xfffffff8
mov eax, dword [ebx + 0x10]
cmp dword [eax], 0
je 0x4087d3
mov ecx, dword [ebx]
mov esi, dword [ecx]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x408781
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x408781
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0xa
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x4087ad
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x4087ad
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0
inc dword [esi + 0xc]
mov eax, dword [ebx + 0x10]
sub eax, dword [ebx + 0xc]
movzx edx, word [ebx + 0x20]
mov ecx, dword [ebx]
shr eax, 3
imul eax, dword [ebx + 0x24]
push edx
push ecx
call fcn.00407ea0
add esp, 8
mov edx, dword [ebx]
mov esi, dword [edx]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x4087fa
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x4087fa
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0x5d
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x408826
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x408826
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0
inc dword [esi + 0xc]
mov edx, dword [ebx + 0x10]
cmp edx, dword [ebx + 0xc]
jne 0x408859
mov eax, dword [ebx]
mov esi, dword [eax]
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x408859
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 8]
mov ebx, edi
call fcn.004067d0
mov ecx, dword [edi + 0x10]
lea esi, [edi + 4]
add ecx, 8
cmp ecx, dword [esi + 0x10]
jb 0x408880
call fcn.0040cef0
mov eax, dword [esi + 0xc]
lea edx, [eax + 8]
mov dword [esi + 0xc], edx
test eax, eax
je 0x408897
mov dword [eax], 0
mov byte [eax + 4], 0
mov eax, dword [edi]
mov esi, dword [eax]
push 0x7b
call fcn.00407e30
add esp, 4
call fcn.004065f0
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret