Function at 0x40c4f0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x40
cmp byte [0x4779c8], 0
xorps xmm0, xmm0
movaps xmmword [esp + 0x20], xmm0
jne 0x40c574
call fcn.0040caa0
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4779c0], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4779c1], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4779c2], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4779c3], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4779c4], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
mov byte [0x4779c8], 1
xor byte [0x4779c5], al
or byte [0x4779c0], 1
mov eax, dword [0x4761a0]
mov dword [esp + 8], 0
mov dword [esp + 4], 0
cmp eax, 0xfffffffe
jne 0x40c5ef
push 0
call sub.api_ms_win_crt_filesystem_l1_1_0.dll__umask
add esp, 4
mov esi, eax
push 0x1b0
push 0x102
push str._var_lib_libuuid_clock.txt
call sub.api_ms_win_crt_stdio_l1_1_0.dll__open
add esp, 0xc
mov dword [0x4761a0], eax
movzx eax, si
push eax
call sub.api_ms_win_crt_filesystem_l1_1_0.dll__umask
add esp, 4
mov eax, dword [0x4761a0]
test eax, eax
js 0x40c692
push 0x468550
push eax
call sub.api_ms_win_crt_math_l1_1_0.dll__fdopen
add esp, 8
mov dword [0x4779d8], eax
test eax, eax
mov eax, dword [0x4761a0]
je 0x40c67f
test eax, eax
js 0x40c692
mov eax, dword [0x4779d8]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
sub esp, 0x18
lea edx, [esp + 0x2c]
lea ecx, [esp + 0x28]
lea esi, [esp + 0x30]
mov dword [esp], eax
mov dword [esp + 0x10], edx
lea edx, [esp + 0x34]
mov dword [esp + 0x14], ecx
mov dword [esp + 0xc], esi
mov dword [esp + 8], edx
call fcn.0040cb00
add esp, 0x18
cmp eax, 4
jne 0x40c692
mov ecx, dword [esp + 0x18]
movzx eax, word [esp + 0x1c]
mov edx, dword [esp + 0x14]
mov dword [0x4779d0], ecx
mov ecx, dword [esp + 0x10]
and eax, 0x3fff
mov dword [0x4779d4], edx
mov word [0x4779dc], ax
mov dword [0x4779cc], ecx
jmp 0x40c692
push eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll__close
add esp, 4
mov dword [0x4761a0], 0xffffffff
mov eax, dword [0x4779d4]
or eax, dword [0x4779d0]
jne 0x40c6dc
call fcn.0040caa0
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4779dc], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor al, byte [0x4779dd]
and al, 0x3f
mov byte [0x4779dd], al
push 0
push 0x4779d0
call fcn.0041c3a0
add esp, 8
dec dword [0x4779d0]
lea esi, [esp + 4]
push 0
push esi
call fcn.0041c3a0
add esp, 8
mov eax, dword [esp + 4]
cmp eax, dword [0x4779d0]
jl 0x40c71f
jne 0x40c734
mov ecx, dword [esp + 8]
cmp ecx, dword [0x4779d4]
jl 0x40c71f
jne 0x40c734
mov ebx, dword [0x4779cc]
cmp ebx, 9
jg 0x40c6e0
inc ebx
mov dword [esp + 0xc], eax
mov dword [0x4779cc], ebx
jmp 0x40c758
movzx ecx, word [0x4779dc]
inc ecx
and ecx, 0x3fff
mov word [0x4779dc], cx
mov edx, dword [esp + 4]
mov ecx, dword [esp + 8]
mov dword [0x4779cc], 0
xor ebx, ebx
mov dword [0x4779d4], ecx
mov dword [esp + 0xc], edx
mov dword [0x4779d0], edx
mov edx, dword [esp + 8]
lea edx, [edx + edx*4]
lea esi, [ebx + edx*2]
mov edx, 0x989680
mov edi, esi
imul edx
sar edi, 0x1f
add eax, esi
adc edx, edi
add eax, 0x13814000
mov dword [esp + 0x38], eax
mov eax, dword [ebp + 0xc]
mov edi, edx
adc edi, 0x1b21dd2
test eax, eax
je 0x40c7e4
mov eax, dword [eax]
cmp eax, 2
jl 0x40c7e4
lea ebx, [ebx + eax - 1]
mov edx, 0x66666667
mov esi, dword [esp + 0xc]
mov eax, ebx
imul edx
mov eax, edx
sar edx, 2
shr eax, 0x1f
add edx, eax
add ecx, edx
add edx, edx
lea eax, [edx + edx*4]
mov edx, 0x431bde83
sub ebx, eax
mov eax, ecx
imul edx
mov dword [0x4779cc], ebx
mov eax, edx
sar edx, 0x12
shr eax, 0x1f
add edx, eax
add esi, edx
imul edx, edx, 0xf4240
sub ecx, edx
mov dword [0x4779d0], esi
mov dword [0x4779d4], ecx
cmp dword [0x4761a0], 0
mov esi, dword [ebp + 8]
jle 0x40c88b
push dword [0x4779d8]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_rewind
add esp, 4
movzx eax, word [0x4779dc]
push dword [0x4779cc]
push dword [0x4779d4]
push dword [0x4779d0]
push eax
push str.clock:__04x_tv:__016lu__08lu_adj:__08d_n
push dword [0x4779d8]
call fcn.0040cb20
add esp, 0x18
mov ebx, eax
push dword [0x4779d8]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fflush
add esp, 4
mov eax, ebx
sar eax, 0x1f
push eax
push ebx
push dword [0x4761a0]
call fcn.0040b270
add esp, 0xc
test eax, eax
jns 0x40c87d
push dword [0x4779d8]
push 1
push 0x14
push str.____________________n
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fwrite
add esp, 0x10
push dword [0x4779d8]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fflush
add esp, 4
push dword [0x4779d8]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_rewind
add esp, 4
mov eax, dword [esp + 0x38]
mov dword [esp + 0x20], eax
movzx eax, word [0x4779dc]
or eax, 0x8000
mov word [esp + 0x28], ax
mov eax, dword [0x4779c0]
mov word [esp + 0x24], di
shr edi, 0x10
or edi, 0x1000
mov word [esp + 0x26], di
mov dword [esp + 0x2a], eax
movzx eax, word [0x4779c4]
mov word [esp + 0x2e], ax
lea eax, [esp + 0x20]
push esi
push eax
call fcn.0041c260
add esp, 8
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret