Function at 0x1003ead
Capabilities:
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x588
push ebx
xor ebx, ebx
cmp dword [ebp + 8], ebx
push esi
push edi
mov dword [ebp - 8], 0x80004005
je 0x10041be
mov esi, dword [ebp + 0xc]
cmp esi, ebx
jle 0x10041be
mov edi, 0x104
push 0x1008518
lea eax, [ebp - 0x588]
push edi
push eax
push 0x1001638
push 0x1001618
call fcn.0100243e
test eax, eax
jbe 0x10041c5
lea eax, [ebp - 0x380]
push edi
push eax
lea eax, [ebp - 0x588]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0x380]
push edi
push eax
call fcn.010038d9
lea eax, [ebp - 0x380]
push 7
push eax
push 0x10019bc
lea edi, [ebp - 0x380]
call dword [sym.imp.SHLWAPI.dll_StrCmpNIW]
test eax, eax
jne 0x1003f45
lea edi, [ebp - 0x372]
push edi
push 0x1008308
push edi
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
je 0x10041c5
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [ebp - 4]
push ebx
push ecx
lea ecx, [ebp - 0x16]
push 2
push ecx
push eax
mov dword [ebp - 4], ebx
call edi
test eax, eax
je 0x10041b3
cmp dword [ebp - 4], 2
jne 0x10041b3
cmp word [ebp - 0x16], 0xfeff
mov dword [ebp - 0x1c], ebx
jne 0x10040b1
lea eax, [esi + esi - 2]
mov dword [ebp - 0x10], eax
add eax, 2
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x14], esi
je 0x10040d6
lea eax, [ebp - 4]
push ebx
push eax
lea eax, [ebp - 0x178]
push 0xa4
push eax
push dword [ebp - 0xc]
call edi
test eax, eax
je 0x1004039
cmp dword [ebp - 4], 0xa4
jne 0x1004039
lea eax, [ebp - 0xd0]
push 0x53
push eax
push 0x1001468
mov word [ebp - 0xd4], bx
call dword [sym.imp.SHLWAPI.dll_SHUnicodeToUnicode]
lea eax, [ebp - 0xd0]
push eax
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.SHLWAPI.dll_StrCmpIW]
test eax, eax
je 0x1004032
push ebx
push ebx
push 2
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x1004039
mov dword [ebp - 0x1c], 1
lea eax, [ebp - 4]
push ebx
push eax
push dword [ebp - 0x10]
push esi
push dword [ebp - 0xc]
call edi
test eax, eax
je 0x10041ac
mov edi, dword [ebp - 4]
shr edi, 1
cmp dword [ebp - 0x1c], ebx
je 0x100409b
mov word [esi + edi*2], bx
lea eax, [ebp - 0x28]
push 8
mov esi, 0x1001510
push eax
push esi
call dword [sym.imp.SHLWAPI.dll_SHUnicodeToUnicode]
lea eax, [ebp - 0x28]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, edi
sub ecx, eax
mov eax, dword [ebp - 0x14]
lea eax, [eax + ecx*2]
push eax
call dword [sym.imp.SHLWAPI.dll_StrCmpIW]
test eax, eax
jne 0x1004098
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
sub edi, eax
mov esi, dword [ebp - 0x14]
push dword [ebp + 0xc]
mov word [esi + edi*2], bx
push dword [ebp + 8]
push esi
call dword [sym.imp.SHLWAPI.dll_SHUnicodeToUnicode]
jmp 0x10041a9
push ebx
push ebx
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esi - 1]
mov dword [ebp - 0x10], eax
inc eax
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x14], esi
jne 0x10040e2
mov dword [ebp - 8], 0x8007000e
jmp 0x10041b3
lea eax, [ebp - 4]
push ebx
push eax
lea eax, [ebp - 0x7c]
push 0x52
push eax
push dword [ebp - 0xc]
call edi
test eax, eax
je 0x100413d
cmp dword [ebp - 4], 0x52
jne 0x100413d
lea eax, [ebp - 0x124]
push 0x53
push eax
push 0x1001468
mov byte [ebp - 0x2a], bl
call dword [sym.imp.SHLWAPI.dll_SHUnicodeToAnsi]
lea eax, [ebp - 0x124]
push eax
lea eax, [ebp - 0x7c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x1004136
push ebx
push ebx
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x100413d
mov dword [ebp - 0x1c], 1
lea eax, [ebp - 4]
push ebx
push eax
push dword [ebp - 0x10]
push esi
push dword [ebp - 0xc]
call edi
test eax, eax
je 0x10041ac
mov eax, dword [ebp - 4]
cmp dword [ebp - 0x1c], ebx
mov dword [ebp - 0x10], eax
je 0x1004196
lea edi, [esi + eax]
lea eax, [ebp - 0x20]
push 8
mov esi, 0x1001510
push eax
push esi
mov byte [edi], bl
call dword [sym.imp.SHLWAPI.dll_SHUnicodeToAnsi]
lea eax, [ebp - 0x20]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
sub edi, eax
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x1004193
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
sub dword [ebp - 0x10], eax
mov esi, dword [ebp - 0x14]
push dword [ebp + 0xc]
mov eax, dword [ebp - 0x10]
push dword [ebp + 8]
mov byte [eax + esi], bl
push esi
call dword [sym.imp.SHLWAPI.dll_SHAnsiToUnicode]
mov dword [ebp - 8], ebx
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x10041c5
mov dword [ebp - 8], 0x80070057
cmp dword [ebp - 8], ebx
jge 0x10041dc
cmp dword [ebp - 8], 0x80070057
je 0x10041dc
mov eax, dword [ebp + 8]
mov dword [ebp - 8], ebx
mov word [eax], bx
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret 8