Function at 0x474320
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x650
mov eax, dword [0x50e018]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
mov esi, ecx
mov dword [ebp - 0x648], esi
test eax, eax
jne 0x47435c
mov eax, 0x10000
mov dword [0x513160], eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a665a
mov esp, ebp
pop ebp
ret
cmp dword [eax], 1
je 0x47437a
mov eax, 0x80000
mov dword [0x513160], eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a665a
mov esp, ebp
pop ebp
ret
push ebx
push edi
mov edi, dword [eax + 4]
cmp dword [edi + 4], 0xffffffff
je 0x47438c
mov ebx, dword [edi]
call fcn.00472e10
mov eax, dword [edi]
mov ebx, dword [ebp + 0xc]
mov dword [edi + 4], 0xffffffff
cmp ebx, dword [eax + 4]
jl 0x4743a7
mov eax, 0x10000
jmp 0x474668
cmp ebx, dword [eax + 0x10]
jge 0x4743b9
mov esi, eax
call fcn.00472580
mov esi, dword [ebp - 0x648]
mov eax, dword [edi]
cmp dword [eax + 0x10], ebx
jge 0x474413
mov esi, dword [edi]
test esi, esi
je 0x474406
cmp dword [esi + 0x18], 0
je 0x474406
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x474406
mov ecx, dword [esi + 0x50]
add ecx, dword [esi + 0x4c]
mov edx, dword [esi + 0x48]
push 0
lea ecx, [ecx + edx + 0x2e]
add dword [esi + 0x14], ecx
mov dword [esi + 0x10], eax
push 0
lea edx, [esi + 0x78]
push edx
lea eax, [esi + 0x28]
push eax
mov eax, esi
call fcn.004722f0
add esp, 0x10
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov ecx, dword [edi]
cmp dword [ecx + 0x10], ebx
jl 0x4743c0
mov esi, dword [ebp - 0x648]
push ebx
lea edx, [ebp - 0x644]
mov ecx, edi
call fcn.004731c0
test byte [ebp - 0x438], 0x10
movzx eax, word [esi]
je 0x47446c
cmp eax, 0x2f
je 0x474443
cmp eax, 0x5c
je 0x474443
test ax, ax
je 0x474455
cmp word [esi + 2], 0x3a
jne 0x474455
push esi
push 0
call fcn.004738d0
add esp, 8
xor eax, eax
jmp 0x474668
push esi
add edi, 0x244
push edi
call fcn.004738d0
add esp, 8
xor eax, eax
jmp 0x474668
mov ebx, esi
mov ecx, esi
test ax, ax
je 0x474490
cmp ax, 0x2f
je 0x474481
cmp ax, 0x5c
jne 0x474484
lea ebx, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x474475
lea edx, [ebp - 0x20c]
mov eax, esi
sub edx, esi
lea ebx, [ebx]
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4744a0
cmp ebx, esi
jne 0x47451f
xor edx, edx
mov word [ebp - 0x20c], dx
push ebx
lea edx, [ebp - 0x20c]
push edx
lea esi, [edi + 0x244]
push esi
lea eax, [ebp - 0x414]
push str._s_s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
lea ecx, [ebp - 0x20c]
push ecx
push esi
call fcn.004738d0
add esp, 0x1c
mov edx, dword [ebp - 0x438]
push 0
push edx
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x474589
mov eax, 0x200
jmp 0x474668
mov eax, ebx
sub eax, esi
sar eax, 1
xor ecx, ecx
mov word [ebp + eax*2 - 0x20c], cx
mov ax, word [ebp - 0x20c]
cmp ax, 0x2f
je 0x474559
cmp ax, 0x5c
je 0x474559
test ax, ax
je 0x4744bc
cmp word [ebp - 0x20a], 0x3a
jne 0x4744bc
push ebx
lea edx, [ebp - 0x20c]
push edx
lea eax, [ebp - 0x414]
push str._s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
lea ecx, [ebp - 0x20c]
push ecx
push 0
call fcn.004738d0
add esp, 0x18
jmp 0x4744ed
mov ecx, dword [edi + 0x23c]
mov eax, dword [edi]
push ecx
call fcn.00472950
add esp, 4
cmp dword [edi + 0x240], 0
jne 0x4745b7
push 0x4000
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
mov dword [edi + 0x240], eax
mov dword [ebp - 0x648], 0
mov eax, dword [edi + 0x240]
lea edx, [ebp - 0x649]
push edx
push eax
mov eax, dword [edi]
mov ecx, 0x4000
call fcn.00472ad0
mov esi, eax
add esp, 8
cmp esi, 0xffffff96
je 0x474620
test esi, esi
js 0x474614
jle 0x474607
mov edx, dword [edi + 0x240]
push 0
lea ecx, [ebp - 0x650]
push ecx
push esi
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x47462c
cmp byte [ebp - 0x649], 0
jne 0x474638
test esi, esi
jne 0x4745c1
mov dword [ebp - 0x648], 0x5000000
jmp 0x474654
mov dword [ebp - 0x648], 0x1000
jmp 0x474654
mov dword [ebp - 0x648], 0x400
jmp 0x474654
lea eax, [ebp - 0x424]
push eax
lea ecx, [ebp - 0x434]
push ecx
lea edx, [ebp - 0x42c]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [edi]
call fcn.00472e10
mov eax, dword [ebp - 0x648]
mov ecx, dword [ebp - 4]
pop edi
pop ebx
xor ecx, ebp
mov dword [0x513160], eax
pop esi
call fcn.004a665a
mov esp, ebp
pop ebp
ret