Function at 0x5218b0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x608e20
mov eax, dword fs:[0]
push eax
sub esp, 0x18
push ebx
push esi
push edi
mov eax, dword [0x6687b8]
xor eax, esp
push eax
lea eax, [esp + 0x28]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
xor ebx, ebx
cmp dword [edi + 8], ebx
lea esi, [edi + 8]
jne 0x521bb2
lea edi, [esp + 0x18]
call fcn.0047ac70
mov dword [esp + 0x30], ebx
mov ebx, dword [esp + 0x18]
mov eax, dword [ebx - 0xc]
test eax, eax
jle 0x521925
lea ecx, [eax - 1]
test ecx, ecx
jl 0x521980
cmp ecx, eax
jg 0x521980
movzx eax, word [ebx + ecx*2]
cmp ax, 0x5c
je 0x521925
push 0x5c
call fcn.0040af90
mov ebx, dword [esp + 0x18]
mov eax, dword [0x677600]
mov edx, dword [eax + 0xc]
mov ecx, 0x677600
call edx
lea edi, [eax + 0x10]
mov dword [esp + 0x14], edi
mov byte [esp + 0x30], 1
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, 0x402
or eax, ecx
jge 0x521966
mov ecx, 0x402
lea eax, [esp + 0x14]
call fcn.00403540
mov edi, dword [esp + 0x14]
lea eax, [esp + 0x20]
push eax
push edi
push 0x400
push ebx
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
test edi, edi
jne 0x52198a
xor eax, eax
jmp 0x5219a1
push 0x80070057
call fcn.00403650
mov eax, edi
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x521990
sub eax, edx
sar eax, 1
js 0x521980
cmp eax, dword [edi - 8]
jg 0x521980
push 0x2e
push 0x5c
lea ecx, [esp + 0x1c]
mov dword [edi - 0xc], eax
push ecx
mov word [edi + eax*2], 0
call fcn.004f5360
push 0x2e
push 0x2f
lea edx, [esp + 0x1c]
push edx
call fcn.004f5360
push 9
push 0x638d90
lea eax, [esp + 0x1c]
push eax
call fcn.0040aee0
push 0x454
push 0x638da4
lea edi, [esp + 0x1c]
call fcn.0040e190
add esp, 8
call fcn.00431780
mov edi, dword [esp + 0x14]
lea ecx, [esp + 0x1c]
push ecx
mov eax, 0x100000
mov ecx, edi
mov edx, esi
mov dword [esp + 0x20], 0
call fcn.0050de80
mov ebx, eax
test ebx, ebx
jge 0x521a81
call fcn.0050df50
lea eax, [edi - 0x10]
mov byte [esp + 0x30], 0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x521a42
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x30], 0xffffffff
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x521a6a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, ebx
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
add edi, 0xfffffff0
mov byte [esp + 0x30], 0
or edx, 0xffffffff
cmp dword [esi], 0
lea ecx, [edi + 0xc]
jne 0x521ae9
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x521aa7
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov dword [esp + 0x30], 0xffffffff
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x521acf
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 0x80004005
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x521afc
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov dword [esp + 0x30], 0xffffffff
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x521b24
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [esp + 0x1c], 0
jne 0x521baf
mov eax, dword [esi]
test eax, eax
je 0x521b3f
mov ecx, 0x100000
call fcn.00521160
mov eax, dword [esi]
cmp byte [eax + 0x18], 0
je 0x521a6a
mov edi, dword [ebp + 8]
lea ecx, [esp + 0x1c]
push ecx
push 0
push edi
push 0x521c40
push 0
mov byte [eax + 0x18], 0
push 0
mov byte [edi + 0x2c], 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
je 0x521b79
mov dword [edi + 0x28], eax
jmp 0x521a6a
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
jg 0x521b94
call edi
mov edx, dword [esi]
mov ebx, eax
mov byte [edx + 0x18], 1
jmp 0x521a6a
call edi
mov edx, dword [esi]
mov ebx, eax
and ebx, 0xffff
or ebx, 0x80070000
mov byte [edx + 0x18], 1
jmp 0x521a6a
mov edi, dword [ebp + 8]
cmp dword [ebp + 0xc], 0
je 0x521a6a
mov eax, edi
call fcn.00521870
mov eax, dword [esi]
cmp byte [eax + 0x18], 0
je 0x521a6a
mov byte [eax + 0x18], 0
push edi
mov byte [edi + 0x2c], 0
call fcn.00521e60
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8