Function at 0x407610
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov ecx, dword [0x5f5228]
mov eax, dword [0x5f522c]
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp + 0x14]
push ebx
mov dword [ebp - 4], eax
movzx eax, word [edx*2 + 0x416ca8]
movzx edx, word [ecx*2 + 0x416ca8]
push esi
push edi
mov edi, dword [0x5f5230]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], edx
mov ebx, dword [0x5ed1f4]
cmp edi, dword [ebp + 0x10]
jae 0x4076c4
cmp ebx, dword [0x5ed1f0]
jae 0x407668
mov al, byte [ebx + 0x5ed1f8]
inc ebx
jmp 0x4076ac
mov esi, dword [0x5ed1ec]
cmp esi, 8
jb 0x407721
mov esi, 8
mov eax, dword [0x5ed1dc]
sub dword [0x5ed1ec], esi
push esi
push eax
push 0x5ed1f8
mov ebx, 1
mov dword [0x5ed1f0], esi
call fcn.0040cb60
mov al, byte [0x5ed1f8]
add esp, 0xc
add dword [0x5ed1dc], esi
movzx edx, al
mov ecx, edi
shl edx, cl
add edi, 8
or dword [ebp - 4], edx
cmp edi, dword [ebp + 0x10]
jb 0x407657
mov dword [0x5ed1f4], ebx
mov eax, dword [ebp - 0x1c]
and eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
lea eax, [eax + eax*2]
movzx edx, byte [ecx + eax*4 + 4]
lea eax, [ecx + eax*4]
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], edx
cmp edx, 0x10
jbe 0x4077ba
cmp edx, 0x63
je 0x407cc9
movzx ecx, byte [eax + 5]
shr dword [ebp - 4], cl
sub edx, 0x10
sub edi, ecx
mov dword [ebp - 0x10], edx
cmp edi, edx
jae 0x40778f
mov esi, dword [0x5ed1ec]
lea ecx, [ecx]
cmp ebx, dword [0x5ed1f0]
jae 0x407730
mov al, byte [ebx + 0x5ed1f8]
inc ebx
jmp 0x407778
test esi, esi
jne 0x40767c
xor al, al
jmp 0x4076ac
cmp esi, 8
jb 0x40787d
mov esi, 8
mov edx, dword [0x5ed1dc]
sub dword [0x5ed1ec], esi
push esi
push edx
push 0x5ed1f8
mov ebx, 1
mov dword [0x5ed1f0], esi
call fcn.0040cb60
mov al, byte [0x5ed1f8]
mov edx, dword [ebp - 0x10]
add esp, 0xc
add dword [0x5ed1dc], esi
mov esi, dword [0x5ed1ec]
movzx eax, al
mov ecx, edi
shl eax, cl
add edi, 8
or dword [ebp - 4], eax
cmp edi, edx
jb 0x407710
mov dword [0x5ed1f4], ebx
movzx eax, word [edx*2 + 0x416ca8]
and eax, dword [ebp - 4]
mov edx, dword [ebp - 8]
lea ecx, [eax + eax*2]
mov eax, dword [edx + 8]
movzx edx, byte [eax + ecx*4 + 4]
lea eax, [eax + ecx*4]
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], edx
cmp edx, 0x10
ja 0x4076e7
movzx ecx, byte [eax + 5]
shr dword [ebp - 4], cl
movzx ecx, byte [eax + 5]
sub edi, ecx
cmp edx, 0x10
jne 0x40788c
mov cl, byte [eax + 8]
mov eax, dword [ebp - 0xc]
mov byte [eax + 0x5ed200], cl
inc eax
mov dword [ebp - 0xc], eax
cmp eax, 0x8000
jne 0x407652
mov ebx, dword [0x5f5234]
mov edx, dword [0x5f520c]
mov dword [ebp - 0x10], edx
test ebx, ebx
je 0x407828
mov esi, ebx
cmp ebx, eax
jb 0x407806
mov esi, eax
mov eax, dword [0x5f5238]
push esi
push 0x5ed200
push eax
call fcn.0040cb60
sub ebx, esi
add esp, 0xc
add dword [0x5f5238], esi
mov dword [0x5f5234], ebx
mov ecx, dword [ebp - 0xc]
jcxz 0x40784d
mov esi, 0x5ed200
mov ebx, dword [ebp - 0x10]
lodsb al, byte [esi]
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x5f5240]
loop 0x407836
mov dword [ebp - 0x10], ebx
mov eax, dword [0x5f5208]
mov ecx, dword [ebp - 0x10]
add eax, 0x8000
mov dword [0x5f520c], ecx
mov dword [0x5f5208], eax
cmp eax, dword [0x5f5200]
ja 0x407cc0
mov dword [ebp - 0xc], 0
jmp 0x40764c
test esi, esi
jne 0x40773e
xor al, al
jmp 0x407778
cmp edx, 0xf
je 0x407ca8
cmp edi, edx
jae 0x407914
lea esp, [esp]
cmp ebx, dword [0x5ed1f0]
jae 0x4078b1
mov cl, byte [ebx + 0x5ed1f8]
inc ebx
jmp 0x4078fd
mov esi, dword [0x5ed1ec]
cmp esi, 8
jb 0x407951
mov esi, 8
mov edx, dword [0x5ed1dc]
sub dword [0x5ed1ec], esi
push esi
push edx
push 0x5ed1f8
mov ebx, 1
mov dword [0x5ed1f0], esi
call fcn.0040cb60
mov cl, byte [0x5ed1f8]
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
add esp, 0xc
add dword [0x5ed1dc], esi
movzx esi, cl
mov ecx, edi
shl esi, cl
add edi, 8
or dword [ebp - 4], esi
cmp edi, edx
jb 0x4078a0
mov dword [0x5ed1f4], ebx
movzx ecx, word [edx*2 + 0x416ca8]
and ecx, dword [ebp - 4]
movzx eax, word [eax + 8]
add ecx, eax
mov dword [ebp - 0x14], ecx
mov ecx, edx
shr dword [ebp - 4], cl
sub edi, edx
cmp edi, dword [ebp + 0x14]
jae 0x4079ba
mov esi, dword [0x5ed1ec]
mov edi, edi
cmp ebx, dword [0x5ed1f0]
jae 0x40795d
mov al, byte [ebx + 0x5ed1f8]
inc ebx
jmp 0x4079a2
test esi, esi
jne 0x4078c5
xor cl, cl
jmp 0x4078fd
cmp esi, 8
jb 0x407a17
mov esi, 8
mov ecx, dword [0x5ed1dc]
sub dword [0x5ed1ec], esi
push esi
push ecx
push 0x5ed1f8
mov ebx, 1
mov dword [0x5ed1f0], esi
call fcn.0040cb60
mov al, byte [0x5ed1f8]
add esp, 0xc
add dword [0x5ed1dc], esi
mov esi, dword [0x5ed1ec]
movzx edx, al
mov ecx, edi
shl edx, cl
add edi, 8
or dword [ebp - 4], edx
cmp edi, dword [ebp + 0x14]
jb 0x407940
mov dword [0x5ed1f4], ebx
mov eax, dword [ebp - 0x20]
and eax, dword [ebp - 4]
mov ecx, dword [ebp + 0xc]
lea eax, [eax + eax*2]
movzx edx, byte [ecx + eax*4 + 4]
lea eax, [ecx + eax*4]
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], edx
cmp edx, 0x10
jbe 0x407ab0
lea ecx, [ecx]
cmp edx, 0x63
je 0x407cc9
movzx ecx, byte [eax + 5]
shr dword [ebp - 4], cl
sub edx, 0x10
sub edi, ecx
mov dword [ebp - 0x10], edx
cmp edi, edx
jae 0x407a85
mov esi, dword [0x5ed1ec]
cmp ebx, dword [0x5ed1f0]
jae 0x407a26
mov al, byte [ebx + 0x5ed1f8]
inc ebx
jmp 0x407a6e
test esi, esi
jne 0x40796b
xor al, al
jmp 0x4079a2
cmp esi, 8
jb 0x407ae1
mov esi, 8
mov edx, dword [0x5ed1dc]
sub dword [0x5ed1ec], esi
push esi
push edx
push 0x5ed1f8
mov ebx, 1
mov dword [0x5ed1f0], esi
call fcn.0040cb60
mov al, byte [0x5ed1f8]
mov edx, dword [ebp - 0x10]
add esp, 0xc
add dword [0x5ed1dc], esi
mov esi, dword [0x5ed1ec]
movzx eax, al
mov ecx, edi
shl eax, cl
add edi, 8
or dword [ebp - 4], eax
cmp edi, edx
jb 0x407a06
mov dword [0x5ed1f4], ebx
movzx eax, word [edx*2 + 0x416ca8]
and eax, dword [ebp - 4]
mov edx, dword [ebp - 8]
lea ecx, [eax + eax*2]
mov eax, dword [edx + 8]
movzx edx, byte [eax + ecx*4 + 4]
lea eax, [eax + ecx*4]
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], edx
cmp edx, 0x10
ja 0x4079e0
movzx ecx, byte [eax + 5]
shr dword [ebp - 4], cl
sub edi, ecx
mov dword [ebp - 0x18], edi
cmp edi, edx
jae 0x407b4f
mov esi, dword [0x5ed1ec]
lea ebx, [ebx]
cmp ebx, dword [0x5ed1f0]
jae 0x407aed
mov al, byte [ebx + 0x5ed1f8]
inc ebx
jmp 0x407b35
test esi, esi
jne 0x407a34
xor al, al
jmp 0x407a6e
cmp esi, 8
jb 0x407bc8
mov esi, 8
mov ecx, dword [0x5ed1dc]
sub dword [0x5ed1ec], esi
push esi
push ecx
push 0x5ed1f8
mov ebx, 1
mov dword [0x5ed1f0], esi
call fcn.0040cb60
mov al, byte [0x5ed1f8]
mov edx, dword [ebp - 0x10]
add esp, 0xc
add dword [0x5ed1dc], esi
mov esi, dword [0x5ed1ec]
movzx eax, al
mov ecx, edi
shl eax, cl
add edi, 8
or dword [ebp - 4], eax
cmp edi, edx
jb 0x407ad0
mov dword [ebp - 0x18], edi
mov dword [0x5ed1f4], ebx
mov ecx, dword [ebp - 0x10]
movzx edx, word [ecx*2 + 0x416ca8]
mov eax, dword [ebp - 4]
mov ebx, dword [ebp - 0xc]
and edx, eax
mov edi, ebx
sub edi, edx
mov edx, dword [ebp - 8]
movzx edx, word [edx + 8]
shr eax, cl
sub edi, edx
sub dword [ebp - 0x18], ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], eax
lea ebx, [ebx]
and edi, 0x7fff
mov eax, edi
cmp edi, ebx
ja 0x407b8e
mov eax, ebx
mov esi, 0x8000
sub esi, eax
cmp esi, ecx
jbe 0x407b9b
mov esi, ecx
mov eax, ebx
sub ecx, esi
sub eax, edi
mov dword [ebp - 0x14], ecx
cmp eax, esi
jb 0x407be0
push esi
lea ecx, [edi + 0x5ed200]
push ecx
lea edx, [ebx + 0x5ed200]
push edx
call fcn.0040cb60
mov ecx, dword [ebp - 0x14]
add esp, 0xc
add ebx, esi
add edi, esi
jmp 0x407bf3
test esi, esi
jne 0x407afb
xor al, al
jmp 0x407b35
mov al, byte [edi + 0x5ed200]
mov byte [ebx + 0x5ed200], al
inc ebx
inc edi
sub esi, 1
jne 0x407be0
mov dword [ebp - 0xc], ebx
cmp ebx, 0x8000
jne 0x407c98
mov ebx, dword [0x5f5234]
mov ecx, dword [0x5f520c]
mov dword [ebp - 8], ecx
test ebx, ebx
je 0x407c47
mov esi, ebx
cmp ebx, 0x8000
jb 0x407c24
mov esi, 0x8000
mov edx, dword [0x5f5238]
push esi
push 0x5ed200
push edx
call fcn.0040cb60
sub ebx, esi
add esp, 0xc
add dword [0x5f5238], esi
mov dword [0x5f5234], ebx
mov ecx, dword [ebp - 0xc]
jcxz 0x407c6c
mov esi, 0x5ed200
mov ebx, dword [ebp - 8]
lodsb al, byte [esi]
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x5f5240]
loop 0x407c55
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 8]
mov dword [0x5f520c], eax
mov eax, dword [0x5f5208]
add eax, 0x8000
mov dword [0x5f5208], eax
cmp eax, dword [0x5f5200]
ja 0x407cc0
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0xc], 0
mov ebx, dword [ebp - 0xc]
test ecx, ecx
jne 0x407b80
mov edi, dword [ebp - 0x18]
jmp 0x40764c
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 4]
mov dword [0x5f5228], ecx
mov dword [0x5f522c], edx
mov dword [0x5f5230], edi
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret