Function at 0x505220
Capabilities:
Access peb ldr_data
Check for time delay via gettickcount

Disassembly:
push 0xffffffffffffffff
push 0x536746
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x420
push ebx
push ebp
push esi
push edi
mov edi, ecx
xor ebx, ebx
push 0xffffffffffffffff
push ebx
lea ecx, [edi + 0xc]
mov dword [esp + 0x24], edi
mov dword [edi + 0x34], 0xffffffff
call fcn.0052136b
push 0xffffffffffffffff
lea ecx, [edi + 0x20]
push ebx
call fcn.0052136b
lea ecx, [edi + 0x38]
mov dword [esp + 0x14], ecx
call fcn.0052257a
lea eax, [esp + 0x30]
mov byte [esp + 0x30], bl
mov dword [esp + 0x10], eax
mov dword [esp + 0x28], 0x400
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edx, dword [esp + 0x20]
mov ecx, dword [edi + 8]
sub eax, edx
cmp eax, ecx
ja 0x5053ac
lea ecx, [esp + 0x2c]
push ecx
mov ecx, edi
call fcn.005044b0
test eax, eax
je 0x5053cf
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x5052d2
push 0xfa
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x505292
mov ebp, dword [esp + 0x28]
sub ebp, ebx
dec ebp
jns 0x5052dd
xor ebp, ebp
mov edx, dword [esp + 0x10]
push ebp
mov ecx, edi
lea eax, [ebx + edx]
push eax
call fcn.00504470
mov esi, eax
cmp esi, 0xffffffff
je 0x5053e7
test esi, esi
je 0x505308
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x20], eax
add ebx, esi
mov ecx, dword [esp + 0x10]
cmp ebp, esi
mov byte [ebx + ecx], 0
jne 0x50536a
mov eax, dword [esp + 0x28]
add eax, 0x1000
push eax
mov dword [esp + 0x2c], eax
call fcn.00522330
mov edi, dword [esp + 0x14]
mov ebp, eax
or ecx, 0xffffffff
xor eax, eax
add esp, 4
mov dword [esp + 0x10], ebp
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, dword [esp + 0x24]
mov edx, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
test eax, eax
rep movsb byte es:[edi], byte [esi]
je 0x505362
push eax
call fcn.00522359
add esp, 4
mov edi, dword [esp + 0x1c]
mov dword [esp + 0x24], ebp
mov eax, dword [esp + 0x10]
push 0xd
push eax
call fcn.00511ca0
mov esi, eax
mov eax, dword [esp + 0x18]
add esp, 8
test esi, esi
lea ecx, [ebx + eax]
jne 0x505388
mov esi, ecx
dec esi
cmp esi, eax
jb 0x505397
cmp byte [esi], 0xa
je 0x505397
dec esi
cmp esi, eax
jae 0x50538d
add esi, 4
cmp esi, ecx
jae 0x505292
cmp byte [esi], 0x20
je 0x5053ff
jmp 0x505292
mov ecx, dword [esp + 0x14]
push 0x609080
call fcn.00522778
mov ecx, dword [esp + 0x10]
push 0x274c
mov byte [ebx + ecx], 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x505414
mov ecx, dword [esp + 0x14]
push 0x609074
call fcn.00522778
mov edx, dword [esp + 0x10]
mov byte [ebx + edx], 0
jmp 0x505414
mov ecx, dword [esp + 0x14]
push 0x609074
call fcn.00522778
mov eax, dword [esp + 0x10]
mov byte [ebx + eax], 0
jmp 0x505414
lea ecx, [esi - 3]
mov byte [esi], 0
push ecx
call fcn.00510914
mov dword [edi + 0x34], eax
add esp, 4
mov byte [esi], 0x20
cmp dword [edi + 0x34], 0xffffffff
je 0x50550f
mov esi, dword [esp + 0x10]
mov eax, esi
add ebx, eax
cmp eax, ebx
mov dword [esp + 0x1c], ebx
jae 0x50550f
push 0xd
push esi
call fcn.00511be0
add esp, 8
test eax, eax
je 0x50550f
mov edx, eax
mov ebx, eax
sub edx, esi
cmp edx, 4
jle 0x5054f6
add esi, 4
cmp eax, esi
jbe 0x505466
cmp byte [eax - 1], 0x20
ja 0x505466
dec eax
cmp eax, esi
ja 0x50545b
mov ebp, esi
mov byte [eax], 0
mov al, byte [ebp]
test al, al
je 0x50547e
cmp al, 0x20
ja 0x50547e
mov al, byte [ebp + 1]
inc ebp
test al, al
jne 0x505472
push 0x20
push ebp
call fcn.00511be0
mov esi, eax
add esp, 8
test esi, esi
jne 0x5054af
cmp byte [ebp], 0
je 0x5054f6
mov eax, dword [edi + 0x14]
lea ecx, [edi + 0xc]
push ebp
push eax
call fcn.005214b4
mov eax, dword [edi + 0x28]
lea ecx, [edi + 0x20]
push 0x661490
jmp 0x5054f0
mov dl, byte [esi - 1]
lea eax, [esi - 1]
cmp dl, 0x20
mov ecx, esi
ja 0x5054c9
mov ecx, eax
mov dl, byte [ecx - 1]
lea eax, [ecx - 1]
cmp dl, 0x20
jbe 0x5054bc
mov byte [ecx], 0
mov eax, dword [edi + 0x14]
lea ecx, [edi + 0xc]
push ebp
push eax
call fcn.005214b4
mov al, byte [esi + 1]
inc esi
cmp al, 0x20
ja 0x5054e9
mov al, byte [esi + 1]
inc esi
cmp al, 0x20
jbe 0x5054e1
mov eax, dword [edi + 0x28]
lea ecx, [edi + 0x20]
push esi
push eax
call fcn.005214b4
mov eax, dword [esp + 0x1c]
lea esi, [ebx + 1]
cmp esi, eax
jae 0x50550f
cmp byte [esi], 0xa
jne 0x505507
inc esi
cmp esi, eax
jb 0x505432
mov esi, dword [edi + 0x14]
dec esi
js 0x5055c1
lea eax, [esp + 0x1c]
push esi
push eax
lea ecx, [edi + 0xc]
call fcn.00505650
mov ebx, dword [esp + 0x14]
push eax
mov ecx, ebx
mov dword [esp + 0x43c], 0
call fcn.00522728
lea ecx, [esp + 0x1c]
mov dword [esp + 0x438], 0xffffffff
call fcn.005225ef
lea ecx, [esp + 0x1c]
push esi
lea ebp, [edi + 0x20]
push ecx
mov ecx, ebp
call fcn.00505650
mov edx, dword [eax]
mov ecx, dword [edx - 8]
test ecx, ecx
lea ecx, [esp + 0x1c]
setg byte [esp + 0x1b]
call fcn.005225ef
mov al, byte [esp + 0x1b]
test al, al
je 0x5055d8
push 0x609070
mov ecx, ebx
call fcn.005229cb
lea eax, [esp + 0x20]
push esi
push eax
mov ecx, ebp
call fcn.00505650
push eax
mov ecx, ebx
mov dword [esp + 0x43c], 1
call fcn.00522a07
lea ecx, [esp + 0x20]
mov dword [esp + 0x438], 0xffffffff
call fcn.005225ef
jmp 0x5055d8
mov eax, dword [esp + 0x10]
cmp byte [eax], 0
je 0x5055d4
mov ecx, dword [esp + 0x14]
push eax
call fcn.00522778
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
test eax, eax
je 0x5055e9
push eax
call fcn.00522359
add esp, 4
mov edi, dword [edi + 0x34]
cmp edi, 0xffffffff
jne 0x50560a
mov ecx, dword [ebx]
mov eax, dword [ecx - 8]
test eax, eax
jne 0x505606
push 0x609054
mov ecx, ebx
call fcn.00522778
xor eax, eax
jmp 0x505631
cmp edi, dword [esp + 0x440]
je 0x50562c
mov edx, dword [ebx]
mov eax, dword [edx - 8]
test eax, eax
jne 0x505628
push 0x609038
mov ecx, ebx
call fcn.00522778
xor eax, eax
jmp 0x505631
mov eax, 1
mov ecx, dword [esp + 0x430]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x42c
ret 4