Function at 0x10038e90
Capabilities:
Check if file exists
Query environment variable
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100bd777
mov eax, dword fs:[0]
push eax
sub esp, 0x1a0
mov eax, dword [0x100e70dc]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
push 0x104
mov dword [ebp - 0x164], eax
lea eax, [ebp - 0x114]
push 0
push eax
call fcn.100953e0
add esp, 0xc
cmp dword [esi + 0x14], 0x10
jb 0x10038eeb
mov esi, dword [esi]
push 0x104
lea eax, [ebp - 0x114]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea eax, [ebp - 0x114]
mov bl, 1
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x1003900a
lea edx, [ebp - 0x114]
lea ecx, [ebp - 0x194]
call fcn.10035cc0
mov edx, eax
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x17c]
call fcn.10036260
mov byte [ebp - 4], bl
cmp dword [eax + 0x14], 8
jb 0x10038f45
mov eax, dword [eax]
mov edx, eax
lea ecx, [ebp - 0x15c]
call fcn.10035b10
mov eax, dword [ebp - 0x168]
cmp eax, 8
jb 0x10038f70
inc eax
lea ecx, [ebp - 0x17c]
push eax
push dword [ebp - 0x17c]
call fcn.10004440
xor eax, eax
mov dword [ebp - 4], 0xffffffff
mov word [ebp - 0x17c], ax
mov eax, dword [ebp - 0x180]
mov dword [ebp - 0x168], 7
mov dword [ebp - 0x16c], 0
cmp eax, 8
jb 0x10038fb2
inc eax
lea ecx, [ebp - 0x194]
push eax
push dword [ebp - 0x194]
call fcn.10004440
cmp dword [ebp - 0x148], 0x10
lea eax, [ebp - 0x15c]
cmovae eax, dword [ebp - 0x15c]
cmp dword [edi + 0x14], 0x10
jb 0x10038fd0
mov ecx, dword [edi]
jmp 0x10038fd2
mov ecx, edi
push eax
push ecx
call dword [sym.imp.SHLWAPI.dll_StrStrIA]
xor ecx, ecx
movzx ebx, bl
test eax, eax
mov eax, dword [ebp - 0x148]
cmovne ebx, ecx
cmp eax, 0x10
jb 0x10039002
inc eax
lea ecx, [ebp - 0x15c]
push eax
push dword [ebp - 0x15c]
call fcn.10003a90
test bl, bl
je 0x10039215
mov dword [ebp - 0x130], 0xf
mov dword [ebp - 0x134], 0
mov byte [ebp - 0x144], 0
mov dword [ebp - 4], 2
xor esi, esi
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x164]
lea edx, [ebp - 0x144]
call fcn.1003a140
test al, al
jne 0x10039094
push 0xbb8
call ebx
inc esi
cmp esi, 3
jl 0x10039034
mov eax, dword [ebp - 0x130]
cmp eax, 0x10
jb 0x10039074
inc eax
lea ecx, [ebp - 0x144]
push eax
push dword [ebp - 0x144]
call fcn.10003a90
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.1007bf25
mov esp, ebp
pop ebp
ret 0xc
cmp esi, 3
jge 0x10039056
push dword [ebp - 0x134]
lea ecx, [ebp - 0x144]
push 0
call fcn.100164a0
mov edx, eax
lea ecx, [ebp - 0x12c]
call fcn.10036320
add esp, 4
mov byte [ebp - 4], 3
lea eax, [ebp - 0x12c]
cmp dword [ebp - 0x118], 0x10
cmovae eax, dword [ebp - 0x12c]
cmp dword [edi + 0x14], 0x10
jb 0x100390dc
mov edi, dword [edi]
push eax
push edi
call dword [sym.imp.SHLWAPI.dll_StrStrIA]
test eax, eax
jne 0x10039126
mov eax, dword [ebp - 0x118]
cmp eax, 0x10
jb 0x10039106
inc eax
lea ecx, [ebp - 0x12c]
push eax
push dword [ebp - 0x12c]
call fcn.10003a90
mov dword [ebp - 0x118], 0xf
mov dword [ebp - 0x11c], 0
mov byte [ebp - 0x12c], 0
jmp 0x10039056
lea edx, [ebp - 0x114]
lea ecx, [ebp - 0x1ac]
call fcn.10035cc0
mov byte [ebp - 4], 4
cmp dword [eax + 0x14], 8
jb 0x10039143
mov eax, dword [eax]
push eax
call fcn.10038af0
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x198]
cmp eax, 8
jb 0x1003916b
inc eax
lea ecx, [ebp - 0x1ac]
push eax
push dword [ebp - 0x1ac]
call fcn.10004440
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp dword [ebp - 0x130], 0x10
lea ecx, [ebp - 0x144]
push 0
cmovae ecx, dword [ebp - 0x144]
mov esi, eax
lea eax, [ebp - 0x160]
push eax
push dword [ebp - 0x134]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x118]
cmp eax, 0x10
jb 0x100391dc
inc eax
lea ecx, [ebp - 0x12c]
push eax
push dword [ebp - 0x12c]
call fcn.10003a90
mov eax, dword [ebp - 0x130]
mov dword [ebp - 0x118], 0xf
mov dword [ebp - 0x11c], 0
mov byte [ebp - 0x12c], 0
cmp eax, 0x10
jb 0x10039215
inc eax
lea ecx, [ebp - 0x144]
push eax
push dword [ebp - 0x144]
call fcn.10003a90
mov al, 1
jmp 0x10039076