Function at 0x40a050
Capabilities:
Delete file
Get common file path
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xca4
push ebx
push esi
push edi
push 0x640
lea eax, [ebp - 0x660]
mov ebx, ecx
push 0
push eax
mov dword [ebp - 0x18], ebx
mov dword [ebp - 4], 0
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0xca0]
push 0x640
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0xca0]
push eax
push 0x320
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x660]
push eax
push 0
push 0x40bf90
lea eax, [ebp - 0xca0]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea esi, [ebp - 0x660]
lea ecx, [esi + 2]
lea ebx, [ebx]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40a0d0
sub esi, ecx
sar esi, 1
lea eax, [esi + 1]
push eax
push 8
push dword [0x40df70]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0
push 0
push esi
mov edi, eax
push edi
push 0xffffffffffffffff
lea eax, [ebp - 0x660]
push eax
push 0x200
push 0
mov dword [ebp - 0x10], edi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov byte [esi + edi], 0
mov esi, ebx
lea ecx, [esi + 2]
jmp 0x40a120
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40a120
sub esi, ecx
sar esi, 1
lea eax, [esi + 1]
push eax
push 8
push dword [0x40df70]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0
push 0
push esi
mov edi, eax
push edi
push 0xffffffffffffffff
push ebx
push 0x200
push 0
mov dword [ebp - 0x14], edi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0x40bf98
push dword [ebp - 0x10]
mov byte [esi + edi], 0
mov esi, dword [sym.imp.msvcrt.dll_fopen]
call esi
mov ebx, eax
push 0x40bf9c
push edi
mov dword [ebp - 0xc], ebx
call esi
add esp, 0x10
mov esi, eax
test ebx, ebx
je 0x40a35c
test esi, esi
je 0x40a35c
sub esp, 0xc
mov edx, ebx
lea ecx, [ebp - 4]
call fcn.004031b0
cmp dword [ebp - 4], 0
mov dword [ebp - 8], eax
je 0x40a1f0
push ecx
push 0
push ecx
push 0
push ecx
mov edx, eax
lea ecx, [ebp - 4]
call fcn.00403490
push esi
mov esi, dword [sym.imp.msvcrt.dll_fclose]
call esi
add esp, 4
push ebx
call esi
add esp, 4
lea eax, [ebp - 0x660]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x40a35c
lea ecx, [ebp - 0x660]
call fcn.0040a390
jmp 0x40a35c
push 2
push 0
push esi
call dword [sym.imp.msvcrt.dll_fseek]
add esp, 0xc
push esi
call dword [sym.imp.msvcrt.dll_ftell]
add esp, 4
mov ebx, eax
push esi
call dword [sym.imp.msvcrt.dll_rewind]
add esp, 4
push ebx
push 8
push dword [0x40df70]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
jne 0x40a24e
lea ebx, [eax + 0xd]
push ebx
push 8
push dword [0x40df70]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
push str.Mem_alloc_err
push edi
call dword [sym.imp.msvcrt.dll_sprintf]
add esp, 8
jmp 0x40a25c
push esi
push 1
push ebx
push edi
call dword [sym.imp.msvcrt.dll_fread]
add esp, 0x10
mov edx, dword [ebp - 8]
push ebx
push edi
lea ecx, [ebp - 4]
call fcn.004032c0
cmp dword [ebp - 4], 0xfffffffa
mov ebx, dword [sym.imp.msvcrt.dll_fclose]
jne 0x40a2b1
mov edx, dword [ebp - 8]
push ecx
push 0
push ecx
push 0
push ecx
lea ecx, [ebp - 4]
call fcn.00403490
push esi
call ebx
add esp, 4
push dword [ebp - 0xc]
call ebx
add esp, 4
lea eax, [ebp - 0x660]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x40a2b1
lea ecx, [ebp - 0x660]
call fcn.0040a390
test edi, edi
je 0x40a2c5
mov eax, dword [sym.imp.KERNEL32.dll_HeapFree]
push edi
push 0
push dword [0x40df70]
call eax
mov edx, dword [ebp - 8]
push ecx
lea eax, [ebp - 0x1c]
push eax
push ecx
lea eax, [ebp - 0x20]
push eax
push ecx
lea ecx, [ebp - 4]
call fcn.00403490
cmp dword [ebp - 4], 0xfffffffa
jne 0x40a30b
push esi
call ebx
add esp, 4
push dword [ebp - 0xc]
call ebx
add esp, 4
lea eax, [ebp - 0x660]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x40a30b
lea ecx, [ebp - 0x660]
call fcn.0040a390
push esi
call ebx
add esp, 4
push dword [ebp - 0xc]
call ebx
mov esi, dword [ebp - 0x18]
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteFileW]
add esp, 4
push esi
call ebx
test eax, eax
jne 0x40a330
mov ecx, esi
call fcn.0040a390
push ecx
mov edx, esi
lea ecx, [ebp - 0x660]
call fcn.0040a430
add esp, 4
lea eax, [ebp - 0x660]
push eax
call ebx
test eax, eax
jne 0x40a359
lea ecx, [ebp - 0x660]
call fcn.0040a390
mov edi, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x40a372
push eax
push 0
push dword [0x40df70]
call dword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x40a386
mov eax, dword [sym.imp.KERNEL32.dll_HeapFree]
push edi
push 0
push dword [0x40df70]
call eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret