Function at 0x401fb0
Capabilities:
Encode data using xor

Disassembly:
push ebx
push ebp
push esi
mov esi, dword [esp + 0x10]
shl esi, 7
add esi, 0x521fc0
push edi
mov eax, dword [esi + 0x14]
mov ebp, dword [esi + 0xc]
mov edi, dword [esi + 0x1c]
mov ecx, dword [esi + 0x18]
add ebp, eax
mov ebx, dword [esi + 0x10]
add eax, edi
add ebx, ecx
mov dword [esi + 0x14], eax
mov eax, dword [esi + 0x20]
add eax, ecx
mov dword [esi + 0xc], ebp
mov dword [esi + 0x18], eax
mov eax, dword [esi + 0x30]
cmp eax, 0x4000
mov dword [esi + 0x10], ebx
jl 0x40204d
lea ecx, [eax - 0x4000]
mov eax, ecx
shl eax, 5
sub eax, ecx
lea edx, [eax + eax*2]
lea eax, [ecx + edx*4]
mov ecx, dword [eax*4 + 0x54b6ec]
mov edx, ebp
lea edi, [eax*4 + 0x54b6e0]
mov eax, edx
sub eax, ecx
test eax, eax
jg 0x402020
sub ecx, edx
mov eax, ecx
mov ecx, dword [esi + 0x10]
mov edi, dword [edi + 0x10]
mov ebp, ecx
sub ebp, edi
test ebp, ebp
jle 0x402032
mov edi, ebp
jmp 0x402034
sub edi, ecx
cmp eax, 0x12c0000
jg 0x402043
cmp edi, 0x960000
jle 0x4020a1
mov byte [esi + 0x41], 0xa
mov byte [esi + 0x3c], 0
jmp 0x4020a1
mov edx, dword [esi + 0xc]
shl eax, 7
add eax, 0x521fc0
mov ecx, edx
mov ebx, eax
mov edi, dword [ebx + 0xc]
sub ecx, edi
test ecx, ecx
jle 0x402069
mov edi, ecx
jmp 0x40206b
sub edi, edx
mov ecx, dword [esi + 0x10]
mov ebp, dword [ebx + 0x10]
mov eax, ecx
sub eax, ebp
test eax, eax
jg 0x40207d
sub ebp, ecx
mov eax, ebp
cmp byte [ebx + 0x41], 3
je 0x402092
cmp edi, 0x12c0000
jg 0x402092
cmp eax, 0x960000
jle 0x4020a1
mov byte [esi + 0x41], 0xa
mov byte [esi + 0x3c], 0
mov dword [esi + 0x24], 0
push ecx
push edx
call fcn.00418560
mov ebx, eax
add esp, 8
cmp ebx, 1
jne 0x402274
cmp dword [0x589d70], 9
jne 0x402248
cmp dword [esi + 0x58], 4
jbe 0x402248
cmp dword [esi + 0x54], 8
jge 0x402248
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 0xc]
mov ecx, dword [esi + 0x1c]
sub edx, eax
mov dword [esi + 0xc], edx
mov dl, byte [esi + 0x45]
neg eax
neg ecx
neg dl
mov dword [esi + 0x14], eax
mov dword [esi + 0x1c], ecx
mov byte [esi + 0x45], dl
mov eax, dword [0x58bbb0]
mov cl, al
sub al, 0x2c
add cl, 4
and eax, 0xff
and ecx, 0xff
mov eax, dword [eax + 0x58be00]
mov dword [0x58bbb0], ecx
mov edx, dword [ecx + 0x58be00]
xor edx, eax
and eax, 0x7fff
sub eax, 0x3fff
mov dword [ecx + 0x58be00], edx
mov edx, dword [esi + 0x18]
shl eax, 4
sub eax, edx
cmp eax, 0xfff80000
mov dword [esi + 0x18], eax
jge 0x40214d
mov dword [esi + 0x18], 0xfff80000
jmp 0x40215b
cmp eax, 0x80000
jle 0x40215b
mov dword [esi + 0x18], 0x80000
mov ecx, dword [0x58bbb0]
xor edi, edi
mov al, cl
sub cl, 0x2c
add al, 4
and ecx, 0xff
and eax, 0xff
mov ecx, dword [ecx + 0x58be00]
mov dword [0x58bbb0], eax
mov ebp, dword [eax + 0x58be00]
xor ebp, ecx
and ecx, 7
add ecx, 8
mov dword [eax + 0x58be00], ebp
test ecx, ecx
jle 0x4021eb
movsx edx, byte [esi + 0x45]
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0xc]
neg edx
push edx
push eax
push ecx
call fcn.0042f080
mov ecx, dword [0x58bbb0]
add esp, 0xc
mov al, cl
sub cl, 0x2c
add al, 4
and ecx, 0xff
and eax, 0xff
inc edi
mov ecx, dword [ecx + 0x58be00]
mov dword [0x58bbb0], eax
mov ebp, dword [eax + 0x58be00]
xor ebp, ecx
and ecx, 7
add ecx, 8
mov dword [eax + 0x58be00], ebp
cmp edi, ecx
jl 0x402198
mov dl, al
sub al, 0x2c
add dl, 4
and eax, 0xff
and edx, 0xff
push 0
mov eax, dword [eax + 0x58be00]
mov ecx, edx
mov dword [0x58bbb0], ecx
push 0
mov edx, dword [ecx + 0x58be00]
xor edx, eax
and eax, 3
mov dword [ecx + 0x58be00], edx
mov ecx, dword [esi + 0x10]
mov eax, dword [eax*4 + 0x484030]
mov edx, dword [esi + 0xc]
push eax
push ecx
push edx
call fcn.00452de0
mov eax, dword [esi + 0x54]
add esp, 0x14
inc eax
mov dword [esi + 0x58], 0
mov dword [esi + 0x54], eax
jmp 0x402274
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0xc]
push 0
push pe_nt_image_headers32
push 8
push eax
push ecx
mov byte [esi + 0x41], 0xa
mov byte [esi + 0x3c], 0
mov dword [esi + 0x24], 0
mov byte [esi + 0x3b], 0
call fcn.00452de0
add esp, 0x14
mov ecx, dword [esi + 0x58]
inc ecx
cmp ebx, 0xfffffffe
mov dword [esi + 0x58], ecx
jne 0x402284
mov byte [esi + 0x41], 3
mov edx, dword [esi + 0x24]
inc edx
mov eax, edx
mov dword [esi + 0x24], edx
test al, 3
jne 0x4022b6
mov bl, byte [esi + 0x3c]
xor edx, edx
mov dx, word [esi + 0x34]
inc bl
mov cl, bl
xor edi, edi
movsx ecx, cl
mov byte [esi + 0x3c], bl
mov di, word [edx*8 + 0x520f40]
cmp ecx, edi
jl 0x4022b6
mov byte [esi + 0x3c], 0
movsx ecx, byte [esi + 0x3c]
xor edx, edx
xor edi, edi
mov dx, word [esi + 0x34]
cmp eax, 8
mov edx, dword [edx*8 + 0x520f44]
mov di, word [edx + ecx*2]
mov dword [esi + 0x28], edi
jle 0x402347
cmp dword [0x57e724], 1
jne 0x4022e2
and al, 7
jmp 0x4022e4
and al, 0xf
neg al
sbb eax, eax
inc eax
test eax, eax
je 0x40233a
mov eax, dword [esi + 0x10]
mov ecx, dword [0x574b44]
cmp eax, ecx
jle 0x40231d
push 0
push 0x1d
push eax
mov eax, dword [esi + 0xc]
push eax
call fcn.00422070
mov eax, dword [esp + 0x24]
add esp, 0x10
push eax
call fcn.0042e050
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
ret
mov ecx, dword [0x514a40]
mov edx, dword [esi + 0xc]
and ecx, 0xffff
add ecx, 0x45
push ecx
push eax
push edx
call fcn.00422190
add esp, 0xc
mov eax, dword [esp + 0x14]
push eax
call fcn.0042e050
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
ret