Function at 0x40d5c0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x40
xorps xmm0, xmm0
movaps xmmword [esp + 0x20], xmm0
cmp byte [0x4b33c8], 0
jne 0x40d644
call fcn.0040db70
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b33c0], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b33c1], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b33c2], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b33c3], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b33c4], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b33c5], al
or byte [0x4b33c0], 1
mov byte [0x4b33c8], 1
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov ecx, dword [0x4b204c]
cmp ecx, 0xfffffffe
jne 0x40d6c1
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 [0x4b204c], eax
movzx eax, si
push eax
call sub.api_ms_win_crt_filesystem_l1_1_0.dll__umask
add esp, 4
mov eax, dword [0x4b204c]
test eax, eax
js 0x40d761
push 0x48c38b
push eax
call sub.api_ms_win_crt_math_l1_1_0.dll__fdopen
add esp, 8
mov dword [0x4b33d8], eax
mov ecx, dword [0x4b204c]
test eax, eax
je 0x40d74e
test ecx, ecx
js 0x40d761
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov eax, dword [0x4b33d8]
sub esp, 0x18
lea ecx, [esp + 0x28]
mov dword [esp + 0x14], ecx
lea ecx, [esp + 0x2c]
mov dword [esp + 0x10], ecx
lea ecx, [esp + 0x30]
mov dword [esp + 0xc], ecx
lea ecx, [esp + 0x34]
mov dword [esp + 8], ecx
mov dword [esp], eax
call fcn.0040dbe0
add esp, 0x18
cmp eax, 4
jne 0x40d761
movzx eax, word [esp + 0x1c]
and eax, 0x3fff
mov word [0x4b33dc], ax
mov eax, dword [esp + 0x18]
mov dword [0x4b33d0], eax
mov eax, dword [esp + 0x14]
mov dword [0x4b33d4], eax
mov eax, dword [esp + 0x10]
mov dword [0x4b33cc], eax
jmp 0x40d761
push ecx
call sub.api_ms_win_crt_stdio_l1_1_0.dll__close_1
add esp, 4
mov dword [0x4b204c], 0xffffffff
movq xmm0, qword [0x4b33d0]
punpckldq xmm0, xmm0
pxor xmm1, xmm1
pcmpeqd xmm1, xmm0
movmskpd eax, xmm1
cmp al, 3
jne 0x40d7c0
call fcn.0040db70
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b33dc], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor al, byte [0x4b33dd]
and al, 0x3f
mov byte [0x4b33dd], al
push 0
push 0x4b33d0
call fcn.00429b30
add esp, 8
dec dword [0x4b33d0]
nop word [eax + eax]
push 0
lea eax, [esp + 8]
push eax
call fcn.00429b30
add esp, 8
mov esi, dword [esp + 4]
cmp esi, dword [0x4b33d0]
jl 0x40d801
jne 0x40d814
mov edi, dword [esp + 8]
cmp edi, dword [0x4b33d4]
jl 0x40d801
jne 0x40d814
mov ebx, dword [0x4b33cc]
cmp ebx, 9
jg 0x40d7c0
inc ebx
mov dword [0x4b33cc], ebx
mov ecx, esi
jmp 0x40d834
movzx eax, word [0x4b33dc]
inc eax
and eax, 0x3fff
mov word [0x4b33dc], ax
mov dword [0x4b33cc], 0
mov ecx, dword [esp + 4]
mov edi, dword [esp + 8]
mov dword [0x4b33d4], edi
mov dword [0x4b33d0], ecx
xor ebx, ebx
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40d8a6
mov eax, dword [eax]
cmp eax, 2
jl 0x40d8a6
add eax, ebx
dec eax
mov dword [esp + 0x38], eax
mov dword [esp + 0xc], ecx
mov ecx, 0x66666667
imul ecx
mov ecx, edx
mov eax, edx
shr eax, 0x1f
sar ecx, 2
add ecx, eax
lea eax, [ecx + edi]
mov dword [esp + 0x34], eax
mov edx, 0x431bde83
imul edx
add ecx, ecx
lea eax, [ecx + ecx*4]
mov ecx, dword [esp + 0x38]
sub ecx, eax
mov dword [0x4b33cc], ecx
mov eax, edx
shr eax, 0x1f
sar edx, 0x12
add edx, eax
mov eax, dword [esp + 0xc]
add eax, edx
mov dword [0x4b33d0], eax
imul eax, edx, 0xf4240
mov ecx, dword [esp + 0x34]
sub ecx, eax
mov dword [0x4b33d4], ecx
cmp dword [0x4b204c], 0
jle 0x40d950
push dword [0x4b33d8]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_rewind
add esp, 4
movzx eax, word [0x4b33dc]
push dword [0x4b33cc]
push dword [0x4b33d4]
push dword [0x4b33d0]
push eax
push str.clock:__04x_tv:__016lu__08lu_adj:__08d_n
push dword [0x4b33d8]
call fcn.0040dc00
add esp, 0x18
mov dword [esp + 0xc], eax
push dword [0x4b33d8]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fflush
add esp, 4
mov ecx, dword [esp + 0xc]
mov eax, ecx
sar eax, 0x1f
push eax
push ecx
push dword [0x4b204c]
call fcn.00429c00
add esp, 0xc
test eax, eax
jns 0x40d942
push dword [0x4b33d8]
push 1
push 0x14
push str.____________________n
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fwrite
add esp, 0x10
push dword [0x4b33d8]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fflush
add esp, 4
push dword [0x4b33d8]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_rewind
add esp, 4
mov ecx, 0x989680
mov eax, esi
imul ecx
lea ecx, [edi + edi*4]
lea esi, [ebx + ecx*2]
mov ecx, esi
sar ecx, 0x1f
add eax, esi
adc ecx, edx
add eax, 0x13814000
adc ecx, 0x1b21dd2
mov dword [esp + 0x20], eax
movzx eax, word [0x4b33dc]
or eax, 0x8000
mov word [esp + 0x28], ax
mov word [esp + 0x24], cx
shr ecx, 0x10
or ecx, 0x1000
mov word [esp + 0x26], cx
mov eax, dword [0x4b33c0]
mov dword [esp + 0x2a], eax
movzx eax, word [0x4b33c4]
mov word [esp + 0x2e], ax
lea eax, [esp + 0x20]
push dword [ebp + 8]
push eax
call fcn.00429f80
add esp, 8
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret