Function at 0x4222e2
Capabilities:
Resume thread

Disassembly:
push ebp
lea ebp, [esp - 0x258]
sub esp, 0x2d8
mov eax, dword [0x458060]
xor eax, ebp
mov dword [ebp + 0x254], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x45c0bc], eax
je 0x422315
mov eax, 0x10dd
jmp 0x422510
push edi
xor edi, edi
cmp dword [0x45c0c0], edi
je 0x42232a
call fcn.00422241
jmp 0x42250a
push esi
mov esi, dword [0x45c0cc]
mov dword [ebp - 0x7c], edi
jmp 0x422380
mov eax, dword [esi + 0x10]
cmp dword [esi + 4], edi
je 0x422357
movzx ecx, byte [eax + 0x36]
push ecx
add eax, 0x20
push eax
push dword [esi + 0xc]
call 0x42c8a0
mov ecx, dword [esi + 0xc]
add esp, 0xc
jmp 0x422379
mov ecx, dword [eax + 0x44]
mov eax, dword [esi + 0xc]
lea edx, [eax + 5]
mov byte [eax], 0xe9
inc eax
sub ecx, edx
mov dword [eax], ecx
mov edx, dword [esi + 0x10]
lea ecx, [eax + 4]
mov eax, dword [edx + 0x40]
call fcn.00421db2
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 8]
mov dword [eax], ecx
mov esi, dword [esi]
cmp esi, edi
jne 0x422336
mov eax, dword [0x45c0c8]
push ebx
mov ebx, eax
cmp eax, edi
je 0x422451
lea eax, [ebp - 0x78]
push eax
push dword [ebx + 4]
mov dword [ebp - 0x78], 0x10001
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x422447
mov esi, dword [0x45c0cc]
jmp 0x42243f
cmp dword [esi + 4], edi
je 0x4223f6
mov ecx, dword [esi + 0x10]
mov eax, dword [ebp + 0x40]
cmp eax, ecx
jb 0x42243b
lea edx, [ecx + 4]
cmp eax, edx
jae 0x42243b
sub al, cl
mov dl, byte [ecx + edi + 0x38]
shr dl, 3
cmp dl, al
je 0x4223ee
inc edi
cmp edi, 8
jb 0x4223d3
xor al, al
movzx eax, al
add eax, dword [esi + 0xc]
jmp 0x42242b
mov al, byte [edi + ecx + 0x38]
and al, 7
jmp 0x4223e6
mov ecx, dword [esi + 0xc]
cmp dword [ebp + 0x40], ecx
jb 0x42243b
mov eax, dword [esi + 0x10]
movzx edx, byte [eax + 0x36]
add edx, ecx
cmp dword [ebp + 0x40], edx
jae 0x42243b
mov cl, byte [ebp + 0x40]
sub cl, byte [esi + 0xc]
mov dl, byte [eax + edi + 0x38]
and dl, 7
cmp dl, cl
je 0x422525
inc edi
cmp edi, 8
jb 0x422412
xor ecx, ecx
add eax, ecx
mov dword [ebp + 0x40], eax
lea eax, [ebp - 0x78]
push eax
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
mov esi, dword [esi]
xor edi, edi
cmp esi, edi
jne 0x4223bb
mov ebx, dword [ebx]
cmp ebx, edi
jne 0x422394
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x45c0cc]
mov ebx, eax
cmp esi, edi
je 0x4224b9
lea eax, [ebp - 0x80]
push eax
mov eax, dword [esi + 0x10]
push dword [esi + 0x14]
movzx eax, byte [eax + 0x36]
push eax
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [esi + 0x10]
movzx eax, byte [eax + 0x36]
push eax
push dword [esi + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [esi + 4], 0
je 0x4224aa
mov edi, dword [esi + 0x10]
test edi, edi
je 0x4224aa
call fcn.004220e7
and dword [esi + 0x10], 0
mov dword [ebp - 0x7c], 1
mov edi, dword [esi]
push esi
call fcn.004273e1
pop ecx
mov esi, edi
test edi, edi
jne 0x422463
xor edi, edi
mov dword [0x45c0cc], edi
pop ebx
cmp dword [ebp - 0x7c], edi
je 0x4224d4
cmp dword [0x45c0b8], edi
jne 0x4224d4
call fcn.00422108
call fcn.00421e23
mov esi, dword [0x45c0c8]
cmp esi, edi
je 0x4224fb
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov edi, dword [esi]
push esi
call fcn.004273e1
pop ecx
mov esi, edi
test edi, edi
jne 0x4224e3
and dword [0x45c0c8], 0
and dword [0x45c0bc], 0
pop esi
mov eax, dword [0x45c0c0]
pop edi
mov ecx, dword [ebp + 0x254]
xor ecx, ebp
call fcn.004273ec
add ebp, 0x258
leave
ret
movzx ecx, byte [edi + eax + 0x38]
shr ecx, 3
jmp 0x422429