Function at 0x512110
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58761d
mov eax, dword fs:[0]
push eax
sub esp, 0x54
mov eax, dword [0x732480]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
push esi
lea ecx, [ebp - 0x50]
call fcn.00480420
lea eax, [ebp - 0x38]
mov dword [ebp - 4], 0
push eax
lea ecx, [ebp - 0x50]
mov dword [ebp - 0x60], 0xc
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x58], 0
call fcn.00480ad0
push 0
push 0x80
push 1
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 1
push ecx
push 1
push 0xc0000000
mov ecx, eax
call fcn.0042f930
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebp - 0x38]
mov ebx, eax
or edi, 0xffffffff
mov byte [ebp - 4], 0
mov eax, dword [ecx]
test eax, eax
je 0x5121bb
cmp eax, edi
je 0x5121ca
mov eax, dword [ebp - 0x38]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x5121ca
push 4
push 2
push dword [ebp - 0x38]
call fcn.00425140
add esp, 0xc
cmp ebx, 0xffffffff
jne 0x512261
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 5]
cmp ecx, 0xb2
ja case.0x5121eb.6
movzx ecx, byte [ecx + 0x512358]
jmp dword [ecx*4 + 0x51234c]
mov esi, 1
jmp 0x5122d2
lea eax, [ebp - 0x38]
push eax
lea ecx, [ebp - 0x50]
call fcn.00480ad0
mov ecx, eax
mov byte [ebp - 4], 2
call fcn.0042f930
lea ecx, [ebp - 0x34]
push ecx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesExW]
neg eax
lea ecx, [ebp - 0x38]
sbb esi, esi
add esi, 2
call fcn.00406190
jmp 0x5122d2
movaps xmm0, xmmword [0x58bee0]
push 0
push eax
lea eax, [ebp - 0x24]
mov dword [ebp - 0x14], 0x58bebc
push str.Got_unexpected_locking_error__llu
push eax
movups xmmword [ebp - 0x24], xmm0
call fcn.00457020
add esp, 0x10
mov esi, 3
jmp 0x5122d2
lea eax, [ebp - 0x3c]
mov dword [esi + 4], ebx
push eax
mov ecx, esi
call fcn.004fdae0
mov eax, dword [ebp - 0x3c]
lea edx, [ebp - 0x54]
xor esi, esi
mov dword [ebp - 0x54], 0
push esi
push edx
mov ecx, dword [eax + 0xc]
push dword [eax + 4]
add ecx, eax
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x51229f
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x5122a4
mov esi, 3
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax]
test eax, eax
je 0x5122c3
cmp eax, 0xffffffff
je 0x5122d2
mov eax, dword [ebp - 0x3c]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x5122d2
push 4
push 1
push dword [ebp - 0x3c]
call fcn.00425140
add esp, 0xc
mov eax, dword [ebp - 0x4c]
mov eax, dword [eax]
test eax, eax
je 0x5122f1
cmp eax, 0xffffffff
je 0x512300
mov eax, dword [ebp - 0x4c]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x512300
push 4
push 2
push dword [ebp - 0x4c]
call fcn.00425140
add esp, 0xc
mov eax, dword [ebp - 0x50]
mov eax, dword [eax]
test eax, eax
je 0x51231d
cmp eax, 0xffffffff
je 0x51232c
mov ecx, dword [ebp - 0x50]
lock xadd dword [ecx], edi
dec edi
setne cl
test cl, cl
jne 0x51232c
push 4
push 2
push dword [ebp - 0x50]
call fcn.00425140
add esp, 0xc
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00553392
mov esp, ebp
pop ebp
ret