Function at 0x46b580
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x406c
call fcn.005379c0
mov eax, dword [0x5f6ea4]
xor eax, esp
mov dword [esp + 0x4068], eax
push ebx
push esi
push edi
mov ecx, 1
mov edx, 0x5ffb10
mov eax, 0x3e7
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x46b830
mov eax, dword [ebp + 8]
lea edi, [esp + 0x70]
test eax, eax
mov ecx, 0x5e1cac
cmovne ecx, eax
lea eax, [ebp + 0xc]
push eax
xor esi, esi
mov eax, edi
push esi
push ecx
push 0xfff
push eax
call fcn.00457460
mov ecx, dword [eax]
push dword [eax + 4]
or ecx, 1
push ecx
call fcn.005598ae
or ecx, 0xffffffff
add esp, 0x1c
test eax, eax
cmovs eax, ecx
test eax, eax
js 0x46b60a
cmp eax, 0xfff
ja 0x46b60a
jne 0x46b61e
jmp 0x46b60f
mov esi, 0x8007007a
xor eax, eax
mov word [esp + 0x206e], ax
mov eax, 0xfff
lea eax, [esp + eax*2 + 0x70]
mov dword [esp + 0x18], eax
test esi, esi
jns 0x46b657
push 0x500
lea eax, [esp + 0x20]
mov edx, 0x2000
push eax
lea eax, [esp + 0x20]
push eax
push ecx
lea ecx, [esp + 0x80]
call fcn.0046b220
cmp esi, 0x8007007a
jne 0x46b659
mov eax, dword [esp + 0x18]
mov edi, eax
lea eax, [esp + 0x70]
sub edi, eax
and edi, 0xfffffffe
test edi, edi
jle 0x46b830
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [esp + 0x2c]
push eax
movzx eax, word [esp + 0x2e]
push eax
movzx eax, word [esp + 0x30]
push eax
lea eax, [esp + 0x3c]
push str.__02d:_02d:_02d_
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
mov esi, eax
push 0x5ffaf8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
test esi, esi
je 0x46b7d9
mov ecx, dword [0x5ffaf4]
test cl, 2
je 0x46b715
mov edx, dword [0x5f7da8]
cmp edx, 0xffffffff
je 0x46b715
push 0
lea eax, [esp + 0x1c]
push eax
lea eax, [esi + esi]
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
push eax
lea eax, [esp + 0x3c]
push eax
push edx
call esi
push 0
lea eax, [esp + 0x1c]
push eax
push edi
lea eax, [esp + 0x7c]
push eax
push dword [0x5f7da8]
call esi
push 0
lea eax, [esp + 0x1c]
push eax
push 4
push 0x5e2dec
push dword [0x5f7da8]
call esi
mov ecx, dword [0x5ffaf4]
test cl, 1
je 0x46b7d9
push 0x2000
lea eax, [esp + 0x2074]
push 0
push eax
call fcn.0054f070
add esp, 0xc
lea eax, [esp + 0x70]
push eax
lea eax, [esp + 0x34]
push eax
push str._s__s
push 0x500
push 0
push 0
lea eax, [esp + 0x2088]
push 0x2000
push eax
call fcn.0046b050
add esp, 0x20
lea eax, [esp + 0x2070]
push eax
call ebx
push 0
push 0
push 0
push 0
mov ebx, eax
lea eax, [esp + 0x2080]
push ebx
push eax
push 0
push 1
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
test edi, edi
je 0x46b7d3
lea ecx, [edi*2 + 2]
call fcn.0045c900
push 0
push 0
push edi
mov esi, eax
lea eax, [esp + 0x207c]
push esi
push ebx
push eax
push 0
push 1
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
je 0x46b7ca
mov edx, esi
call fcn.0046b8d0
push eax
call fcn.0046bb80
add esp, 4
push esi
call fcn.0055297a
add esp, 4
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
push 0x5ffaf8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x5fd9b0], 0
je 0x46b830
lea eax, [esp + 0x70]
mov dword [esp + 0xc], 0
push eax
call ebx
lea eax, [eax*2 + 2]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x70]
mov dword [esp + 0x14], eax
lea eax, [esp + 0x1c]
push eax
push 0xfa
push 2
lea eax, [esp + 0x18]
push eax
push 1
push 0x4a
push dword [0x5fd9b0]
call dword [sym.imp.USER32.dll_SendMessageTimeoutW]
mov ecx, dword [esp + 0x4074]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00536fd5
mov esp, ebp
pop ebp
ret