Function at 0x402490
Capabilities:
Check mutex on windows
Get common file path
Print debug messages
Write file on windows

Disassembly:
mov eax, 0x131c
call fcn.004059a0
mov eax, dword [esp + 0x1320]
push ebx
xor ebx, ebx
cmp eax, ebx
je 0x4027f4
push ebp
push esi
push edi
push str.ZHANGBO_CLIENTLOGERROR_MUTEX_FD3AF828_2B27_4f12_BA74_771649126929
push ebx
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
push 0xffffffffffffffff
push eax
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x125]
mov byte [esp + 0x124], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 5
mov esi, str.ClientLogError.txt
lea edi, [esp + 0x20]
xor eax, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x3c
lea edi, [esp + 0x34]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x124]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x4026e9
lea edi, [esp + 0x20]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x124]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push ebx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push 0x80
mov ecx, ebp
push 4
push ebx
and ecx, 3
push 3
lea eax, [esp + 0x138]
push 0x40000000
rep movsb byte es:[edi], byte [esi]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x40279f
cmp ebp, ebx
je 0x40279f
push 2
push ebx
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x402720
lea ecx, [esp + 0x18]
push ecx
call fcn.004058c0
lea edx, [esp + 0x1c]
push edx
call fcn.00405760
mov edx, eax
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x231]
mov byte [esp + 0x230], bl
add esp, 8
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [edx]
mov ecx, dword [edx + 4]
push eax
mov eax, dword [edx + 8]
push ecx
mov ecx, dword [edx + 0xc]
push eax
mov eax, dword [edx + 0x10]
push ecx
mov ecx, dword [edx + 0x14]
inc eax
add ecx, 0x76c
push eax
push ecx
lea edx, [esp + 0x240]
push str._d__.2d__.2d__.2d:_.2d:_.2d
push edx
call fcn.0040570e
mov ecx, 0x1ff
xor eax, eax
lea edi, [esp + 0xb4d]
mov byte [esp + 0xb4c], bl
rep stosd dword es:[edi], eax
mov edx, dword [esp + 0x1350]
or ecx, 0xffffffff
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, edx
xor eax, eax
add esp, 0x20
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 0x79c
jle 0x402647
push 0x79c
lea eax, [esp + 0xb30]
push edx
push eax
call fcn.00405610
add esp, 0xc
jmp 0x40266f
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
lea esi, [esp + 0xb2c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, esi
mov edx, ecx
mov esi, edi
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x1ff
xor eax, eax
lea edi, [esp + 0x32d]
mov byte [esp + 0x32c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0xb2c]
lea edx, [esp + 0x228]
stosb byte es:[edi], al
push ecx
push edx
lea eax, [esp + 0x334]
push str.0x19811217_t_s_tInfo:_s_r_n
push eax
call fcn.0040570e
add esp, 0x10
lea ecx, [esp + 0x10]
lea edi, [esp + 0x32c]
xor eax, eax
push ebx
push ecx
or ecx, 0xffffffff
lea edx, [esp + 0x334]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x18], ebx
push ecx
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40275c
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4027df
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x21]
mov byte [esp + 0x20], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x24]
push str._nzhangbo_____GetSystemDirectory
push eax
call fcn.0040570e
add esp, 0xc
lea ecx, [esp + 0x20]
push ecx
jmp 0x4027d9
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x21]
mov byte [esp + 0x20], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0x124]
push eax
push edx
lea eax, [esp + 0x28]
push str._nzhangbo_____SetFilePointer__s_
push eax
call fcn.0040570e
add esp, 0x10
lea ecx, [esp + 0x20]
push ecx
jmp 0x4027d9
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x21]
mov byte [esp + 0x20], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea edx, [esp + 0x32c]
push edx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x12c]
push eax
lea ecx, [esp + 0x2c]
push str._nzhangbo_____WriteFile__s_
push ecx
call fcn.0040570e
add esp, 0x14
lea edx, [esp + 0x20]
jmp 0x4027d8
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x21]
mov byte [esp + 0x20], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x128]
push eax
lea ecx, [esp + 0x28]
push str._nzhangbo_____CreateFile__s_
push ecx
call fcn.0040570e
add esp, 0x10
lea edx, [esp + 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov esi, dword [esp + 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x131c
ret