Function at 0x1004f159
Capabilities:
Delete file
Query environment variable
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2e4
push esi
push edi
mov edi, dword [ebp + 8]
mov ecx, dword [edi + 4]
xor esi, esi
cmp ecx, esi
jg 0x1004f177
xor eax, eax
jmp 0x1004f3b4
mov eax, dword [edi]
push ebx
push esi
push ecx
push eax
mov dword [ebp - 4], esi
call fcn.10045061
mov ebx, eax
add esp, 0xc
cmp ebx, esi
mov dword [ebp - 0xc], ebx
je 0x1004f1c2
push esi
lea eax, [ebp - 4]
push eax
push ebx
call dword [0x100e2ef8]
mov eax, dword [ebp + 0xc]
cmp eax, esi
je 0x1004f1ad
cmp dword [ebp - 4], esi
je 0x1004f1ad
mov dword [eax], ebx
jmp 0x1004f1b7
push ebx
call dword [0x100e2ec8]
mov dword [ebp - 0xc], esi
mov eax, dword [ebp - 4]
cmp eax, esi
jne 0x1004f3b3
mov ebx, 0x100e38d4
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call fcn.10044ecd
lea ecx, [ebp - 8]
call fcn.10002d1a
push dword [edi + 4]
mov eax, dword [edi]
push eax
call fcn.10044fc3
mov edi, eax
cmp edi, esi
pop ecx
pop ecx
je 0x1004f203
mov eax, dword [edi]
lea ecx, [ebp - 4]
push ecx
push edi
call dword [eax + 0xc]
cmp dword [ebp - 4], esi
jne 0x1004f208
mov eax, dword [edi]
push edi
call dword [eax + 8]
cmp dword [ebp - 4], esi
je 0x1004f229
mov eax, dword [0x100e34d8]
cmp eax, esi
mov edi, dword [ebp - 4]
je 0x1004f21b
cmp dword [ebp - 8], esi
jne 0x1004f21b
call eax
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
jmp 0x1004f3b3
mov eax, dword [0x100e34d8]
cmp eax, esi
je 0x1004f239
cmp dword [ebp - 8], esi
jne 0x1004f239
call eax
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ebx, 0x104
push ebx
lea eax, [ebp - 0x2e4]
push eax
push 0x100c6d94
mov word [ebp - 0x2e4], si
call edi
cmp eax, esi
jg 0x1004f27f
push ebx
lea eax, [ebp - 0x2e4]
push eax
push 0x100c6d88
call edi
cmp eax, esi
jg 0x1004f27f
xor eax, eax
jmp 0x1004f3b3
mov dword [ebp - 8], esi
mov dword [ebp - 0x10], 0x63
lea edi, [ebp + eax*2 - 0x2e4]
call fcn.1004217a
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
add ebx, eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push str.pecmd_bmp._lu._lu.tmp
push edi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push esi
push 0x80
push 1
push esi
push esi
push 0x40000000
lea eax, [ebp - 0x2e4]
push eax
lea ecx, [ebp - 8]
call fcn.10005b9d
cmp dword [ebp - 8], esi
jne 0x1004f2f0
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
dec dword [ebp - 0x10]
jns 0x1004f290
lea ecx, [ebp - 8]
call fcn.10002d56
jmp 0x1004f278
push esi
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp + 8]
push dword [eax + 4]
mov dword [ebp - 0x14], esi
push dword [eax]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [ebp - 8]
call fcn.10002d56
lea ecx, [ebp - 8]
call fcn.10002d56
push 0x10
push esi
push esi
push esi
lea eax, [ebp - 0x2e4]
push eax
push esi
call dword [sym.imp.USER32.dll_LoadImageW]
cmp eax, esi
mov dword [ebp - 4], eax
jne 0x1004f3a3
lea eax, [ebp - 0x2e4]
push eax
call fcn.1004ecbd
mov edi, eax
cmp edi, esi
pop ecx
je 0x1004f35d
mov eax, dword [edi]
lea ecx, [ebp - 4]
push ecx
push edi
call dword [eax + 0xc]
cmp dword [ebp - 4], esi
jne 0x1004f3a3
mov eax, dword [edi]
push edi
call dword [eax + 8]
jmp 0x1004f3a3
lea eax, [ebp - 0x2e4]
push esi
push eax
call fcn.10015eb9
mov edi, eax
cmp edi, esi
pop ecx
pop ecx
je 0x1004f3a3
cmp dword [ebp - 0xc], esi
je 0x1004f380
push dword [ebp - 0xc]
call dword [0x100e2ec8]
push esi
lea eax, [ebp - 4]
push eax
push edi
call dword [0x100e2ef8]
mov eax, dword [ebp + 0xc]
cmp eax, esi
je 0x1004f39c
cmp dword [ebp - 4], esi
je 0x1004f39c
mov dword [eax], edi
jmp 0x1004f3a3
push edi
call dword [0x100e2ec8]
lea eax, [ebp - 0x2e4]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, dword [ebp - 4]
pop ebx
pop edi
pop esi
leave
ret