Function at 0x51a6d8
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffe98
push ebx
push esi
push edi
xor ecx, ecx
mov dword [ebp - 0x168], ecx
mov dword [ebp - 0x154], ecx
mov dword [ebp - 0x150], ecx
mov dword [ebp - 0x144], ecx
mov dword [ebp - 4], edx
xor eax, eax
push ebp
push 0x51ad48
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov edx, dword [0x51a128]
call fcn.00405cdc
push 0x64
mov eax, dword [ebp - 4]
mov ecx, 1
mov edx, dword [0x51a128]
call fcn.00406628
add esp, 4
xor eax, eax
mov dword [ebp - 0x18], eax
mov eax, dword [0x5cf9e4]
cmp dword [eax], 2
jne 0x51ad14
call fcn.0051a538
xor eax, eax
mov dword [ebp - 8], eax
mov dword [ebp - 0x20], pe_nt_image_headers32
mov eax, dword [ebp - 0x20]
shl eax, 4
call fcn.00402f10
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x51ad0d
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 8]
push eax
push 0x10
mov eax, dword [0x5cf5e4]
mov eax, dword [eax]
call eax
mov dword [ebp - 0x10], eax
jmp 0x51a7fd
mov eax, dword [ebp - 0x24]
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 0x20]
add eax, eax
xor edx, edx
cmp edx, dword [esp + 4]
jne 0x51a7ae
cmp eax, dword [esp]
pop edx
pop eax
jae 0x51a7bf
jmp 0x51a7b2
pop edx
pop eax
jge 0x51a7bf
mov eax, dword [ebp - 0x24]
xor edx, edx
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], edx
jmp 0x51a7cc
mov eax, dword [ebp - 0x20]
add eax, eax
xor edx, edx
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x20], eax
mov edx, dword [ebp - 0x20]
shl edx, 4
lea eax, [ebp - 8]
call fcn.00402f5c
lea eax, [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x20]
shl eax, 4
push eax
mov eax, dword [ebp - 8]
push eax
push 0x10
mov eax, dword [0x5cf5e4]
mov eax, dword [eax]
call eax
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0x80000005
je 0x51a791
cmp dword [ebp - 0x10], 0xc0000004
je 0x51a791
cmp dword [ebp - 0x10], 0
jne 0x51acf7
xor eax, eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 8]
add eax, 4
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
call fcn.00402f10
mov dword [ebp - 0xc], eax
xor eax, eax
push ebp
push 0x51acf0
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 0x10], eax
mov eax, dword [0x5cf670]
cmp byte [eax], 0
je 0x51a865
mov eax, dword [ebp - 0x1c]
cmp dword [eax], 2
jne 0x51a865
mov eax, dword [ebp - 0x1c]
cmp word [eax + 4], 0x10
je 0x51aca0
mov eax, dword [ebp - 0x1c]
cmp word [eax + 6], 0
jbe 0x51aca0
mov eax, dword [ebp - 4]
mov eax, dword [eax]
call fcn.0040646c
cdq
push edx
push eax
mov eax, dword [ebp - 0x18]
xor edx, edx
cmp edx, dword [esp + 4]
jne 0x51a88e
cmp eax, dword [esp]
pop edx
pop eax
jne 0x51a8b6
mov eax, dword [ebp - 4]
mov eax, dword [eax]
call fcn.0040646c
add eax, 0x64
push eax
mov eax, dword [ebp - 4]
mov ecx, 1
mov edx, dword [0x51a128]
call fcn.00406628
add esp, 4
mov eax, dword [ebp - 0x18]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 4]
mov edx, dword [edx]
lea eax, [edx + eax*8]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
mov edx, dword [ebp - 0x30]
mov dword [edx], eax
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 6]
mov edx, dword [ebp - 0x30]
mov word [edx + 4], ax
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0xc]
mov edx, dword [ebp - 0x30]
mov dword [edx + 8], eax
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 4]
mov edx, dword [ebp - 0x30]
mov word [edx + 6], ax
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 8]
mov edx, dword [ebp - 0x30]
mov dword [edx + 0xc], eax
xor eax, eax
push ebp
push 0x51a981
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 0x1c]
movzx ebx, word [eax + 4]
cmp bx, 0x1b
jbe 0x51a95c
lea eax, [ebp - 0x144]
push eax
movzx eax, bx
mov dword [ebp - 0x14c], eax
mov byte [ebp - 0x148], 0
lea edx, [ebp - 0x14c]
xor ecx, ecx
mov eax, 0x51ad60
call fcn.0040b9ac
mov edx, dword [ebp - 0x144]
mov eax, dword [ebp - 0x30]
add eax, 0x14
call fcn.00404e84
jmp 0x51a977
mov eax, dword [ebp - 0x30]
add eax, 0x14
mov edx, dword [ebp - 0x1c]
movzx edx, byte [edx + 4]
mov ecx, dword [0x5cf1d8]
mov edx, dword [ecx + edx*4]
call fcn.00404e84
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x51a98b
call fcn.004077ac
mov edx, dword [ebp - 0x1c]
cmp eax, dword [edx]
je 0x51a9d3
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
push eax
push 0
push 0x40
call fcn.00407984
mov dword [ebp - 0x28], eax
push 2
push 0
push 0
lea eax, [ebp - 0x2c]
push eax
call fcn.004077a4
push eax
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 6]
push eax
mov eax, dword [ebp - 0x28]
push eax
mov eax, dword [0x5ceff8]
mov eax, dword [eax]
call eax
mov dword [ebp - 0x10], eax
jmp 0x51a9dd
mov eax, dword [ebp - 0x1c]
movzx eax, word [eax + 6]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x10], 0
jne 0x51ac9d
lea eax, [ebp - 0x20]
push eax
push 0
push 0
push 2
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [0x5cf4f0]
mov eax, dword [eax]
call eax
lea eax, [ebp - 0xc]
mov edx, dword [ebp - 0x20]
call fcn.00402f5c
push 0
mov eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 0xc]
push eax
push 2
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [0x5cf4f0]
mov eax, dword [eax]
call eax
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x51aa3c
mov eax, dword [ebp - 0x30]
add eax, 0x14
mov edx, dword [ebp - 0xc]
mov edx, dword [edx + 4]
call fcn.00405058
xor ebx, ebx
mov esi, dword [0x5cf1d8]
mov edx, dword [esi]
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0x14]
call fcn.00409d8c
test al, al
je 0x51aa5f
movzx eax, bl
mov edx, dword [ebp - 0x30]
mov word [edx + 6], ax
inc ebx
add esi, 4
cmp bl, 0x1b
jne 0x51aa44
mov eax, dword [ebp - 0x30]
add eax, 0x10
call fcn.00404e30
mov eax, dword [ebp - 0x30]
movzx eax, byte [eax + 6]
sub al, 5
je 0x51aa93
dec al
je 0x51ab0d
sub al, 0x14
je 0x51ab9a
jmp 0x51ac1e
mov dword [ebp - 0x20], 0x18
lea eax, [ebp - 0xc]
mov edx, dword [ebp - 0x20]
call fcn.00402f5c
push 0
mov eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 0xc]
push eax
push 0
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [0x5cf304]
mov eax, dword [eax]
call eax
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x51ac7b
lea eax, [ebp - 0x150]
push eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x14c], eax
mov byte [ebp - 0x148], 0
lea edx, [ebp - 0x14c]
xor ecx, ecx
mov eax, 0x51ad78
call fcn.0040b9ac
mov edx, dword [ebp - 0x150]
mov eax, dword [ebp - 0x30]
add eax, 0x10
call fcn.00404e84
jmp 0x51ac7b
mov dword [ebp - 0x20], 0x1c
lea eax, [ebp - 0xc]
mov edx, dword [ebp - 0x20]
call fcn.00402f5c
push 0
mov eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 0xc]
push eax
push 0
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [0x5cf9c0]
mov eax, dword [eax]
call eax
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x51ac7b
lea eax, [ebp - 0x154]
push eax
mov ebx, dword [ebp - 0xc]
mov eax, dword [ebx + 0xc]
mov dword [ebp - 0x164], eax
mov byte [ebp - 0x160], 0
mov eax, dword [ebx + 8]
mov dword [ebp - 0x15c], eax
mov byte [ebp - 0x158], 0
lea edx, [ebp - 0x164]
mov ecx, 1
mov eax, 0x51ad88
call fcn.0040b9ac
mov edx, dword [ebp - 0x154]
mov eax, dword [ebp - 0x30]
add eax, 0x10
call fcn.00404e84
jmp 0x51ac7b
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x140], eax
lea eax, [ebp - 0x140]
push eax
push 0
lea eax, [ebp - 0x20]
push eax
mov ecx, 0x51a400
xor edx, edx
xor eax, eax
call fcn.00404dd0
mov ebx, eax
push 0x64
push ebx
call fcn.00407a34
cmp eax, 0x102
jne 0x51abd7
push 0
push ebx
call fcn.00407a14
mov eax, dword [ebp - 0x30]
add eax, 0x10
lea edx, [ebp - 0x13c]
mov ecx, pe_nt_image_headers32
call fcn.004050a0
mov eax, dword [ebp - 0x30]
cmp dword [eax + 0x10], 0
je 0x51ac7b
lea edx, [ebp - 0x168]
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0x10]
call fcn.004b0be0
mov edx, dword [ebp - 0x168]
mov eax, dword [ebp - 0x30]
add eax, 0x10
call fcn.00404e84
jmp 0x51ac7b
lea eax, [ebp - 0x20]
push eax
push 0
push 0
push 1
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [0x5cf4f0]
mov eax, dword [eax]
call eax
lea eax, [ebp - 0xc]
mov edx, dword [ebp - 0x20]
call fcn.00402f5c
push 0
mov eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 0xc]
push eax
push 1
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [0x5cf4f0]
mov eax, dword [eax]
call eax
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x51ac7b
mov eax, dword [ebp - 0xc]
cmp dword [eax], 0
jbe 0x51ac7b
mov eax, dword [ebp - 0x30]
lea edx, [eax + 0x10]
mov eax, dword [ebp - 0xc]
add eax, 8
call fcn.00406040
call fcn.004077ac
mov edx, dword [ebp - 0x1c]
cmp eax, dword [edx]
je 0x51ac9d
mov eax, dword [ebp - 0x28]
push eax
call fcn.0040768c
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [0x5cf218]
mov eax, dword [eax]
call eax
inc dword [ebp - 0x18]
inc dword [ebp - 0x14]
mov eax, dword [ebp - 8]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x14]
jb 0x51acc0
mov eax, dword [ebp - 0x1c]
add eax, 0x10
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x51a840
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51acf7
mov eax, dword [ebp - 0xc]
call fcn.00402f44
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 4]
mov ecx, 1
mov edx, dword [0x51a128]
call fcn.00406628
add esp, 4
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51ad14
mov eax, dword [ebp - 8]
call fcn.00402f44
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51ad4f
lea eax, [ebp - 0x168]
call fcn.00404e30
lea eax, [ebp - 0x154]
mov edx, 2
call fcn.00404e54
lea eax, [ebp - 0x144]
call fcn.00404e30
ret