Function at 0x1004634
Capabilities:
Accept command line arguments
Get process heap flags
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push edi
call fcn.01004233
mov edi, eax
xor ebx, ebx
mov dword [ebp - 0x10], edi
cmp edi, ebx
je 0x100496a
push 0x20
push edi
call dword [0x100601c]
pop ecx
pop ecx
cmp eax, ebx
jne 0x1004678
push ebx
push edi
call dword [0x100601c]
pop ecx
pop ecx
cmp eax, ebx
jne 0x1004678
push 0x10011b0
jmp 0x100495d
sub eax, edi
sar eax, 1
cmp eax, 2
jae 0x1004699
push 0x10011c4
or eax, 0xffffffff
mov esi, 0x1006030
call fcn.01005047
push edi
jmp 0x1004962
lea esi, [eax + eax]
lea eax, [esi + 2]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [ebp - 0x1c], edi
cmp edi, ebx
jne 0x10046c1
push 0x10011d8
jmp 0x100495d
push esi
push dword [ebp - 0x10]
push edi
call dword [0x1006010]
add esp, 0xc
push edi
push ebx
xor eax, eax
push 4
mov word [esi + edi], ax
call dword [sym.imp.KERNEL32.dll_OpenFileMappingW]
mov dword [ebp - 0x18], eax
cmp eax, ebx
jne 0x100470c
push 0x10011ec
or eax, 0xffffffff
mov esi, 0x1006030
call fcn.01005047
push 0xa
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, esi
call fcn.01004feb
jmp 0x100496a
mov edi, dword [sym.imp.KERNEL32.dll_MapViewOfFile]
push ebx
push ebx
push ebx
push 4
push eax
call edi
mov esi, eax
mov dword [ebp - 0x10], esi
cmp esi, ebx
jne 0x100472a
push 0x1001200
jmp 0x10046eb
push 0x20
push esi
push dword [ebp + 8]
call dword [0x1006010]
add esp, 0xc
call fcn.010041b2
mov dword [ebp - 0xc], eax
cmp eax, ebx
je 0x100496a
mov ecx, dword [esi + 0x20]
mov esi, dword [ebp + 8]
add esi, 0x18
push eax
mov eax, esi
mov dword [ebp - 8], ecx
call fcn.01004158
pop ecx
test al, al
je 0x100496a
push dword [ebp - 0xc]
lea eax, [ebp - 8]
call fcn.01004158
pop ecx
test al, al
je 0x100496a
push ebx
push ebx
push ebx
push 2
push dword [esi]
call edi
mov esi, eax
cmp esi, ebx
jne 0x1004793
push 0x1001214
jmp 0x10046eb
cmp dword [esi + 0x50], ebx
je 0x1004958
cmp dword [esi + 0x54], ebx
je 0x1004958
mov eax, dword [esi + 0x40]
cmp eax, ebx
je 0x1004958
cmp dword [esi + 0x44], ebx
je 0x1004958
lea eax, [eax + eax + 2]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
cmp edi, ebx
jne 0x10047dc
push 0x100123c
jmp 0x100495d
mov eax, dword [esi + 0x40]
add eax, eax
push eax
mov eax, dword [esi + 0x44]
add eax, esi
push eax
push edi
call dword [0x1006010]
mov eax, dword [esi + 0x40]
xor ecx, ecx
mov word [edi + eax*2], cx
mov eax, dword [esi + 0x50]
add esp, 0xc
lea eax, [eax + eax + 2]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 4], eax
cmp eax, ebx
jne 0x1004822
push 0x1001250
jmp 0x100495d
mov ecx, dword [esi + 0x50]
add ecx, ecx
push ecx
mov ecx, dword [esi + 0x54]
add ecx, esi
push ecx
push eax
call dword [0x1006010]
mov eax, dword [ebp - 4]
mov ecx, dword [esi + 0x50]
add esp, 0xc
xor edx, edx
push eax
mov word [eax + ecx*2], dx
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [0x1006020]
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x10]
pop ecx
pop ecx
mov dword [ebp - 0x14], eax
push edi
add eax, 0x38
push eax
call dword [0x1006004]
push dword [ebp - 4]
mov eax, dword [ebp - 0x14]
add eax, 0x40
push eax
call dword [0x1006004]
call fcn.01003f5a
test al, al
je 0x10048dd
call fcn.0100429e
mov ecx, dword [eax + 0x20]
cmp dword [eax + 0x24], ebx
ja 0x10048dd
jb 0x100489e
cmp ecx, 0x7fff0000
jae 0x10048dd
mov dword [ecx + 0x68], edi
mov dword [ecx + 0x6c], ebx
mov ax, word [esi + 0x40]
add ax, ax
mov word [ecx + 0x60], ax
mov ax, word [esi + 0x40]
inc ax
add ax, ax
mov word [ecx + 0x62], ax
mov eax, dword [ebp - 4]
mov dword [ecx + 0x78], eax
mov dword [ecx + 0x7c], ebx
mov ax, word [esi + 0x50]
add ax, ax
mov word [ecx + 0x70], ax
mov ax, word [esi + 0x50]
inc ax
add ax, ax
mov word [ecx + 0x72], ax
mov eax, dword [ebp - 0x10]
lea edi, [eax + 0x28]
mov eax, dword [eax + 0x24]
lea eax, [edi + eax*4]
mov dword [ebp - 0x14], eax
cmp edi, eax
je 0x1004909
mov eax, dword [edi]
push dword [ebp - 0xc]
add eax, esi
call fcn.01004158
pop ecx
test al, al
je 0x100496a
add edi, 4
cmp edi, dword [ebp - 0x14]
jne 0x10048f0
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x1004920
push 0x1001264
jmp 0x10046eb
mov edi, dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push esi
call edi
push dword [ebp - 8]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0xc]
call esi
push dword [ebp - 0x10]
call edi
push dword [ebp - 0x18]
call esi
push dword [ebp - 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov al, 1
jmp 0x100496c
push 0x1001228
mov esi, 0x1006030
or eax, 0xffffffff
call fcn.01005047
xor al, al
pop edi
pop esi
pop ebx
leave
ret