Function at 0x40ece5
Capabilities:
Get common file path
Query environment variable
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x242c
call fcn.00416fa0
mov eax, dword [0x418064]
xor eax, esp
mov dword [esp + 0x2428], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov esi, 0x400
mov dword [esp + 0x24], eax
push esi
lea eax, [esp + 0x1034]
mov dword [esp + 0x14], ecx
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [esp + 0x2030]
or ebx, 0xffffffff
mov dword [esp + 0xc], ebx
xor ebx, ebx
push esi
push ebx
push eax
call sub.msvcrt.dll_memset
mov dword [esp + 0xc38], ebx
mov edi, ebx
mov byte [esp + 0x34], bl
add esp, 0xc
mov byte [esp + 0xc2b], bl
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], ebx
mov ebx, dword [esp + 0x10]
mov ecx, dword [ebx + 0x40020]
test ecx, ecx
je 0x40f289
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40ed7b
sub ecx, edx
cmp ecx, esi
jae 0x40f289
mov eax, dword [ebx + 0x4001c]
test eax, eax
je 0x40f282
xor edi, edi
cmp dword [eax + 0x28e4], edi
je 0x40f282
lea eax, [esp + 0x2030]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
jne 0x40edc7
call fcn.00405fe6
mov esi, eax
jmp 0x40f2a6
lea eax, [esp + 0x1030]
push eax
push edi
push 0x40499c
lea eax, [esp + 0x203c]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
je 0x40edbb
push edi
push 0x80
push 2
push edi
push edi
push 0xc0000000
lea eax, [esp + 0x1048]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0xc], eax
cmp eax, 0xffffffff
je 0x40edbb
lea eax, [esp + 0x28]
push 0x4049a0
push eax
call fcn.004109f3
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x40f2a6
push dword [ebx + 0x40020]
lea eax, [esp + 0x2c]
push 0x4049b4
push eax
call fcn.004109f3
mov esi, eax
add esp, 0xc
test esi, esi
js 0x40f2a6
lea eax, [esp + 0x28]
push 0x4049c0
push eax
call fcn.004109f3
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x40f2a6
lea eax, [esp + 0x28]
push 0x4049dc
push eax
call fcn.004109f3
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x40f2a6
lea eax, [esp + 0x28]
push 0x4049f8
push eax
call fcn.004109f3
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x40f2a6
lea eax, [esp + 0x28]
push 0x404a1c
push eax
call fcn.004109f3
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x40f2a6
mov ecx, dword [ebx + 0x4001c]
mov eax, dword [ecx + 0x28e4]
cmp dword [eax + 0x804], edi
jbe 0x40ef1b
mov eax, dword [ecx + 0x28e4]
mov eax, dword [eax + edi*8 + 0x404]
test eax, eax
je 0x40f0df
cmp byte [eax], 0
je 0x40f0df
push eax
push eax
lea eax, [esp + 0x30]
push 0x404a30
push eax
call fcn.004109f3
mov esi, eax
add esp, 0x10
test esi, esi
js 0x40f2a6
mov ecx, dword [ebx + 0x4001c]
inc edi
mov eax, dword [ecx + 0x28e4]
cmp edi, dword [eax + 0x804]
jb 0x40eeca
mov esi, dword [esp + 0xc2c]
lea eax, [esp + 0x1c]
mov ebx, dword [esp + 0xc]
push 0
push eax
push esi
lea eax, [esp + 0x34]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40edbb
cmp dword [esp + 0x1c], esi
jne 0x40edbb
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or ebx, 0xffffffff
lea ecx, [esp + 0x1430]
mov dword [esp + 0xc], ebx
mov ebx, 0xc00
push 0x404a40
mov edx, ebx
call fcn.004060b1
mov esi, eax
test esi, esi
js 0x40f2a6
lea eax, [esp + 0x1030]
mov edx, ebx
push eax
lea ecx, [esp + 0x1434]
call fcn.0040b08d
mov esi, eax
test esi, esi
js 0x40f2a6
mov edi, dword [esp + 0x24]
lea eax, [esp + 0x1430]
push eax
push edi
call fcn.0040ec03
mov esi, eax
test esi, esi
js 0x40f2a6
push 0x404a50
mov edx, ebx
lea ecx, [esp + 0x1434]
call fcn.004060b1
mov esi, eax
test esi, esi
js 0x40f2a6
lea eax, [esp + 0x1430]
push eax
push edi
call fcn.0040ec03
mov esi, eax
test esi, esi
js 0x40f2a6
push 0x400
lea eax, [esp + 0xc34]
push eax
push 0x404a64
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov dword [esp + 0x1c], eax
dec eax
cmp eax, 0x3ff
ja 0x40f27b
push 0x404a70
mov edx, ebx
lea ecx, [esp + 0x1434]
call fcn.004060b1
mov esi, eax
test esi, esi
js 0x40f2a6
lea eax, [esp + 0xc30]
mov edx, ebx
push eax
lea ecx, [esp + 0x1434]
call fcn.0040b08d
mov esi, eax
test esi, esi
js 0x40f2a6
push 0x404a80
mov edx, ebx
lea ecx, [esp + 0x1434]
call fcn.0040b08d
mov esi, eax
test esi, esi
js 0x40f2a6
mov ebx, dword [esp + 0x10]
lea ecx, [esp + 0x1430]
mov edx, 0xc00
push dword [ebx + 0x40020]
call fcn.0040b08d
mov esi, eax
test esi, esi
js 0x40f2a6
lea eax, [esp + 0x1430]
push eax
push edi
call fcn.0040ec03
mov esi, eax
test esi, esi
js 0x40f2a6
lea ecx, [esp + 0xc30]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40f0b6
sub ecx, edx
shr ecx, 1
inc ecx
push ecx
mov dword [esp + 0x18], ecx
call fcn.0041630b
mov dword [esp + 0x1c], eax
pop ecx
test eax, eax
jne 0x40f0e9
mov esi, 0x8007000e
jmp 0x40f2a6
mov esi, 0x8007064a
jmp 0x40f2a6
push dword [esp + 0x14]
xor edi, edi
push edi
push dword [esp + 0x20]
call sub.msvcrt.dll_memset
lea edx, [esp + 0xc3c]
mov dword [esp + 0x2c], edi
add esp, 0xc
lea ecx, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x40f10a
sub edx, ecx
je 0x40f1c9
xor edi, edi
inc edi
mov bl, byte [esp + edi + 0xc2f]
xor ecx, ecx
lea eax, [ebx - 0x61]
cmp al, 5
ja 0x40f134
movsx ecx, bl
sub ecx, 0x57
jmp 0x40f150
lea eax, [ebx - 0x41]
cmp al, 5
ja 0x40f143
movsx ecx, bl
sub ecx, 0x37
jmp 0x40f150
lea eax, [ebx - 0x30]
cmp al, 9
ja 0x40f150
movsx ecx, bl
sub ecx, 0x30
shl ecx, 4
cmp edi, edx
jae 0x40f185
mov dl, byte [esp + edi + 0xc30]
lea eax, [edx - 0x61]
cmp al, 5
ja 0x40f16a
add ecx, 0xffffffa9
jmp 0x40f180
lea eax, [edx - 0x41]
cmp al, 5
ja 0x40f176
add ecx, 0xffffffc9
jmp 0x40f180
lea eax, [edx - 0x30]
cmp al, 9
ja 0x40f185
add ecx, 0xffffffd0
movsx eax, dl
add ecx, eax
mov ebx, dword [esp + 0x20]
mov edx, ebx
shr edx, 1
cmp dword [esp + 0x14], edx
jb 0x40f0d5
mov eax, dword [esp + 0x18]
add ebx, 2
mov dword [esp + 0x20], ebx
add edi, 2
mov byte [edx + eax], cl
lea edx, [esp + 0xc30]
lea ecx, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x40f1b2
sub edx, ecx
cmp ebx, edx
jb 0x40f11c
mov ebx, dword [esp + 0x10]
xor edi, edi
push 0x404ab0
push edi
call dword [sym.imp.CRYPT32.dll_CertOpenSystemStoreA]
test eax, eax
je 0x40edbb
push edi
lea ecx, [esp + 0x18]
push ecx
push 0x10000
push edi
push 0x10001
push eax
call dword [sym.imp.CRYPT32.dll_CertFindCertificateInStore]
mov edi, eax
test edi, edi
je 0x40f274
mov eax, dword [edi + 0xc]
test eax, eax
je 0x40f274
xor ecx, ecx
add ebx, 0x40028
push ebx
push ecx
push ecx
push ecx
push dword [eax + 0x44]
push dword [eax + 0x48]
push 0x13
push 0x10001
call dword [sym.imp.CRYPT32.dll_CryptDecodeObjectEx]
test eax, eax
jne 0x40f22e
call fcn.00405fe6
mov esi, eax
jmp 0x40f28e
cmp dword [ebx], 0
je 0x40f28e
push dword [ebx]
call fcn.0041630b
pop ecx
mov ecx, eax
mov eax, dword [esp + 0x10]
mov dword [eax + 0x40024], ecx
test ecx, ecx
jne 0x40f252
mov esi, 0x8007000e
jmp 0x40f28e
mov eax, dword [edi + 0xc]
push ebx
push ecx
push 0
push 0
push dword [eax + 0x44]
push dword [eax + 0x48]
push 0x13
push 0x10001
call dword [sym.imp.CRYPT32.dll_CryptDecodeObjectEx]
test eax, eax
jne 0x40f28e
jmp 0x40f225
mov esi, 0x80004005
jmp 0x40f28e
mov esi, 0x80004005
jmp 0x40f2a6
mov esi, 0x80004003
jmp 0x40f2a6
mov esi, 0x80070057
or ebx, 0xffffffff
mov dword [esp + 0xc], ebx
test edi, edi
je 0x40f2a6
push edi
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
or ebx, ebx
mov dword [esp + 0xc], ebx
push dword [esp + 0x18]
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete_void__]
mov eax, dword [esp + 0x10]
pop ecx
cmp eax, 0xffffffff
je 0x40f2c1
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jns 0x40f2d7
push esi
push 0x404ab4
push dword [esp + 0x2c]
call fcn.004109f3
add esp, 0xc
mov ecx, dword [esp + 0x2434]
mov eax, esi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00416650
mov esp, ebp
pop ebp
ret 4