Function at 0x40de50
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 [0x4b7438], 0
jne 0x40ded4
call fcn.0040e400
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b7430], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b7431], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b7432], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b7433], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b7434], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b7435], al
or byte [0x4b7430], 1
mov byte [0x4b7438], 1
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov ecx, dword [0x4b604c]
cmp ecx, 0xfffffffe
jne 0x40df51
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 [0x4b604c], eax
movzx eax, si
push eax
call sub.api_ms_win_crt_filesystem_l1_1_0.dll__umask
add esp, 4
mov eax, dword [0x4b604c]
test eax, eax
js 0x40dff1
push 0x48f343
push eax
call sub.api_ms_win_crt_math_l1_1_0.dll__fdopen
add esp, 8
mov dword [0x4b7448], eax
mov ecx, dword [0x4b604c]
test eax, eax
je 0x40dfde
test ecx, ecx
js 0x40dff1
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov eax, dword [0x4b7448]
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.0040e480
add esp, 0x18
cmp eax, 4
jne 0x40dff1
movzx eax, word [esp + 0x1c]
and eax, 0x3fff
mov word [0x4b744c], ax
mov eax, dword [esp + 0x18]
mov dword [0x4b7440], eax
mov eax, dword [esp + 0x14]
mov dword [0x4b7444], eax
mov eax, dword [esp + 0x10]
mov dword [0x4b743c], eax
jmp 0x40dff1
push ecx
call sub.api_ms_win_crt_stdio_l1_1_0.dll__close
add esp, 4
mov dword [0x4b604c], 0xffffffff
mov eax, dword [0x4b7440]
or eax, dword [0x4b7444]
jne 0x40e03c
call fcn.0040e400
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor byte [0x4b744c], al
call sub.api_ms_win_crt_utility_l1_1_0.dll_rand
shr eax, 7
xor al, byte [0x4b744d]
and al, 0x3f
mov byte [0x4b744d], al
push 0
push 0x4b7440
call fcn.0042f160
add esp, 8
add dword [0x4b7440], 0xffffffff
lea esi, [esp + 4]
push 0
push esi
call fcn.0042f160
add esp, 8
mov eax, dword [esp + 4]
cmp eax, dword [0x4b7440]
jl 0x40e081
jne 0x40e098
mov ecx, dword [esp + 8]
cmp ecx, dword [0x4b7444]
jl 0x40e081
jne 0x40e098
mov ebx, dword [0x4b743c]
cmp ebx, 9
jg 0x40e040
add ebx, 1
mov dword [0x4b743c], ebx
mov dword [esp + 0xc], eax
jmp 0x40e0bc
movzx ecx, word [0x4b744c]
add ecx, 1
and ecx, 0x3fff
mov word [0x4b744c], cx
mov dword [0x4b743c], 0
mov edx, dword [esp + 4]
mov ecx, dword [esp + 8]
mov dword [0x4b7444], ecx
mov dword [esp + 0xc], edx
mov dword [0x4b7440], edx
xor ebx, ebx
lea edx, [ecx + ecx*4]
lea esi, [ebx + edx*2]
mov edi, esi
mov edx, 0x989680
imul edx
sar edi, 0x1f
add eax, esi
adc edx, edi
mov edi, edx
add eax, 0x13814000
mov dword [esp + 0x38], eax
adc edi, 0x1b21dd2
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40e144
mov eax, dword [eax]
cmp eax, 2
jl 0x40e144
add ebx, eax
add ebx, 0xffffffff
mov edx, 0x66666667
mov eax, ebx
imul edx
mov eax, edx
shr eax, 0x1f
sar edx, 2
add edx, eax
add ecx, edx
add edx, edx
lea eax, [edx + edx*4]
sub ebx, eax
mov dword [0x4b743c], ebx
mov edx, 0x431bde83
mov eax, ecx
imul edx
mov eax, edx
shr eax, 0x1f
sar edx, 0x12
add edx, eax
mov eax, dword [esp + 0xc]
add eax, edx
mov dword [0x4b7440], eax
imul eax, edx, 0xf4240
sub ecx, eax
mov dword [0x4b7444], ecx
cmp dword [0x4b604c], 0
mov esi, dword [ebp + 8]
jle 0x40e1eb
push dword [0x4b7448]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_rewind
add esp, 4
movzx eax, word [0x4b744c]
push dword [0x4b743c]
push dword [0x4b7444]
push dword [0x4b7440]
push eax
push str.clock:__04x_tv:__016lu__08lu_adj:__08d_n
push dword [0x4b7448]
call fcn.0040e4a0
add esp, 0x18
mov ebx, eax
push dword [0x4b7448]
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 [0x4b604c]
call fcn.0042f230
add esp, 0xc
test eax, eax
jns 0x40e1dd
push dword [0x4b7448]
push 1
push 0x14
push str.____________________n
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fwrite
add esp, 0x10
push dword [0x4b7448]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fflush
add esp, 4
push dword [0x4b7448]
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 [0x4b744c]
or eax, 0x8000
mov word [esp + 0x28], ax
mov word [esp + 0x24], di
shr edi, 0x10
or edi, 0x1000
mov word [esp + 0x26], di
mov eax, dword [0x4b7430]
mov dword [esp + 0x2a], eax
movzx eax, word [0x4b7434]
mov word [esp + 0x2e], ax
lea eax, [esp + 0x20]
push esi
push eax
call fcn.0042f5b0
add esp, 8
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret