Function at 0x422170
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x338
mov eax, dword [0x496684]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push edi
xor edi, edi
mov dword [ebp - 0x334], eax
cmp eax, edi
je 0x42219b
mov ecx, dword [0x499c0c]
mov dword [eax], ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x499c04], eax
je 0x4221bf
mov eax, 0x10dd
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042ca72
mov esp, ebp
pop ebp
ret 4
cmp dword [0x499c08], edi
je 0x4221d1
call fcn.00422070
jmp 0x42248f
push ebx
push esi
mov esi, dword [0x499c14]
cmp esi, edi
je 0x4222ce
cmp dword [esi + 4], edi
je 0x42228a
mov edx, dword [esi + 0x10]
xor ebx, ebx
cmp byte [edx + 0x17], bl
jbe 0x422263
mov eax, dword [esi + 0xc]
add eax, ebx
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x54], ecx
lea ecx, [ebp - 0x330]
mov dword [ebp - 0x60], edi
mov dword [ebp - 0x5c], edi
mov dword [ebp - 0x58], edi
mov dword [ebp - 0x50], ecx
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x330], edi
jne 0x42221f
lea eax, [ebp - 0x44]
cmp edx, edi
jne 0x42222f
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x42224a
movzx edi, byte [edx]
push edx
mov edx, dword [edi*8 + 0x48884c]
lea edi, [edi*8 + 0x488848]
push eax
push edi
lea ecx, [ebp - 0x60]
call edx
xor edi, edi
mov edx, eax
cmp dword [ebp - 0x330], edi
jne 0x422263
mov ecx, dword [esi + 0x10]
sub eax, ecx
mov ebx, eax
movzx eax, byte [ecx + 0x17]
cmp ebx, eax
jl 0x4221f4
mov ecx, dword [esi + 0x10]
movzx edx, byte [ecx + 0x17]
cmp ebx, edx
je 0x422280
mov eax, dword [esi + 8]
mov dword [0x499c08], 0xd
mov dword [0x499c0c], eax
mov ecx, dword [esi + 8]
mov edx, dword [esi + 0xc]
mov dword [ecx], edx
jmp 0x4222c4
mov eax, dword [esi + 0x10]
mov ecx, dword [eax + 0x1c]
mov eax, dword [esi + 0xc]
lea edx, [eax + 5]
sub ecx, edx
mov byte [eax], 0xe9
mov dword [eax + 1], ecx
mov ecx, dword [esi + 0x10]
mov ecx, dword [ecx + 0x18]
add eax, 5
cmp eax, ecx
jae 0x4222bc
sub ecx, eax
push ecx
push 0xcc
push eax
call fcn.004316d0
add esp, 0xc
mov edx, dword [esi + 8]
mov eax, dword [esi + 0x10]
mov dword [edx], eax
mov esi, dword [esi]
cmp esi, edi
jne 0x4221e1
mov ebx, dword [0x499c10]
cmp ebx, edi
je 0x42237c
mov edi, dword [sym.imp.KERNEL32.dll_SetThreadContext]
mov edx, dword [ebx + 4]
lea ecx, [ebp - 0x32c]
push ecx
push edx
mov dword [ebp - 0x32c], 0x10001
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x422370
mov esi, dword [0x499c14]
test esi, esi
je 0x422370
mov eax, dword [ebp - 0x274]
cmp dword [esi + 4], 0
je 0x422332
mov ecx, dword [esi + 0x10]
cmp eax, ecx
jb 0x42236a
lea edx, [ecx + 4]
cmp eax, edx
jae 0x42236a
sub eax, ecx
mov dword [ebp - 0x274], eax
add eax, dword [esi + 0xc]
jmp 0x422351
mov ecx, dword [esi + 0xc]
cmp eax, ecx
jb 0x42236a
mov edx, dword [esi + 0x10]
movzx edx, byte [edx + 0x17]
add edx, ecx
cmp eax, edx
jae 0x42236a
sub eax, ecx
mov dword [ebp - 0x274], eax
add eax, dword [esi + 0x10]
mov ecx, dword [ebx + 4]
mov dword [ebp - 0x274], eax
lea eax, [ebp - 0x32c]
push eax
push ecx
call edi
mov eax, dword [ebp - 0x274]
mov esi, dword [esi]
test esi, esi
jne 0x422311
mov ebx, dword [ebx]
test ebx, ebx
jne 0x4222e2
xor edi, edi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x499c14]
cmp esi, edi
mov edi, dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov dword [ebp - 0x330], eax
je 0x42241c
lea esp, [esp]
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 0x14]
lea edx, [ebp - 0x338]
push edx
movzx edx, byte [ecx + 0x17]
push eax
mov eax, dword [esi + 0xc]
push edx
push eax
call edi
mov ecx, dword [esi + 0x10]
movzx edx, byte [ecx + 0x17]
mov eax, dword [esi + 0xc]
mov ecx, dword [ebp - 0x330]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
xor ecx, ecx
cmp dword [esi + 4], ecx
je 0x42240b
mov eax, dword [esi + 0x10]
cmp eax, ecx
je 0x42240b
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov dword [eax + 8], ecx
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], ecx
mov dword [eax + 0x14], ecx
mov dword [eax + 0x18], ecx
mov edx, eax
mov dword [eax + 0x1c], ecx
and edx, 0xffff0000
mov ebx, dword [edx + 8]
mov dword [eax + 0x18], ebx
mov dword [edx + 8], eax
mov dword [esi + 0x10], ecx
mov ebx, dword [esi]
push esi
call fcn.0042ca67
add esp, 4
mov esi, ebx
test ebx, ebx
jne 0x4223a0
mov esi, dword [0x499bf8]
xor ebx, ebx
mov dword [0x499c14], ebx
cmp esi, ebx
je 0x422448
mov edi, edi
lea edx, [ebp - 0x330]
push edx
push 0x20
push 0x10000
push esi
call edi
mov esi, dword [esi + 4]
cmp esi, ebx
jne 0x422430
mov esi, dword [0x499c10]
cmp esi, ebx
je 0x42246f
mov edi, dword [sym.imp.KERNEL32.dll_ResumeThread]
mov eax, dword [esi + 4]
push eax
call edi
mov ebx, dword [esi]
push esi
call fcn.0042ca67
add esp, 4
mov esi, ebx
test ebx, ebx
jne 0x422458
mov eax, dword [ebp - 0x334]
pop esi
mov dword [0x499c10], ebx
mov dword [0x499c04], ebx
cmp eax, ebx
pop ebx
je 0x42248f
mov ecx, dword [0x499c0c]
mov dword [eax], ecx
mov ecx, dword [ebp - 4]
mov eax, dword [0x499c08]
xor ecx, ebp
pop edi
call fcn.0042ca72
mov esp, ebp
pop ebp
ret 4