Function at 0x51e8d8
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2d4
mov eax, dword [0x63d284]
xor eax, ebp
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x646414], eax
je 0x51e903
mov eax, 0x10dd
jmp 0x51eb16
cmp dword [0x6462e4], 0
je 0x51e916
call fcn.0051e82a
jmp 0x51eb11
push ebx
push esi
push edi
mov edi, dword [0x646488]
jmp 0x51e9b5
cmp dword [edi + 4], 0
mov edx, dword [edi + 0x10]
je 0x51e98c
xor esi, esi
cmp byte [edx + 0x17], 0
jbe 0x51e969
mov ecx, dword [edi + 0xc]
lea eax, [ebp - 0x2d4]
and dword [ebp - 0x2d4], 0
add ecx, esi
push eax
push 0
call fcn.00521e27
cmp dword [ebp - 0x2d4], 0
mov edx, eax
jne 0x51e969
mov eax, dword [edi + 0x10]
mov esi, edx
sub esi, eax
movzx eax, byte [eax + 0x17]
cmp esi, eax
jl 0x51e935
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 8]
movzx eax, byte [eax + 0x17]
cmp esi, eax
je 0x51e987
mov dword [0x6462e4], 0xd
mov dword [0x646478], ecx
mov eax, dword [edi + 0xc]
jmp 0x51e9b1
mov esi, dword [edi + 0xc]
mov ecx, dword [edx + 0x1c]
lea eax, [esi + 5]
mov byte [esi], 0xe9
sub ecx, eax
mov dword [esi + 1], ecx
lea ecx, [esi + 5]
mov edx, dword [edi + 0x10]
mov edx, dword [edx + 0x18]
call fcn.0051e458
mov ecx, dword [edi + 8]
mov eax, dword [edi + 0x10]
mov dword [ecx], eax
mov edi, dword [edi]
test edi, edi
jne 0x51e924
mov edi, dword [0x646480]
test edi, edi
je 0x51ea69
mov ebx, dword [sym.imp.KERNEL32.dll_SetThreadContext]
lea eax, [ebp - 0x2d0]
mov dword [ebp - 0x2d0], 0x10001
push eax
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x51ea5f
mov esi, dword [0x646488]
test esi, esi
je 0x51ea5f
mov ecx, dword [ebp - 0x218]
cmp dword [esi + 4], 0
je 0x51ea20
mov edx, dword [esi + 0x10]
cmp ecx, edx
jb 0x51ea59
lea eax, [edx + 4]
cmp ecx, eax
jae 0x51ea59
sub ecx, edx
mov dword [ebp - 0x218], ecx
mov eax, dword [esi + 0xc]
jmp 0x51ea3f
cmp ecx, dword [esi + 0xc]
jb 0x51ea59
mov eax, dword [esi + 0x10]
movzx eax, byte [eax + 0x17]
add eax, dword [esi + 0xc]
cmp ecx, eax
jae 0x51ea59
sub ecx, dword [esi + 0xc]
mov dword [ebp - 0x218], ecx
mov eax, dword [esi + 0x10]
add eax, ecx
mov dword [ebp - 0x218], eax
lea eax, [ebp - 0x2d0]
push eax
push dword [edi + 4]
call ebx
mov ecx, dword [ebp - 0x218]
mov esi, dword [esi]
test esi, esi
jne 0x51e9ff
mov edi, dword [edi]
test edi, edi
jne 0x51e9d1
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x646488]
mov ebx, eax
test edi, edi
je 0x51ead0
lea eax, [ebp - 0x2d4]
push eax
mov eax, dword [edi + 0x10]
push dword [edi + 0x14]
movzx eax, byte [eax + 0x17]
push eax
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [edi + 0x10]
movzx eax, byte [eax + 0x17]
push eax
push dword [edi + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [edi + 4], 0
je 0x51eabe
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x51eabe
call fcn.0051e74b
and dword [edi + 0x10], 0
mov esi, dword [edi]
push 0x18
push edi
call fcn.0056c61e
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x51ea7b
xor ebx, ebx
mov dword [0x646488], ebx
call fcn.0051e53b
mov edi, dword [0x646480]
test edi, edi
je 0x51eb02
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov esi, dword [edi]
push 8
push edi
call fcn.0056c61e
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x51eae7
pop edi
pop esi
mov dword [0x646480], ebx
mov dword [0x646414], ebx
pop ebx
mov eax, dword [0x6462e4]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0056cd75
leave
ret