Function at 0x1010ab80
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa4
mov eax, dword [0x102519c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
mov dword [ebp - 0x90], 0
mov dword [ebp - 0xa4], ebx
test ebx, ebx
je 0x1010abb1
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebx + 0x20]
sub eax, dword [ebx + 0x1c]
push edi
lea edi, [ebx + 0x1c]
mov dword [ebp - 0xa0], edi
test eax, 0xfffffffc
je 0x1010ae92
push esi
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
push 0
push 0x80
push 4
push 0
push 1
push 0x40000000
push dword [ebx + 0x18]
lea esi, [eax + 0x10]
mov dword [ebp - 0x8c], esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
or ecx, 0xffffffff
mov dword [ebp - 0x94], eax
cmp eax, ecx
je 0x1010ae7c
push 2
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebx + 0x28]
cmp dword [eax - 0xc], 0
je 0x1010acb7
cmp dword [0x1023fe04], 0
je 0x1010ac52
push dword [0x1023fe00]
lea ecx, [ebp - 0x88]
push eax
call fcn.10098d30
mov ecx, 1
mov dword [ebp - 0x90], ecx
mov eax, dword [eax]
jmp 0x1010ac57
mov eax, 0x10202a60
push eax
lea eax, [ebp - 0x8c]
push str.__________________________s__________________________r_n
push eax
call fcn.100993d0
mov eax, dword [ebp - 0x90]
add esp, 0xc
test al, 1
je 0x1010ac98
and eax, 0xfffffffe
lea ecx, [ebp - 0x84]
mov dword [ebp - 0x90], eax
mov eax, dword [ebp - 0x88]
cmp eax, ecx
je 0x1010ac98
push eax
call fcn.101fa00b
add esp, 4
mov esi, dword [ebp - 0x8c]
lea eax, [ebp - 0x98]
push 0
push eax
push dword [esi - 0xc]
push esi
push dword [ebp - 0x94]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [edi + 4]
xor edx, edx
mov ecx, dword [edi]
sub eax, ecx
sar eax, 2
mov dword [ebp - 0x9c], edx
test eax, eax
je 0x1010add6
mov ebx, dword [ecx + edx*4]
test ebx, ebx
je 0x1010ad33
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push ebx
push 0
push 3
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea edi, [eax - 1]
test edi, edi
jle 0x1010ad33
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edi
or ecx, eax
jge 0x1010ad17
push edi
lea ecx, [ebp - 0x8c]
call fcn.1005ce30
mov esi, dword [ebp - 0x8c]
push 0
push 0
push edi
push esi
push 0xffffffffffffffff
push ebx
push 0
push 3
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [esi - 0xc], edi
mov byte [edi + esi], 0
jmp 0x1010ad77
cmp dword [esi - 0xc], 0
lea edx, [esi - 0x10]
mov edi, dword [edx]
je 0x1010ad77
cmp dword [edx + 0xc], 0
lea ecx, [edx + 0xc]
jge 0x1010ad53
mov dword [esi - 0xc], 0
mov byte [esi], 0
jmp 0x1010ad77
or eax, 0xffffffff
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x1010ad67
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x8c], esi
mov eax, dword [esi - 0xc]
test eax, eax
je 0x1010adab
mov ebx, dword [ebp - 0x94]
lea ecx, [ebp - 0x98]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
push ecx
push eax
push esi
push ebx
call edi
push 0
lea eax, [ebp - 0x98]
push eax
push 2
push 0x1020e594
push ebx
call edi
mov edi, dword [ebp - 0xa0]
mov edx, dword [ebp - 0x9c]
inc edx
mov dword [ebp - 0x9c], edx
mov eax, dword [edi + 4]
mov ecx, dword [edi]
sub eax, ecx
sar eax, 2
cmp edx, eax
jb 0x1010acd1
mov ebx, dword [ebp - 0xa4]
mov eax, dword [ebx + 0x28]
cmp dword [eax - 0xc], 0
je 0x1010ae66
cmp dword [0x1023fe04], 0
je 0x1010ae09
push dword [0x1023fe00]
or dword [ebp - 0x90], 2
lea ecx, [ebp - 0x88]
push eax
call fcn.10098d30
mov eax, dword [eax]
jmp 0x1010ae0e
mov eax, 0x10202a60
push eax
lea eax, [ebp - 0x8c]
push str.__________________________s__________________________r_n
push eax
call fcn.100993d0
mov ecx, dword [ebp - 0x90]
add esp, 0xc
test cl, 2
je 0x1010ae47
mov eax, dword [ebp - 0x88]
lea ecx, [ebp - 0x84]
cmp eax, ecx
je 0x1010ae47
push eax
call fcn.101fa00b
add esp, 4
mov esi, dword [ebp - 0x8c]
lea eax, [ebp - 0x98]
push 0
push eax
push dword [esi - 0xc]
push esi
push dword [ebp - 0x94]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x94]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, edi
call fcn.100996c0
or ecx, 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], ecx
dec ecx
test ecx, ecx
jg 0x1010ae91
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
pop esi
pop edi
test ebx, ebx
je 0x1010ae9e
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.101f99c6
mov esp, ebp
pop ebp
ret