Function at 0x10004760
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100100f9
mov eax, dword fs:[0]
push eax
sub esp, 0x34
push ebx
push esi
push edi
mov eax, dword [0x1001601c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov ebx, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x10004a77
lea esi, [ebx + 0x68]
test esi, esi
je 0x100047ae
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [ebx], 0
jne 0x100048cc
lea esi, [ebx + 0x2c]
mov ecx, esi
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::clear_void_]
cmp dword [ebx + 0x5c], 0
mov edi, 0x10
jbe 0x10004857
cmp dword [ebx + 0x60], edi
jb 0x100047db
mov eax, dword [ebx + 0x4c]
jmp 0x100047de
lea eax, [ebx + 0x4c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x10004857
cmp dword [ebx + 0x28], edi
jb 0x100047f3
mov ecx, dword [ebx + 0x14]
jmp 0x100047f6
lea ecx, [ebx + 0x14]
cmp dword [0x100165e4], edi
mov edx, dword [0x100165d0]
jae 0x10004809
mov edx, 0x100165d0
cmp dword [ebx + 0x60], edi
jb 0x10004813
mov eax, dword [ebx + 0x4c]
jmp 0x10004816
lea eax, [ebx + 0x4c]
mov edi, dword [ebx + 0x64]
push str..tmp
push edi
push ecx
push edx
push eax
push 0x10011a30
lea ecx, [ebp - 0x40]
call fcn.10008260
add esp, 0x18
push eax
mov ecx, esi
mov dword [ebp - 4], 0
call dword [0x10011150]
lea ecx, [ebp - 0x40]
mov dword [ebp - 4], 0xffffffff
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov edi, 0x10
cmp dword [esi + 0x18], edi
jb 0x10004861
mov esi, dword [esi + 4]
jmp 0x10004864
add esi, 4
push 0
push 0x80
push 4
push 0
push 1
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
test eax, eax
mov dword [ebx], eax
je 0x10004a77
cmp byte [ebx + 0xbc], 0
je 0x100048c0
push 0
lea ecx, [ebp - 0x18]
push ecx
push 0x14
push str.P_A_as_yATe3havaxec
push eax
mov dword [ebp - 0x18], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100048c0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, ebx
mov byte [ebx + 8], 0
call fcn.10004c60
cmp dword [ebx], 0
je 0x10004a77
mov edi, dword [ebp + 0xc]
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x100048d1
push 0
push 0
sub eax, edx
add eax, 1
push eax
push edi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, eax
xor eax, eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
xor ecx, ecx
mov eax, esi
mov edx, 2
mul edx
seto cl
mov dword [ebp - 4], 1
neg ecx
or ecx, eax
push ecx
call fcn.1000e1d2
mov edi, eax
mov eax, dword [ebp + 0xc]
add esp, 4
mov dword [ebp - 0x18], edi
lea ecx, [eax + 1]
lea esp, [esp]
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x10004930
push esi
sub eax, ecx
push edi
add eax, 1
push eax
mov eax, dword [ebp + 0xc]
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0
push 0
push 0
push 0
push esi
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
push edi
call fcn.1000e1d2
mov ecx, dword [ebp - 0x18]
add esp, 4
push 0
push 0
push edi
push eax
push esi
push ecx
push 0
push 0
mov dword [ebp - 0x14], eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp byte [ebx + 0xbc], 0
mov edi, dword [ebp - 0x14]
je 0x1000499a
call fcn.10003800
mov dword [ebp - 4], 0xffffffff
jmp 0x10004a28
test edi, edi
mov dword [ebp - 0x1c], 0
je 0x10004a62
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x10004a38
sub eax, edx
push 0
lea edx, [ebp - 0x1c]
push edx
push eax
mov eax, dword [ebx]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10004a62
mov byte [ebx + 8], al
mov eax, ebx
call fcn.10004c60
mov ecx, dword [ebp - 0x18]
push ecx
call sub.MSVCR80.dll_void___cdecl_operator_delete___void__
add esp, 4
push edi
call sub.MSVCR80.dll_void___cdecl_operator_delete___void__
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8