Function at 0x6d579c
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd8
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0x28], ebx
mov esi, ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov ebx, dword [ebp + 0x14]
xor eax, eax
push ebp
push 0x6d59db
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 9], 0
cmp byte [0x771394], 0
jne 0x6d57f0
mov byte [0x771394], 1
push 0x6d59f0
push 0x6d5a28
call sub.kernel32.dll_GetModuleHandleW_2
push eax
call fcn.00413720
mov dword [0x771390], eax
mov edx, dword [0x6d50d8]
mov eax, 0x18
call fcn.0040bb7c
mov dword [ebp - 0x10], eax
xor edx, edx
push ebp
push 0x6d59be
push dword fs:[edx]
mov dword fs:[edx], esp
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
xor eax, eax
mov dword [ebp - 0x18], eax
lea eax, [ebx + 1]
push eax
mov eax, dword [ebp - 0x20]
add eax, 0x14
mov ecx, 1
mov edx, dword [0x6d50a4]
call fcn.0040c3cc
add esp, 4
test ebx, ebx
jl 0x6d58d5
inc ebx
mov dword [ebp - 0x24], ebx
mov ebx, esi
cmp dword [ebx], 0
je 0x6d58c9
mov eax, dword [ebx]
mov edx, dword [eax]
call dword [edx + 0x18]
test al, al
je 0x6d58c9
mov eax, dword [ebx]
mov edx, dword [eax]
call dword [edx + 0x14]
mov esi, eax
mov eax, esi
mov edx, dword [0x6cb08c]
call fcn.0040834c
test al, al
jne 0x6d58a2
mov eax, esi
mov edx, dword [0x6cc134]
call fcn.0040834c
test al, al
je 0x6d58a0
lea edx, [ebp - 0x28]
mov eax, esi
mov ecx, dword [eax]
call dword [ecx + 0xc]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax]
call dword [edx + 0x14]
mov esi, eax
cmp byte [esi + 8], 0
jne 0x6d58a2
xor esi, esi
jmp 0x6d58a2
xor esi, esi
test esi, esi
je 0x6d58c9
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x14]
mov edx, dword [ebp - 0x18]
lea eax, [eax + edx*4]
mov edx, esi
test edx, edx
je 0x6d58bb
sub edx, 0xffffffac
call fcn.0040da80
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 0x3f
je 0x6d58d5
add ebx, 4
dec dword [ebp - 0x24]
jne 0x6d5847
cmp dword [ebp - 0x18], 0
jle 0x6d599c
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x20]
add eax, 0x14
mov ecx, 1
mov edx, dword [0x6d50a4]
call fcn.0040c3cc
add esp, 4
movzx eax, word [0x6d5a40]
cmp ax, word [ebp + 0xc]
setne al
and al, byte [ebp + 8]
je 0x6d591c
cmp dword [0x771390], 0
jne 0x6d591c
mov byte [ebp + 8], 0
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 4]
mov dword [eax], edx
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 8]
mov dword [eax + 4], edx
movzx eax, word [ebp + 0xc]
mov edx, dword [ebp - 0x20]
mov dword [edx + 8], eax
mov eax, dword [ebp - 0x20]
movzx edx, byte [ebp + 0x10]
mov byte [eax + 0x11], dl
mov eax, dword [ebp - 0x20]
movzx edx, byte [ebp + 8]
mov byte [eax + 0x10], dl
cmp byte [ebp + 0x10], 0
je 0x6d595d
mov eax, dword [ebp - 0x20]
mov dword [eax + 0xc], 1
jmp 0x6d5965
mov eax, dword [ebp - 0x20]
xor edx, edx
mov dword [eax + 0xc], edx
cmp byte [ebp + 8], 0
je 0x6d5972
mov eax, dword [ebp - 0x20]
or dword [eax + 0xc], 2
lea eax, [ebp - 0x1c]
push eax
push 0
mov eax, dword [ebp - 0x10]
push eax
push 0x6d564c
push 0
push 0
call sub.kernel32.dll_CreateThread_1
test eax, eax
setne byte [ebp - 9]
cmp byte [ebp - 9], 0
je 0x6d599c
push eax
call sub.kernel32.dll_CloseHandle_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x6d59c5
cmp byte [ebp - 9], 0
jne 0x6d59bd
mov edx, dword [0x6d50d8]
mov eax, dword [ebp - 0x10]
call fcn.0040bb90
ret