Function at 0x50028e7
Capabilities:
Parse pe header
Query environment variable
Read file on windows
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x114
push ebx
xor ebx, ebx
push ebx
push 0x10000000
push 3
push ebx
push 3
push 0x80000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
je 0x5002bfe
push edi
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
lea ecx, [ebp + 8]
push ebx
push ecx
mov esi, 0xf8
lea ecx, [ebp - 0x114]
push esi
push ecx
push eax
call edi
test eax, eax
je 0x5002bf3
cmp dword [ebp + 8], esi
jne 0x5002bf3
cmp word [ebp - 0x114], 0x5a4d
jne 0x5002991
push ebx
push ebx
push dword [ebp - 0xd8]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, dword [ebp - 0xd8]
jne 0x5002bf3
lea eax, [ebp + 8]
push ebx
push eax
lea eax, [ebp - 0x114]
push esi
push eax
push dword [ebp - 0xc]
call edi
test eax, eax
je 0x5002bf3
cmp dword [ebp + 8], esi
jne 0x5002bf3
cmp dword [ebp - 0x114], 0x4550
jne 0x5002bf3
cmp word [ebp - 0x100], 0xe0
jb 0x5002bf3
cmp dword [ebp - 0x7c], ebx
je 0x5002bf3
cmp dword [ebp - 0x78], ebx
je 0x5002bf3
cmp dword [ebp - 0x78], 0x40000
ja 0x5002bf3
push dword [ebp - 0x78]
push 8
push dword [0x5017384]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x10], esi
je 0x5002bf3
push ebx
push ebx
push dword [ebp - 0x7c]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, dword [ebp - 0x7c]
jne 0x5002bf3
lea eax, [ebp + 8]
push ebx
push eax
push dword [ebp - 0x78]
push esi
push dword [ebp - 0xc]
call edi
test eax, eax
je 0x5002bf3
mov ecx, dword [ebp - 0x78]
cmp dword [ebp + 8], ecx
jne 0x5002bf3
mov eax, esi
cmp ecx, 0x16
mov dword [ebp - 8], eax
mov dword [ebp - 4], ecx
jb 0x5002bf3
mov cl, byte [eax]
cmp cl, byte [0x5001140]
jne 0x5002a71
push 0x10
mov edi, 0x5001140
pop ecx
mov esi, eax
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x5002a71
mov ecx, dword [eax + 0x10]
cmp ecx, 0x16
mov dword [ebp + 8], ecx
jb 0x5002a71
cmp ecx, dword [ebp - 4]
ja 0x5002a71
push ecx
push eax
push 0xffffffffffffffff
call fcn.050028b8
test eax, eax
je 0x5002a83
mov eax, dword [ebp - 8]
inc eax
dec dword [ebp - 4]
cmp dword [ebp - 4], 0x16
mov dword [ebp - 8], eax
jae 0x5002a37
jmp 0x5002bf3
mov ecx, dword [ebp - 8]
test cl, 3
je 0x5002aa7
mov edi, dword [ebp - 0x10]
mov esi, edi
mov eax, dword [ebp + 8]
dec dword [ebp + 8]
test eax, eax
je 0x5002aa2
mov al, byte [ecx]
mov byte [esi], al
inc esi
inc ecx
jmp 0x5002a90
mov dword [ebp - 8], edi
mov ecx, edi
movzx edx, word [ecx + 0x14]
mov eax, dword [ecx + 0x10]
mov dword [ebp - 0x10], edx
add eax, ecx
add ecx, 0x16
cmp edx, ebx
mov dword [ebp - 0x1c], eax
je 0x5002bf3
mov edi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
jmp 0x5002acf
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x1c]
mov esi, ecx
add ecx, 4
cmp ecx, eax
mov dword [ebp - 0x14], esi
ja 0x5002bf3
mov ax, word [esi]
test al, 1
jne 0x5002bf3
mov dx, word [esi + 2]
test dl, 1
jne 0x5002bf3
movzx eax, ax
mov esi, ecx
add ecx, eax
movzx edx, dx
mov dword [ebp - 0x18], ecx
add ecx, edx
cmp ecx, dword [ebp - 0x1c]
mov dword [ebp - 8], ecx
ja 0x5002bf3
shr eax, 1
mov ecx, dword [ebp - 0x18]
push 2
mov word [esi + eax*2 - 2], bx
mov eax, dword [ebp - 0x14]
movzx eax, word [eax + 2]
shr eax, 1
mov word [ecx + eax*2 - 2], bx
pop eax
sub esi, eax
mov word [esi], 0x5f
sub esi, eax
mov word [esi], 0x58
sub esi, eax
mov word [esi], 0x46
sub esi, eax
mov word [esi], 0x53
sub esi, eax
lea eax, [ebp - 4]
push eax
push ebx
push ebx
push ebx
push 0xffffffffffffffff
push esi
push ebx
push ebx
mov word [esi], 0x5f
call edi
cmp eax, ebx
mov dword [ebp + 8], eax
je 0x5002bea
cmp dword [ebp - 4], ebx
jne 0x5002bea
push eax
push 8
push dword [0x5017384]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, ebx
mov dword [ebp - 0x14], eax
je 0x5002bf3
push ebx
push ebx
push dword [ebp + 8]
push eax
push 0xffffffffffffffff
push esi
push ebx
push ebx
call edi
push ebx
push ebx
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x5002bea
lea eax, [ebp - 4]
push eax
push ebx
push ebx
push ebx
push 0xffffffffffffffff
push dword [ebp - 0x18]
push ebx
push ebx
call edi
cmp eax, ebx
mov dword [ebp + 8], eax
je 0x5002bea
cmp dword [ebp - 4], ebx
jne 0x5002bea
push eax
push 8
push dword [0x5017384]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
cmp esi, ebx
je 0x5002bf3
push ebx
push ebx
push dword [ebp + 8]
push esi
push 0xffffffffffffffff
push dword [ebp - 0x18]
push ebx
push ebx
call edi
push esi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
dec dword [ebp - 0x10]
jne 0x5002ac9
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop esi
pop edi
pop ebx
leave
ret 4