Function at 0x403df0
Capabilities:
Check if file exists
Get common file path
Get file attributes
Read file on windows

Disassembly:
sub esp, 0x498
push ebx
push esi
push edi
xor ebx, ebx
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x199]
mov byte [esp + 0x198], bl
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x4a8]
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x198]
push eax
push ecx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
test eax, eax
je 0x404029
lea edx, [esp + 0x198]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x403e4b
mov eax, 0x80
push ebx
push eax
push 3
push ebx
push 1
lea eax, [esp + 0x1ac]
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x404029
xor ecx, ecx
xor eax, eax
mov dword [esp + 0x14], ecx
lea edi, [esp + 0x4c]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x1c], ecx
mov ecx, 0x12
mov dword [esp + 0x48], ebx
lea edx, [esp + 0xc]
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
push edx
lea eax, [esp + 0x18]
push 0x10
push eax
push esi
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
call edi
lea ecx, [esp + 0xc]
push ebx
push ecx
lea edx, [esp + 0x4c]
push 0x50
push edx
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x10], 0x93f8dcac
jne 0x404029
cmp dword [esp + 0x14], 0xbcfec3dc
jne 0x404029
mov ecx, 8
xor eax, eax
lea edi, [esp + 0x24]
mov dword [esp + 0x20], ebx
rep stosd dword es:[edi], eax
mov ecx, 0x40
lea edi, [esp + 0x95]
mov byte [esp + 0x94], bl
mov byte [esp + 0x3a0], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x3a1]
mov byte [esp + 0x29c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x29d]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x58]
cmp eax, ebx
jbe 0x403f55
cmp eax, 0x3b9cdd65
je 0x403f55
dec eax
mov dword [esp + 0x58], eax
lea ecx, [esp + 0x29c]
push 0xa
push ecx
push eax
call dword [sym.imp.MSVCRT.dll__itoa]
mov edx, dword [esp + 0x94]
lea eax, [esp + 0x3ac]
push edx
push 0x409188
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x18
lea ecx, [esp + 0x94]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov edi, str.kz.21ec2020_3aea_1069_a2dd_08002b30309d_batexp.ini
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x94]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x20]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x98]
push ecx
call fcn.00404ed0
lea edx, [esp + 0x28]
lea eax, [esp + 0x2a4]
push edx
lea ecx, [esp + 0x3ac]
push eax
push ecx
push str.File_Open_Count
call fcn.00404c40
lea edx, [esp + 0x38]
lea eax, [esp + 0xac]
push edx
push eax
call fcn.00405070
lea ecx, [esp + 0x40]
push ecx
call fcn.004051f0
add esp, 0x24
mov eax, 1
pop edi
pop esi
pop ebx
add esp, 0x498
ret 4
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x498
ret 4