Function at 0x20004760
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x90c
mov eax, dword [0x20026464]
xor eax, esp
mov dword [esp + 0x908], eax
push ebx
push ebp
mov ebp, dword [esp + 0x91c]
push esi
mov esi, dword [esp + 0x91c]
push edi
mov edi, dword [esp + 0x928]
mov eax, esi
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], edi
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x200047a0
sub eax, edx
mov ebx, eax
cmp ebx, 1
jl 0x20004b22
test ebp, ebp
je 0x20004b22
and eax, 0x80000001
jns 0x200047c8
dec eax
or eax, 0xfffffffe
inc eax
jne 0x20004b22
push 0x100
lea ecx, [esp + 0x1c]
push 0
push ecx
call fcn.200132c0
push 0x400
lea edx, [esp + 0x128]
push 0
push edx
call fcn.200132c0
add esp, 0x18
test esi, esi
je 0x20004b22
lea ecx, [esp + 0x18]
mov eax, esi
call fcn.200046d0
mov eax, dword [0x2002b328]
cmp eax, dword [0x20026270]
jne 0x20004a07
push 0x100
push 0
push 0x20027658
call fcn.200132c0
mov eax, ebx
cdq
sub eax, edx
mov ebx, eax
sar ebx, 1
mov cl, bl
add cl, 3
add esp, 0xc
cmp ebx, 1
mov byte [0x20027658], 0
mov byte [0x20027659], 0x55
mov byte [0x2002765a], 0xaa
mov byte [0x2002765b], cl
mov byte [0x2002765c], 0x51
mov byte [0x2002765d], 0xff
jl 0x2000487d
push ebx
lea edx, [esp + 0x1c]
push edx
push 0x2002765e
call fcn.20013870
add esp, 0xc
mov eax, 1
lea edx, [ebx + 5]
xor cl, cl
cmp edx, eax
jl 0x2000489b
jmp 0x20004890
xor cl, byte [eax + 0x20027658]
inc eax
cmp eax, edx
jle 0x20004890
push 0x1000
push 0
push 0x20028760
mov byte [ebx + 0x2002765e], cl
call fcn.200132c0
add esp, 0xc
call fcn.20003b30
cmp byte [0x20028764], 0x51
jne 0x200049fd
cmp byte [0x20028765], 0xff
jne 0x200049fd
movzx eax, byte [0x20028763]
add eax, 0xfffffffd
cmp eax, 0xf8
mov byte [0x2002a10e], 1
mov dword [edi], eax
lea ebx, [eax + 1]
jle 0x20004950
mov ebx, pe_nt_image_headers32
mov dword [edi], 0x107
push 0x3b
lea ecx, [esp + 0x11c]
push 0x20028766
push ecx
call fcn.20013870
sub ebx, 0x3b
add esp, 0xc
test ebx, ebx
jle 0x2000498d
lea ebp, [esp + 0x153]
push 0x1000
push 0
push 0x20028760
call fcn.200132c0
add esp, 0xc
call fcn.20003a10
cmp ebx, 0x40
jg 0x2000496d
push ebx
push 0x20028761
push ebp
call fcn.20013870
add esp, 0xc
jmp 0x2000497f
cmp ebx, 0x3b
jg 0x200048fc
push ebx
lea eax, [esp + 0x11c]
push 0x20028766
push eax
call fcn.20013870
add esp, 0xc
jmp 0x2000498d
mov ecx, 0x10
mov esi, 0x20028761
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x10]
sub ebx, 0x40
add ebp, 0x40
test ebx, ebx
jg 0x20004921
mov ebp, dword [esp + 0x14]
mov byte [0x2002a10e], 0
xor ecx, ecx
cmp dword [edi], 0x107
jne 0x200049df
mov eax, 0x107
mov dl, 0x90
cmp byte [esp + eax + 0x118], 0
je 0x200049c2
cmp byte [esp + eax + 0x117], 0
jne 0x200049c2
cmp byte [esp + eax + 0x116], dl
je 0x200049ca
dec eax
cmp eax, 3
jge 0x200049a5
jmp 0x200049cd
lea ecx, [eax - 1]
cmp eax, 3
jne 0x200049dc
mov eax, 0xfffffffd
jmp 0x20004b24
inc ecx
mov dword [edi], ecx
mov edx, dword [edi]
push edx
lea eax, [esp + 0x11c]
push eax
push ebp
call fcn.20013870
add esp, 0xc
mov eax, 1
jmp 0x20004b24
mov eax, 0xfffffffe
jmp 0x20004b24
mov ebp, dword [0x2002a224]
cmp ebp, 1
jne 0x200049d2
push 0x3ff
lea ecx, [esp + 0x11d]
push 0
push ecx
mov byte [esp + 0x124], 0
call fcn.200132c0
push 0x3fe
lea edx, [esp + 0x52a]
push 0
push edx
mov byte [esp + 0x530], 0x51
mov byte [esp + 0x531], 0xff
call fcn.200132c0
mov eax, ebx
cdq
sub eax, edx
mov esi, eax
sar esi, 1
add esp, 0x18
cmp esi, ebp
jl 0x20004a78
push esi
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x522]
push ecx
call fcn.20013870
add esp, 0xc
mov ecx, dword [0x2002a21c]
lea edx, [esi + 2]
push edx
mov edx, dword [0x2002a220]
lea eax, [esp + 0x51c]
push eax
sub esp, 0xc
mov eax, esp
mov dword [eax], ecx
mov dword [eax + 4], edx
mov dword [eax + 8], ebp
call fcn.20004060
add esi, 6
add esp, 0x14
mov dword [esp + 0x10], eax
cmp eax, esi
jne 0x20004b24
mov edx, dword [0x2002a21c]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x11c]
push ecx
mov ecx, dword [0x2002a220]
sub esp, 0xc
mov eax, esp
mov dword [eax], edx
mov edx, dword [0x2002a224]
mov dword [eax + 4], ecx
mov dword [eax + 8], edx
call fcn.20004150
add esp, 0x14
test eax, eax
jne 0x20004b22
cmp byte [esp + 0x118], 0x51
jne 0x20004b22
cmp byte [esp + 0x119], 0xff
jne 0x20004b22
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
add eax, 0xfffffffd
push eax
mov dword [edi], eax
lea eax, [esp + 0x11e]
push eax
push ecx
call fcn.20013870
add esp, 0xc
mov eax, 1
jmp 0x20004b24
xor eax, eax
mov ecx, dword [esp + 0x918]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.20012ef0
add esp, 0x90c
ret 0xc