Function at 0x10081eb0
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Print debug messages

Disassembly:
sub esp, 0x214
mov eax, dword [0x1025f074]
xor eax, esp
mov dword [esp + 0x210], eax
push esi
mov esi, edx
test ecx, ecx
je 0x10082144
test esi, esi
je 0x10082144
cmp byte [0x1026744b], 0
push ebp
mov ebp, dword [ecx]
jne 0x10081ef5
push 0x1026745c
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov byte [0x1026744b], 1
push ebx
push edi
push 0x1026745c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi], 0xffffffff
mov ebx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
je 0x100820ed
cmp dword [esi + 8], 0
je 0x10081f27
push 0x1021c6c0
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x100820e1
mov eax, dword [esi]
mov edi, dword [ebp + eax*4]
mov eax, dword [esi + 4]
mov dword [esp + 0x14], eax
mov eax, dword [0x1026829c]
test eax, eax
jne 0x10081f71
push 0x10268284
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x1026829c], 0
jne 0x10081f65
push 0
push 0
push 0x40000
call dword [sym.imp.KERNEL32.dll_HeapCreate]
mov dword [0x1026829c], eax
push 0x10268284
call ebx
mov eax, dword [0x1026829c]
push 0x24
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x10082131
mov eax, dword [esp + 0x14]
lea edx, [ebx + 0x20]
mov dword [edx], eax
lea ecx, [ebx + 6]
mov dword [ebx + 0x1c], ecx
lea eax, [ebx + 0x1c]
mov dword [ebx + 0x18], edi
mov edi, 0x25ff
mov dword [ebx + 0x14], 0x10000000
mov dword [ebx + 2], eax
mov eax, 0x35ff
mov word [ebx + 7], ax
lea eax, [ebx + 0x18]
push 0x14
push ebx
mov word [ebx], di
mov byte [ecx], 0x58
mov dword [ebx + 9], eax
mov byte [ebx + 0xd], 0x50
mov word [ebx + 0xe], di
mov dword [ebx + 0x10], edx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
xor al, al
xor edi, edi
mov byte [esp + 0x13], al
cmp edi, 3
jge 0x10082060
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
mov eax, dword [esi]
push 0x40
push 4
lea eax, [eax*4]
add eax, ebp
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x10082015
call fcn.10004ba0
jmp 0x10082055
mov eax, dword [esi]
mov edx, ebx
mov eax, dword [ebp + eax*4]
mov dword [ebx + 0x18], eax
push eax
mov eax, dword [esi]
lea ecx, [eax*4]
add ecx, ebp
call fcn.10081e20
mov ecx, dword [esi]
add esp, 4
mov byte [esp + 0x13], al
lea eax, [esp + 0x14]
push eax
push dword [esp + 0x18]
lea ecx, [ecx*4]
push 4
add ecx, ebp
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov al, byte [esp + 0x13]
inc edi
test al, al
je 0x10081fe2
jmp 0x10082068
test al, al
je 0x1008210f
cmp byte [0x1026b4bc], 0
mov dword [esi + 8], ebx
jne 0x100820db
push 0x208
lea eax, [esp + 0x1c]
push 0
push eax
call fcn.101b5530
add esp, 0xc
lea eax, [esp + 0x18]
push 0x104
push eax
push 0x10000000
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x100820cf
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
lea eax, [esp + 0x1c]
push eax
push 1
call dword [sym.imp.KERNEL32.dll_GetModuleHandleExW]
test eax, eax
jne 0x100820c6
push str.ERROR:_Failed_to_pin_module__n
jmp 0x100820d4
mov byte [0x1026b4bc], 1
jmp 0x100820db
push str.ERROR:_Could_not_get_module_path._n
mov eax, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call eax
mov ebx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
add esi, 0xc
cmp dword [esi], 0xffffffff
jne 0x10081f11
push 0x1026745c
call ebx
xor eax, eax
pop edi
pop ebx
pop ebp
pop esi
mov ecx, dword [esp + 0x210]
xor ecx, esp
call fcn.101b3122
add esp, 0x214
ret
push ebx
push 0
push dword [0x1026829c]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0x1026745c
call eax
mov eax, 0x80004005
jmp 0x100820f6
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0x1026745c
call eax
mov eax, 0x8007000e
jmp 0x100820f6
mov ecx, dword [esp + 0x214]
mov eax, 0x80070057
pop esi
xor ecx, esp
call fcn.101b3122
add esp, 0x214
ret