Function at 0x651473
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x100598e6
mov eax, dword fs:[0]
push eax
sub esp, 0x130
mov eax, dword [reloc.MSVCRT.dll___dllonexit]
xor eax, esp
mov dword [esp + reloc.MSVCRT.dll___dllonexit], eax
push ebx
push esi
push edi
mov eax, dword [reloc.MSVCRT.dll___dllonexit]
xor eax, esp
push eax
lea eax, reloc.MSVCRT.dll___dllonexit
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
xor ebx, ebx
mov edi, edx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x18], reloc.MSVCRT.dll___dllonexit
cmp dword [edi + reloc.MSVCRT.dll___dllonexit], ebx
jne 0x6516d6
mov dword [esp + 0x34], reloc.MSVCRT.dll___dllonexit
mov dword [esp + 0x44], 0x1006f438
mov dword [esp + reloc.MSVCRT.dll___dllonexit], ebx
lea ecx, [esp + 0x94]
mov dword [esp + 0x18], 1
mov dword [esp + 0x94], 0x1005cc24
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x40], ebx
call fcn.0064cf03
lea edx, [esp + 0x4c]
push 0x20
lea ecx, [esp + 0x98]
mov dword [esp + 0xd0], edx
mov dword [esp + 0xd4], ebx
call fcn.00656593
mov byte [esp + 0xd4], al
cmp dword [esp + 0xcc], ebx
jne 0x651560
mov eax, dword [esp + 0xa0]
or eax, 4
push ebx
push eax
lea ecx, [esp + 0x9c]
call fcn.0064cdc3
mov eax, dword [esp + 0x44]
mov ecx, dword [eax + 4]
mov dword [esp + ecx + 0x44], 0x1005cc1c
mov edx, dword [esp + 0x34]
mov eax, dword [edx + 4]
mov dword [esp + eax + 0x34], 0x1005cc2c
mov dword [esp + reloc.MSVCRT.dll___dllonexit], 5
mov ecx, dword [esp + 0x34]
mov edx, dword [ecx + 4]
lea ecx, [esp + 0x4c]
mov dword [esp + edx + 0x34], 0x1005cd4c
call fcn.006559f3
mov dword [esp + 0x4c], 0x1005ccd4
mov dword [esp + 0x88], ebx
mov dword [esp + 0x8c], ebx
lea eax, [esp + 0x44]
push 0x1006f204
push eax
mov dword [esp + reloc.MSVCRT.dll___dllonexit], 7
call fcn.006569a3
add esp, 8
lea ecx, reloc.MSVCRT.dll___dllonexit
push ecx
lea ecx, [esp + 0x38]
call fcn.006546b3
push 0x1006ef68
mov byte [esp + 0x14c], 8
call fcn.0065799b
mov ecx, eax
add esp, 4
mov dword [esp + 0xf0], 0xf
mov dword [esp + 0xec], ebx
mov byte [esp + 0xdc], 0
lea esi, [ecx + 1]
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x651619
sub ecx, esi
push ecx
push eax
lea ecx, [esp + 0xe4]
call fcn.006550e3
push 8
push 0x1006ef70
lea ecx, [esp + 0xe4]
mov byte [esp + 0x150], 9
call fcn.006557a3
mov eax, dword [esp + 0xdc]
mov edi, 0x10
cmp dword [esp + 0xf0], edi
jae 0x651667
lea eax, [esp + 0xdc]
push 0x1006ef7c
push eax
call fcn.00657ad1
add esp, 8
mov esi, eax
mov eax, dword [esp + reloc.MSVCRT.dll___dllonexit]
cmp dword [esp + reloc.MSVCRT.dll___dllonexit], edi
jae 0x65168e
lea eax, reloc.MSVCRT.dll___dllonexit
mov edx, dword [esp + 0x110]
push esi
push 1
push edx
push eax
call fcn.00657c3f
push esi
call fcn.00657d26
mov eax, dword [esp + 0xf0]
add esp, 0x14
cmp dword [esp + 0xf0], edi
jae 0x6516bf
lea eax, [esp + 0xdc]
push 1
push ebx
push ebx
push eax
push 0x1006ef80
push ebx
call dword [0x1005a19c]
push ebx
call fcn.0065801d
lea eax, reloc.MSVCRT.dll___dllonexit
push eax
push 0x1006efd0
lea ecx, [edi + 0xe0]
call fcn.0066aab3
mov ecx, eax
call fcn.00671483
push 0xffffffffffffffff
push ebx
lea ecx, reloc.MSVCRT.dll___dllonexit
mov dword [esp + reloc.MSVCRT.dll___dllonexit], 0xa
push ecx
mov esi, 0xf
lea ecx, reloc.MSVCRT.dll___dllonexit
mov dword [esp + reloc.MSVCRT.dll___dllonexit], esi
mov dword [esp + reloc.MSVCRT.dll___dllonexit], ebx
mov byte [esp + 0x128], 0
call fcn.00654ff3
mov byte [esp + 0x148], 0xc
cmp dword [esp + reloc.MSVCRT.dll___dllonexit], 0x10
jb 0x651754
mov edx, dword [esp + reloc.MSVCRT.dll___dllonexit]
push edx
call fcn.006571f5
add esp, 4
cmp dword [edi + reloc.MSVCRT.dll___dllonexit], 0x10
lea eax, reloc.MSVCRT.dll___dllonexit
mov dword [esp + reloc.MSVCRT.dll___dllonexit], esi
mov dword [esp + 0x110], ebx
mov byte [esp + 0x100], 0
mov dword [esp + 0x1c], eax
mov dword [eax + 0x10], ebx
jb 0x651782
mov eax, dword [eax]
lea ecx, reloc.MSVCRT.dll___dllonexit
mov byte [eax], 0
mov dword [esp + 0x24], ecx
call fcn.00667833
mov dword [esp + 0x20], eax
cmp eax, ebx
jbe 0x651861
lea esi, reloc.MSVCRT.dll___dllonexit
mov dword [esp + 0x28], esi
jmp 0x6517b7
mov esi, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
push ebx
call fcn.00667de3
push eax
lea ecx, [esp + 0xe0]
call fcn.00671bf3
mov eax, 0x10
mov byte [esp + 0x148], 0xd
cmp dword [esi + 0x14], eax
jb 0x6517e4
mov edx, dword [esi]
jmp 0x6517e6
mov edx, esi
cmp dword [edi + reloc.MSVCRT.dll___dllonexit], eax
jb 0x6517f6
mov ecx, dword [edi + reloc.MSVCRT.dll___dllonexit]
jmp 0x6517fc
lea ecx, reloc.MSVCRT.dll___dllonexit
cmp dword [esp + reloc.MSVCRT.dll___dllonexit], eax
mov eax, dword [esp + reloc.MSVCRT.dll___dllonexit]
jae 0x651813
lea eax, reloc.MSVCRT.dll___dllonexit
mov esi, dword [esp + 0x2c]
push esi
mov esi, dword [esp + 0x34]
push esi
mov esi, dword [esp + 0x24]
push eax
mov eax, dword [esp + 0xf0]
push eax
call fcn.00653863
mov byte [esp + 0x148], 0xc
lea ecx, [esp + 0xdc]
test eax, eax
je 0x651854
call fcn.006707d3
inc ebx
cmp ebx, dword [esp + 0x20]
jb 0x6517b3
jmp 0x651861
mov dword [esp + 0x18], 0
call fcn.006707d3
cmp dword [esp + reloc.MSVCRT.dll___dllonexit], 0x10
jb 0x65187b
mov ecx, dword [esp + reloc.MSVCRT.dll___dllonexit]
push ecx
call fcn.006571f5
add esp, 4
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + reloc.MSVCRT.dll___dllonexit]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + reloc.MSVCRT.dll___dllonexit]
xor ecx, esp
call fcn.006571e6
mov esp, ebp
pop ebp
ret 4