Function at 0x407870
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b0
call fcn.004082c0
mov edi, edx
mov ebp, ecx
mov esi, dword [esp + 0x15c4]
lea eax, [esp + 0x2c]
push 0x84
push 0
push eax
call fcn.00408600
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov dword [esp + 0x18], edi
je 0x40793c
test esi, esi
mov ecx, esi
jle 0x4080bb
xor eax, eax
cmp ecx, 1
je 0x407908
mov ecx, dword [esp + 0x15c4]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + ebp]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x2c]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x2c]
add eax, 2
cmp ecx, eax
jne 0x4078f0
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x4080bb
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, ebp
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c4]
inc dword [esp + eax*4 + 0x2c]
jmp 0x4080bb
lea eax, [edi + edi*8]
mov dword [esp + 0x24], eax
shl eax, 6
mov dword [esp + 0x10], eax
test esi, esi
mov dword [esp + 0x14], ebp
jle 0x407a39
cmp esi, 1
jne 0x407c8e
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x407995
mov ecx, dword [esp + 0x10]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x407995
mov word [esp + ebx*4 + 0x4b0], cx
mov word [esp + ebx*4 + 0x4b2], ax
inc ebx
lea eax, [esp + 0x930]
push 0x800
push 0
push eax
call fcn.00408600
add esp, 0xc
test ebx, ebx
sete byte [esp + 3]
je 0x407a50
xor eax, eax
cmp ebx, 1
je 0x407a0f
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b0]
movzx esi, dl
inc dword [esp + esi*4 + 0x930]
shr edx, 8
inc dword [esp + edx*4 + 0xd30]
movzx edx, word [esp + eax*4 + 0x4b4]
movzx esi, dl
inc dword [esp + esi*4 + 0x930]
shr edx, 8
inc dword [esp + edx*4 + 0xd30]
add eax, 2
cmp ecx, eax
jne 0x4079d0
test bl, 1
je 0x407a30
movzx eax, word [esp + eax*4 + 0x4b0]
movzx ecx, al
inc dword [esp + ecx*4 + 0x930]
shr eax, 8
inc dword [esp + eax*4 + 0xd30]
mov eax, dword [esp + 0xd30]
jmp 0x407a59
lea eax, [esp + 0x930]
push 0x800
push 0
push eax
call fcn.00408600
add esp, 0xc
xor ebx, ebx
mov byte [esp + 3], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x28], ecx
mov eax, ebx
and eax, 0xfffffffe
mov dword [esp + 0x1c], eax
lea ebp, [esp + 0x4b0]
lea eax, [esp + 0x1130]
xor ecx, ecx
lea esi, [esp + 0x930]
xor edi, edi
mov dword [esp + 0xc], ebx
jmp 0x407aae
inc edi
mov ecx, dword [esp + 4]
add ecx, 8
add esi, 0x400
mov eax, ebp
cmp edi, dword [esp + 0x28]
mov ebp, dword [esp + 8]
je 0x407bcd
mov dword [esp + 4], ecx
mov dword [esp + 0x20], edi
mov dword [esp + 8], eax
mov edx, 3
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0xa4], eax
add eax, dword [esi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xa8], eax
add eax, dword [esi + edx*4 - 8]
mov dword [esp + edx*4 + 0xac], eax
add eax, dword [esi + edx*4 - 4]
mov dword [esp + edx*4 + 0xb0], eax
add eax, dword [esi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x407ad0
cmp byte [esp + 3], 0
mov edi, dword [esp + 0x20]
jne 0x407a90
xor edx, edx
cmp ebx, 1
mov edi, ebp
mov ebp, dword [esp + 8]
je 0x407b87
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [edi + edx*4]
mov ecx, dword [esp + 4]
shr eax, cl
movzx eax, al
mov ecx, dword [esp + eax*4 + 0xb0]
lea ebx, [ecx + 1]
mov dword [esp + eax*4 + 0xb0], ebx
mov eax, dword [edi + edx*4]
mov dword [ebp + ecx*4], eax
movzx eax, word [edi + edx*4 + 4]
mov ecx, dword [esp + 4]
shr eax, cl
movzx eax, al
mov ecx, dword [esp + eax*4 + 0xb0]
lea ebx, [ecx + 1]
mov dword [esp + eax*4 + 0xb0], ebx
mov eax, dword [edi + edx*4 + 4]
mov dword [ebp + ecx*4], eax
mov eax, dword [esp + 0x1c]
add edx, 2
cmp eax, edx
jne 0x407b30
mov ebp, edi
mov ebx, dword [esp + 0xc]
test bl, 1
mov edi, dword [esp + 0x20]
je 0x407a90
movzx eax, word [ebp + edx*4]
mov ecx, dword [esp + 4]
shr eax, cl
movzx eax, al
mov ecx, dword [esp + eax*4 + 0xb0]
lea ebx, [ecx + 1]
mov dword [esp + eax*4 + 0xb0], ebx
mov ebx, dword [esp + 0xc]
mov eax, dword [ebp + edx*4]
mov edx, dword [esp + 8]
mov dword [edx + ecx*4], eax
jmp 0x407a90
test ebx, ebx
je 0x407f87
cmp ebx, 1
jne 0x407be5
mov word [ebp], 1
jmp 0x407eae
movzx eax, word [ebp + 4]
add word [ebp], ax
cmp ebx, 3
jl 0x407cf5
mov eax, 2
mov ecx, 2
sub ecx, ebx
xor edx, edx
mov esi, 1
jmp 0x407c2d
movzx edi, word [ebp + eax*4]
inc eax
add word [ebp + esi*4], di
lea edi, [ecx + esi]
inc edi
inc esi
cmp edi, 1
mov ebx, dword [esp + 0xc]
je 0x407d0f
movzx edi, word [ebp + edx*4]
cmp eax, ebx
jge 0x407c40
movzx ebx, word [ebp + eax*4]
cmp di, bx
jae 0x407c70
mov word [ebp + esi*4], di
mov word [ebp + edx*4], si
inc edx
cmp eax, dword [esp + 0xc]
jge 0x407c7c
cmp edx, esi
jge 0x407c10
movzx ebx, word [ebp + edx*4]
movzx edi, word [ebp + eax*4]
cmp bx, di
jae 0x407c15
jmp 0x407c81
inc eax
mov word [ebp + esi*4], bx
cmp eax, dword [esp + 0xc]
jl 0x407c51
movzx ebx, word [ebp + edx*4]
add word [ebp + esi*4], bx
mov word [ebp + edx*4], si
inc edx
jmp 0x407c1b
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x10]
lea edx, [eax + ebp]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x407cbb
add eax, 2
cmp ecx, eax
je 0x407963
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x407cd6
mov word [esp + ebx*4 + 0x4b0], si
mov word [esp + ebx*4 + 0x4b2], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x407cb0
mov word [esp + ebx*4 + 0x4b0], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b2], si
inc ebx
jmp 0x407cb0
mov ecx, ebx
xor ecx, 2
mov eax, ebx
and eax, 0xfffffffd
add eax, eax
sub eax, ecx
mov word [ebp + eax*4], 0
jmp 0x407da5
mov ecx, ebx
xor ecx, 2
mov eax, ebx
and eax, 0xfffffffd
add eax, eax
sub eax, ecx
mov word [ebp + eax*4], 0
lea edx, [ebx - 3]
mov esi, ebx
and esi, 3
xor esi, 2
mov ecx, edx
je 0x407d54
mov ecx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp + ecx*4]
movzx edi, word [ebp + edi*4]
inc edi
mov word [ebp + ecx*4], di
dec ecx
dec esi
jne 0x407d40
cmp edx, 3
jb 0x407da5
inc ecx
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + ecx*4 - 4]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + ecx*4 - 4], dx
movzx edx, word [ebp + ecx*4 - 8]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + ecx*4 - 8], dx
movzx edx, word [ebp + ecx*4 - 0xc]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + ecx*4 - 0xc], dx
movzx edx, word [ebp + ecx*4 - 0x10]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + ecx*4 - 0x10], dx
add ecx, 0xfffffffc
jne 0x407d60
lea ecx, [ebx - 1]
mov ebp, 1
xor edx, edx
jmp 0x407de5
mov ebp, dword [esp + 4]
inc edx
mov esi, ebp
or esi, 2
mov edi, ebp
and ebp, 2
imul esi, ebp
and edi, 0xfffffffd
xor ebp, 2
imul ebp, edi
add ebp, esi
test ebp, ebp
jle 0x407ea2
test eax, eax
js 0x407e20
lea esi, [eax + 1]
mov dword [esp + 4], esi
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, dword [esp + 8]
movzx edi, word [edi + eax*4]
cmp edx, edi
jne 0x407e30
inc esi
dec eax
cmp dword [esp + 4], esi
jne 0x407e00
mov eax, 0xffffffff
mov edi, dword [esp + 4]
jmp 0x407e32
xor edi, edi
jmp 0x407e32
mov edi, esi
mov esi, ebp
mov dword [esp + 4], edi
sub esi, edi
jle 0x407dc0
and esi, 3
je 0x407e67
mov edi, dword [esp + 8]
lea edi, [edi + ecx*4]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
mov word [edi], dx
inc ebx
add edi, 0xfffffffc
cmp esi, ebx
jne 0x407e50
mov esi, ebp
sub esi, ebx
sub ecx, ebx
mov ebx, dword [esp + 0xc]
jmp 0x407e69
mov esi, ebp
mov edi, dword [esp + 4]
sub edi, ebp
mov ebp, dword [esp + 4]
cmp edi, 0xfffffffc
mov edi, dword [esp + 8]
ja 0x407dc4
mov word [edi + ecx*4], dx
mov word [edi + ecx*4 - 4], dx
mov word [edi + ecx*4 - 8], dx
mov word [edi + ecx*4 - 0xc], dx
add ecx, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebp
jg 0x407e80
jmp 0x407dc4
test ebx, ebx
mov ebp, dword [esp + 8]
jle 0x407f87
xor eax, eax
movzx ecx, word [ebp + eax*4]
inc dword [esp + ecx*4 + 0x2c]
mov ecx, eax
xor ecx, 1
and eax, 1
lea eax, [ecx + eax*2]
cmp eax, ebx
jl 0x407eb0
cmp ebx, 2
jl 0x407f87
mov edx, dword [esp + 0x15c8]
cmp edx, 0x20
jge 0x407f3c
mov eax, dword [esp + edx*4 + 0x2c]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x407efc
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
inc ecx
mov dword [esp + esi*4 + 0x2c], eax
dec edx
jne 0x407ef0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x407f38
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + edx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + edx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + edx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x3c]
add ecx, 4
mov dword [esp + edx*4 + 0x2c], eax
cmp ecx, 0x20
jne 0x407f10
test edx, edx
jle 0x407f77
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x28]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x407f50
mov edx, 1
mov ecx, dword [esp + 0x15c8]
shl edx, cl
cmp eax, edx
jne 0x40821d
jmp 0x407f87
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x40821d
mov esi, dword [esp + 0x24]
shl esi, 5
mov edi, dword [esp + 0x14]
lea eax, [edi + esi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408600
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408600
add esp, 0xc
cmp dword [esp + 0x15c8], 0
jle 0x4080b0
add ebp, 0xfffffffe
mov eax, 1
add esi, dword [esp + 0x14]
mov dword [esp + 8], ebp
jmp 0x408002
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15c8]
mov eax, ecx
je 0x4080b0
mov ecx, dword [esp + eax*4 + 0x2c]
test ecx, ecx
jle 0x407ff0
mov edx, ecx
and edx, 3
je 0x408060
mov dword [esp + 0xc], ebx
lea ebx, [ebx*4]
add ebx, ebp
mov ebp, esi
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebx]
mov byte [edi + ebp + 0x8f12], al
inc esi
add ebx, 0xfffffffc
cmp edx, esi
jne 0x408030
mov ebx, dword [esp + 0xc]
sub ebx, esi
mov edx, ecx
sub edx, esi
mov esi, ebp
mov ebp, dword [esp + 8]
cmp ecx, 4
jb 0x407ff0
jmp 0x408067
mov edx, ecx
cmp ecx, 4
jb 0x407ff0
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [ebp + ebx*4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + ebx*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + ebx*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + ebx*4 - 0xc]
add ebx, 0xfffffffc
mov byte [ecx + esi + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408070
jmp 0x407ff0
mov ecx, dword [esp + 0x15c4]
mov ebp, dword [esp + 0x14]
mov dword [esp + 0x934], 0
mov eax, dword [esp + 0x15c8]
cmp eax, 2
jl 0x40812d
lea ecx, [eax - 1]
cmp eax, 2
jne 0x4080e3
xor eax, eax
mov edx, 2
jmp 0x408114
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x938], eax
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x93c], eax
add edx, 2
cmp ebx, edx
jne 0x4080f0
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c4]
je 0x40812d
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x930], eax
test ecx, ecx
jle 0x408212
xor edx, edx
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
mov esi, eax
shl esi, 5
add esi, ebp
mov dword [esp + 0x1c], esi
shl eax, 6
add eax, ebp
mov dword [esp + 8], eax
jmp 0x408180
mov edx, dword [esp + 4]
mov eax, dword [esp + 8]
mov word [eax + edx*2 + 0x8852], di
mov ecx, dword [esp + 0x15c4]
inc edx
cmp edx, ecx
je 0x408212
mov eax, dword [esp + 0x1c]
movzx ebx, byte [edx + eax + 0x8f12]
test ebx, ebx
je 0x408177
mov dword [esp + 4], edx
mov edx, dword [esp + ebx*4 + 0x930]
lea ecx, [edx + 1]
mov dword [esp + ebx*4 + 0x930], ecx
xor edi, edi
cmp bl, 4
jb 0x4081ef
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, edx
shr ecx, 2
mov eax, edx
and eax, 2
mov esi, edx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
or esi, eax
mov eax, edx
shr eax, 3
and ecx, 1
or ecx, esi
shr edx, 4
and eax, 1
lea edi, [eax + ecx*2]
add ebp, 0xfffffffc
jne 0x4081c0
and ebx, 3
je 0x408160
mov ecx, edx
nop
nop
nop
nop
nop
nop
shr ecx, 1
and edx, 1
lea edi, [edx + edi*2]
mov edx, ecx
dec ebx
jne 0x408200
jmp 0x408160
add esp, 0x15b0
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x15c8]
dec dword [esp + ecx*4 + 0x2c]
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408248
mov esi, dword [esp + ecx*4 + 0x28]
dec ecx
test esi, esi
je 0x408230
dec esi
mov dword [esp + ecx*4 + 0x2c], esi
add dword [esp + ecx*4 + 0x30], 2
dec eax
cmp eax, edx
jne 0x40821d
jmp 0x407f87