Function at 0x40aa40
Capabilities:
Check if file exists
Get common file path
Get file attributes
Print debug messages
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x55aac2
mov eax, dword fs:[0]
push eax
sub esp, 0x31c
mov eax, dword [0x5a9840]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov eax, esi
cmp dword [esi + 0x14], 7
jbe 0x40aa7a
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40b31e
test al, 0x10
jne 0x40b31e
cmp dword [esi + 0x14], 7
jbe 0x40aa9a
mov esi, dword [esi]
push esi
call fcn.0040d530
push 0x208
mov dword [ebp - 0x328], eax
lea eax, [ebp - 0x238]
push 0
push eax
mov dword [ebp - 0x324], edx
call fcn.004f26e0
add esp, 0x10
lea eax, [ebp - 0x238]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
xorps xmm0, xmm0
mov dword [ebp - 0x270], 0
lea ecx, [ebp - 0x238]
mov dword [ebp - 0x26c], 0
movups xmmword [ebp - 0x280], xmm0
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40ab00
sub ecx, edx
lea eax, [ebp - 0x238]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x280]
call fcn.00407c40
push 1
push 0x565b28
lea ecx, [ebp - 0x280]
mov dword [ebp - 4], 0
call fcn.00410690
mov edx, dword [0x5ac4f4]
add edx, 0x14
mov ecx, edx
lea esi, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40ab50
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x280]
call fcn.00410690
cmp dword [ebp - 0x26c], 7
lea eax, [ebp - 0x280]
push 0
cmova eax, dword [ebp - 0x280]
push 0
push 3
push 0
push 1
push 0x120089
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40abb9
push 0
push 0
push 0x10
lea eax, [ebp - 0x20]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40abb9
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x18
call fcn.004ef1c0
mov edi, eax
mov dword [ebp - 0x320], eax
add esp, 4
test edi, edi
je 0x40abe8
xorps xmm0, xmm0
movups xmmword [edi], xmm0
mov dword [edi + 0x10], 0
mov dword [edi + 0x14], 0xf
mov byte [edi], 0
jmp 0x40abf0
xor edi, edi
mov dword [ebp - 0x320], edi
xor eax, eax
mov dword [ebp - 0x318], eax
lea esi, [eax + 9]
nop dword [eax + eax]
movzx ecx, byte [ebp + eax - 0x20]
mov edx, ecx
and ecx, 0xf
shr edx, 4
cmp esi, ecx
sbb al, al
and al, 7
add al, 0x30
add al, cl
cmp esi, edx
mov dword [ebp - 0x31c], eax
sbb al, al
add dl, 0x30
and al, 7
add al, dl
mov edx, dword [edi + 0x10]
mov byte [ebp - 0x301], al
mov dword [ebp - 0x30c], edx
cmp edx, 0x7fffffff
je 0x40b357
cmp dword [edi + 0x14], 0xf
mov dword [ebp - 0x314], edi
jbe 0x40ac57
mov eax, dword [edi]
mov dword [ebp - 0x314], eax
lea ecx, [edx + 1]
mov esi, 0xf
mov dword [ebp - 0x310], ecx
xorps xmm0, xmm0
lea eax, [ebp - 0x250]
mov dword [ebp - 0x308], eax
movups xmmword [ebp - 0x250], xmm0
cmp ecx, esi
jbe 0x40ace0
mov esi, ecx
or esi, 0xf
cmp esi, 0x7fffffff
jbe 0x40ac9e
mov eax, SysReAllocStringLen
mov esi, SysReAllocString
push eax
call fcn.00401570
jmp 0x40acc5
cmp esi, 0x16
mov eax, 0x16
cmovb esi, eax
lea eax, [esi + 1]
test eax, eax
je 0x40acd4
cmp eax, 0x1000
jb 0x40acbf
push eax
call fcn.00401570
jmp 0x40acc5
push eax
call fcn.004ef1c0
mov edx, dword [ebp - 0x30c]
add esp, 4
mov ecx, dword [ebp - 0x310]
mov dword [ebp - 0x308], eax
mov dword [ebp - 0x250], eax
push edx
push dword [ebp - 0x314]
mov dword [ebp - 0x240], ecx
push eax
mov dword [ebp - 0x23c], esi
call fcn.004f1be0
mov eax, dword [ebp - 0x308]
add esp, 0xc
mov edx, dword [ebp - 0x30c]
mov cl, byte [ebp - 0x301]
mov byte [eax + edx], cl
mov byte [eax + edx + 1], 0
push dword [ebp - 0x31c]
lea ecx, [ebp - 0x250]
mov byte [ebp - 4], 1
call fcn.004148a0
lea eax, [ebp - 0x2e8]
cmp edi, eax
je 0x40ad55
mov ecx, edi
call fcn.00410440
movups xmm0, xmmword [ebp - 0x250]
movups xmmword [edi], xmm0
movq xmm0, qword [ebp - 0x240]
movq qword [edi + 0x10], xmm0
jmp 0x40ad8f
mov ecx, dword [ebp - 0x23c]
cmp ecx, 0xf
jbe 0x40ad8f
mov edx, dword [ebp - 0x250]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40ad85
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40b352
push ecx
push edx
call fcn.004ef1f0
add esp, 8
mov eax, dword [ebp - 0x318]
mov esi, 9
inc eax
mov byte [ebp - 4], 0
mov dword [ebp - 0x318], eax
cmp eax, 0x10
jb 0x40ac00
cmp dword [ebp - 0x26c], 7
lea eax, [ebp - 0x280]
push 0
cmova eax, dword [ebp - 0x280]
push 0
push 3
push 0
push 1
push 0x120089
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40ae0a
push 2
push 0
push 0xffffffffffffffff
push 0xfffffffffffffff0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
push 0
push 0x10
lea eax, [ebp - 0x30]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40ae0a
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x18
call fcn.004ef1c0
mov esi, eax
add esp, 4
test esi, esi
je 0x40ae33
xorps xmm0, xmm0
movups xmmword [esi], xmm0
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 0xf
mov byte [esi], 0
jmp 0x40ae35
xor esi, esi
xor eax, eax
mov dword [ebp - 0x310], eax
nop dword [eax]
movzx ecx, byte [ebp + eax - 0x30]
mov edi, 9
mov edx, ecx
and ecx, 0xf
shr edx, 4
cmp edi, ecx
sbb al, al
and al, 7
add al, 0x30
add al, cl
cmp edi, edx
mov dword [ebp - 0x31c], eax
sbb al, al
add dl, 0x30
and al, 7
add al, dl
mov edx, dword [esi + 0x10]
mov byte [ebp - 0x301], al
mov dword [ebp - 0x30c], edx
cmp edx, 0x7fffffff
je 0x40b357
cmp dword [esi + 0x14], 0xf
mov dword [ebp - 0x314], esi
jbe 0x40ae9c
mov eax, dword [esi]
mov dword [ebp - 0x314], eax
lea ecx, [edx + 1]
mov edi, 0xf
mov dword [ebp - 0x318], ecx
xorps xmm0, xmm0
lea eax, [ebp - 0x250]
mov dword [ebp - 0x308], eax
movups xmmword [ebp - 0x250], xmm0
cmp ecx, edi
jbe 0x40af25
mov edi, ecx
or edi, 0xf
cmp edi, 0x7fffffff
jbe 0x40aee3
mov eax, SysReAllocStringLen
mov edi, SysReAllocString
push eax
call fcn.00401570
jmp 0x40af0a
cmp edi, 0x16
mov eax, 0x16
cmovb edi, eax
lea eax, [edi + 1]
test eax, eax
je 0x40af19
cmp eax, 0x1000
jb 0x40af04
push eax
call fcn.00401570
jmp 0x40af0a
push eax
call fcn.004ef1c0
mov edx, dword [ebp - 0x30c]
add esp, 4
mov ecx, dword [ebp - 0x318]
mov dword [ebp - 0x308], eax
mov dword [ebp - 0x250], eax
push edx
push dword [ebp - 0x314]
mov dword [ebp - 0x240], ecx
push eax
mov dword [ebp - 0x23c], edi
call fcn.004f1be0
mov eax, dword [ebp - 0x308]
add esp, 0xc
mov edx, dword [ebp - 0x30c]
mov cl, byte [ebp - 0x301]
mov byte [eax + edx], cl
mov byte [eax + edx + 1], 0
push dword [ebp - 0x31c]
lea ecx, [ebp - 0x250]
mov byte [ebp - 4], 2
call fcn.004148a0
lea eax, [ebp - 0x300]
cmp esi, eax
je 0x40af9a
mov ecx, esi
call fcn.00410440
movups xmm0, xmmword [ebp - 0x250]
movups xmmword [esi], xmm0
movq xmm0, qword [ebp - 0x240]
movq qword [esi + 0x10], xmm0
jmp 0x40afd4
mov ecx, dword [ebp - 0x23c]
cmp ecx, 0xf
jbe 0x40afd4
mov edx, dword [ebp - 0x250]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40afca
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40b352
push ecx
push edx
call fcn.004ef1f0
add esp, 8
mov eax, dword [ebp - 0x310]
inc eax
mov byte [ebp - 4], 0
mov dword [ebp - 0x310], eax
cmp eax, 0x10
jb 0x40ae40
mov eax, dword [0x5ac4f4]
mov ecx, dword [ebp - 0x328]
cmp ecx, dword [eax + 8]
jne 0x40b2dc
mov ecx, dword [ebp - 0x324]
cmp ecx, dword [eax + 0xc]
jne 0x40b2dc
lea edx, [eax + 0x2dc]
mov dword [ebp - 0x240], 0
mov ecx, edx
mov dword [ebp - 0x23c], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0x250], xmm0
lea edi, [ecx + 2]
nop word [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40b040
sub ecx, edi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x250]
call fcn.00407c40
lea ecx, [ebp - 0x2d0]
mov byte [ebp - 4], 3
call fcn.004094a0
cmp dword [ebp - 0x23c], 7
lea ecx, [ebp - 0x250]
mov eax, dword [ebp - 0x240]
cmova ecx, dword [ebp - 0x250]
mov byte [ebp - 4], 4
lea eax, [ecx + eax*2]
push eax
push ecx
lea eax, [ebp - 0x268]
push eax
lea ecx, [ebp - 0x2d0]
call fcn.004153c0
lea ecx, [ebp - 0x2d0]
mov byte [ebp - 4], 3
call fcn.00409ce0
cmp dword [ebp - 0x254], 0xf
lea ecx, [ebp - 0x268]
mov eax, dword [ebp - 0x320]
cmova ecx, dword [ebp - 0x268]
cmp dword [eax + 0x14], 0xf
jbe 0x40b0d1
mov eax, dword [eax]
push 0x20
push eax
push ecx
call fcn.0051a1a0
mov ecx, dword [ebp - 0x254]
add esp, 0xc
mov edi, eax
cmp ecx, 0xf
jbe 0x40b119
mov edx, dword [ebp - 0x268]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b10f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40b348
push ecx
push edx
call fcn.004ef1f0
add esp, 8
mov ecx, dword [ebp - 0x23c]
mov dword [ebp - 0x258], 0
mov dword [ebp - 0x254], 0xf
mov byte [ebp - 0x268], 0
mov byte [ebp - 4], 0
cmp ecx, 7
jbe 0x40b178
mov edx, dword [ebp - 0x250]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40b16e
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40b348
push ecx
push edx
call fcn.004ef1f0
add esp, 8
test edi, edi
jne 0x40b2dc
mov edx, dword [0x5ac4f4]
xorps xmm0, xmm0
add edx, 0x31c
mov dword [ebp - 0x240], edi
mov ecx, edx
mov dword [ebp - 0x23c], edi
movups xmmword [ebp - 0x250], xmm0
lea edi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40b1a7
sub ecx, edi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x250]
call fcn.00407c40
lea ecx, [ebp - 0x2d0]
mov byte [ebp - 4], 5
call fcn.004094a0
cmp dword [ebp - 0x23c], 7
lea ecx, [ebp - 0x250]
mov eax, dword [ebp - 0x240]
cmova ecx, dword [ebp - 0x250]
mov byte [ebp - 4], 6
lea eax, [ecx + eax*2]
push eax
push ecx
lea eax, [ebp - 0x268]
push eax
lea ecx, [ebp - 0x2d0]
call fcn.004153c0
lea ecx, [ebp - 0x2d0]
call fcn.00409ce0
cmp dword [esi + 0x14], 0xf
jbe 0x40b21a
mov esi, dword [esi]
cmp dword [ebp - 0x254], 0xf
lea eax, [ebp - 0x268]
push 0x20
cmova eax, dword [ebp - 0x268]
push esi
push eax
call fcn.0051a1a0
mov ecx, dword [ebp - 0x254]
add esp, 0xc
mov esi, eax
cmp ecx, 0xf
jbe 0x40b276
mov edx, dword [ebp - 0x268]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b26c
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40b34d
push ecx
push edx
call fcn.004ef1f0
add esp, 8
mov ecx, dword [ebp - 0x23c]
mov dword [ebp - 0x258], 0
mov dword [ebp - 0x254], 0xf
mov byte [ebp - 0x268], 0
cmp ecx, 7
jbe 0x40b2d1
mov edx, dword [ebp - 0x250]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40b2c7
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40b34d
push ecx
push edx
call fcn.004ef1f0
add esp, 8
test esi, esi
jne 0x40b2dc
mov esi, 1
jmp 0x40b2de
xor esi, esi
mov ecx, dword [ebp - 0x26c]
cmp ecx, 7
jbe 0x40b31a
mov edx, dword [ebp - 0x280]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40b310
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40b352
push ecx
push edx
call fcn.004ef1f0
add esp, 8
mov eax, esi
jmp 0x40b32b
push str._XIMAO__CheckClient_Not_ExistFile_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004ef253
mov esp, ebp
pop ebp
ret 4
call fcn.004ff818
call fcn.004ff818
call fcn.004ff818
call fcn.00406700
int3