Function at 0x402407
Capabilities:
Get common file path
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x340
mov eax, dword [0x41c050]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x340], eax
mov eax, dword [ebp + 0x10]
mov esi, edx
mov dword [ebp - 0x33c], eax
cmp edi, 2
jbe 0x40243f
mov eax, 0x419e74
jmp 0x402444
call fcn.00401302
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyA]
push eax
lea eax, [ebp - 0x228]
push eax
mov byte [ebp - 0x228], 0
call ebx
lea eax, [ebp - 0x228]
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402464
sub eax, edi
push 0x41a100
lea eax, [ebp + eax - 0x228]
push eax
call ebx
lea eax, [ebp - 0x228]
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402485
sub eax, edi
push esi
lea eax, [ebp + eax - 0x228]
push eax
call ebx
xor esi, esi
push esi
push 0x80
push 2
push esi
push 1
push 2
lea eax, [ebp - 0x228]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x334], eax
cmp eax, 0xffffffff
jne 0x402641
cmp dword [ebp - 0x33c], esi
je 0x402615
lea eax, [ebp - 0x330]
push eax
push 0x103
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea eax, [ebp - 0x120]
push eax
push esi
push esi
lea eax, [ebp - 0x330]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
je 0x40262a
mov esi, str..tmp
lea edi, [ebp - 0xc]
movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov esi, str..exe
lea edi, [ebp - 0x14]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x120]
movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
call esi
push eax
lea eax, [ebp - 0x120]
call fcn.004092a0
pop ecx
pop ecx
mov dword [ebp - 0x338], eax
test eax, eax
je 0x40256d
lea eax, [ebp - 0xc]
push eax
call esi
lea edi, [ebp - 0x120]
sub edi, dword [ebp - 0x338]
sub edi, eax
lea eax, [ebp - 0x120]
push eax
call esi
add eax, edi
jne 0x40256d
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x338]
mov dword [ecx], eax
jmp 0x4025a0
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x120]
push eax
call esi
mov ecx, 0x104
sub ecx, eax
push ecx
lea eax, [ebp - 0x120]
push eax
call esi
lea eax, [ebp + eax - 0x120]
push eax
call fcn.0040b337
add esp, 0xc
cmp eax, 4
jne 0x402613
push 0
push 0x80
push 2
push 0
push 1
push 2
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x334], eax
cmp eax, 0xffffffff
je 0x4025e0
lea eax, [ebp - 0x120]
push eax
call esi
inc eax
push eax
call fcn.0040a769
pop ecx
mov ecx, dword [ebp - 0x33c]
mov dword [ecx], eax
mov eax, dword [ebp - 0x33c]
mov eax, dword [eax]
test eax, eax
je 0x4025f6
lea ecx, [ebp - 0x120]
push ecx
push eax
call ebx
cmp dword [ebp - 0x334], 0xffffffff
jne 0x40263f
push 0
push str.err081
push str.gbot_v3
call fcn.004057a9
add esp, 0xc
xor esi, esi
push esi
push str.err080
push str.gbot_2
call fcn.004057a9
add esp, 0xc
jmp 0x402675
push esi
push str.err082
push str.gbot_v3
call fcn.004057a9
add esp, 0xc
jmp 0x402615
xor esi, esi
push esi
lea eax, [ebp - 0x338]
push eax
push dword [ebp + 0xc]
mov dword [ebp - 0x338], esi
push dword [ebp - 0x340]
push dword [ebp - 0x334]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [ebp - 0x338]
sub esi, dword [ebp + 0xc]
neg esi
sbb esi, esi
not esi
and esi, eax
cmp dword [ebp - 0x334], 0xffffffff
je 0x40268a
push dword [ebp - 0x334]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040a6e5
leave
ret