Function at 0x100197c0
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Get system information on windows
Parse pe header

Disassembly:
sub esp, 0x2c
push ebx
push ebp
mov ebp, dword [esp + 0x38]
push esi
test ebp, ebp
push edi
jne 0x100197dc
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x2c
ret
mov esi, dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
push 0x40
push ebp
call esi
cmp eax, 1
je 0x10019af9
cmp word [ebp], 0x5a4d
jne 0x10019af9
mov ebx, dword [ebp + 0x3c]
push 0xf8
add ebx, ebp
push ebx
call esi
cmp eax, 1
je 0x10019aec
cmp dword [ebx], 0x4550
jne 0x10019aec
cmp word [ebx + 0x14], 0xe0
jne 0x10019adf
cmp word [ebx + 0x18], 0x10b
jne 0x10019adf
mov cx, word [ebx + 6]
cmp cx, 1
jae 0x1001984d
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x2c
ret
mov eax, ecx
lea edx, [ebx + 0xf8]
and eax, 0xffff
mov dword [esp + 0x14], 0
lea esi, [eax + eax*4]
shl esi, 3
sub esi, ebp
add esi, edx
mov edi, esi
test cx, cx
mov dword [esp + 0x40], edi
jbe 0x100198b0
xor edi, edi
lea ecx, [edx + 0xc]
mov dword [esp + 0x10], eax
mov eax, dword [ecx]
mov edx, dword [ecx + 4]
add edx, eax
cmp dword [esp + 0x40], edx
jae 0x10019891
mov dword [esp + 0x40], edx
cmp dword [ebx + 0x88], eax
jne 0x1001989d
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0x10]
inc edi
add ecx, 0x28
dec eax
mov dword [esp + 0x10], eax
jne 0x10019880
mov edi, dword [esp + 0x40]
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov ecx, dword [esp + 0x1c]
mov eax, edi
xor edx, edx
div ecx
xor edx, edx
mov dword [esp + 0x40], eax
mov eax, edi
div ecx
test edx, edx
je 0x100198d7
inc dword [esp + 0x40]
imul ecx, dword [esp + 0x40]
push 0x40
push 0x1000
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test edi, edi
jne 0x100198ff
pop edi
pop esi
pop ebp
mov eax, 6
pop ebx
add esp, 0x2c
ret
push esi
push ebp
push edi
call sub.MSVCRT.dll_memmove
xor esi, esi
add esp, 0xc
cmp word [ebx + 6], si
jbe 0x10019945
mov eax, esi
and eax, 0xffff
lea ecx, [eax + eax*4]
lea eax, [ebx + 0xf8]
mov edx, dword [eax + ecx*8 + 0x10]
lea eax, [eax + ecx*8]
push edx
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0xc]
add ecx, ebp
add edx, edi
push ecx
push edx
call sub.MSVCRT.dll_memmove
add esp, 0xc
inc esi
cmp si, word [ebx + 6]
jb 0x10019912
mov ebx, dword [edi + 0x3c]
mov esi, dword [esp + 0x14]
add ebx, edi
mov dword [0x1021d38c], edi
test esi, esi
mov dword [esp + 0x40], ebx
je 0x10019984
call fcn.100197b0
cmp eax, 1
jne 0x10019984
lea eax, [esi + esi*4]
mov edx, dword [ebx + eax*8 + 0x104]
lea eax, [ebx + eax*8 + 0xf8]
add edx, ebp
mov dword [eax + 0xc], edx
mov ecx, dword [eax + 0x14]
add ecx, ebp
mov dword [eax + 0x14], ecx
mov esi, dword [ebx + 0x80]
test esi, esi
jne 0x100199a8
push 0x8000
push esi
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
mov eax, 7
pop ebx
add esp, 0x2c
ret
add esi, edi
mov eax, dword [esi + 4]
mov dword [esp + 0x14], esi
test eax, eax
jne 0x100199bc
mov eax, dword [esi + 0xc]
test eax, eax
je 0x10019a31
mov eax, dword [esi + 0xc]
mov ecx, dword [0x1021d38c]
add eax, ecx
push eax
push 0
call fcn.10017e40
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x10019a29
mov ebx, dword [esi]
test ebx, ebx
jne 0x100199e1
mov ebx, dword [esi + 0x10]
mov esi, dword [esi + 0x10]
mov eax, dword [ebx + edi]
add ebx, edi
add esi, edi
test eax, eax
je 0x10019a21
test eax, 0x80000000
je 0x100199fe
and eax, 0xffff
push eax
jmp 0x10019a03
lea ecx, [eax + edi + 2]
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test esi, esi
mov dword [esi], eax
je 0x10019ac4
mov eax, dword [ebx + 4]
add ebx, 4
add esi, 4
test eax, eax
jne 0x100199ef
mov ebx, dword [esp + 0x40]
mov esi, dword [esp + 0x14]
add esi, 0x14
jmp 0x100199aa
mov edx, dword [ebx + 0xa0]
test edx, edx
je 0x10019aa3
mov eax, dword [edx + edi]
add edx, edi
test eax, eax
je 0x10019aa3
mov ebx, dword [edx + 4]
mov eax, edx
lea esi, [edx + 8]
add eax, ebx
cmp esi, eax
jae 0x10019a97
xor eax, eax
mov ax, word [esi]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x10019a85
mov ebx, dword [edx]
and eax, 0xfff
add eax, ebx
mov ebx, dword [esp + 0x40]
add eax, edi
mov ecx, edi
mov ebp, dword [ebx + 0x34]
mov ebx, dword [eax]
sub ecx, ebp
add ebx, ecx
mov dword [eax], ebx
jmp 0x10019a89
test ecx, ecx
jne 0x10019ac4
mov ebx, dword [edx + 4]
mov eax, edx
add esi, 2
add eax, ebx
cmp esi, eax
jb 0x10019a52
add edx, dword [edx + 4]
cmp dword [edx], 0
jne 0x10019a44
mov ebx, dword [esp + 0x40]
mov eax, dword [ebx + 0x28]
push 0
add eax, edi
push 1
push edi
mov dword [0x1021d384], eax
call eax
mov dword [0x1021d364], edi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
mov eax, 0xa
pop ebx
add esp, 0x2c
ret
pop edi
pop esi
pop ebp
mov eax, 4
pop ebx
add esp, 0x2c
ret
pop edi
pop esi
pop ebp
mov eax, 3
pop ebx
add esp, 0x2c
ret
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x2c
ret