Function at 0x4078c0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.004082d0
mov edi, edx
mov dword [esp + 0x10], ecx
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.00408470
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x14], edi
je 0x40798e
test esi, esi
mov ecx, esi
jle 0x4080e6
xor eax, eax
cmp ecx, 1
je 0x407958
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x14]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0x10]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x28]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x28]
add eax, 2
cmp ecx, eax
jne 0x407940
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x4080e6
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0x10]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x28]
jmp 0x4080e6
lea eax, [edi + edi*8]
mov dword [esp + 0x20], eax
mov ebx, eax
shl ebx, 6
test esi, esi
mov dword [esp + 0x24], ebx
jle 0x407a43
cmp esi, 1
jne 0x407c74
xor eax, eax
xor ebp, ebp
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x4079e5
mov ecx, dword [esp + 0x10]
add ecx, ebx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4079e5
mov word [esp + ebp*4 + 0xac], cx
mov word [esp + ebp*4 + 0xae], ax
inc ebp
lea eax, [esp + 0x92c]
push 0x800
push 0
push eax
call fcn.00408470
add esp, 0xc
test ebp, ebp
sete byte [esp + 8]
je 0x407a5a
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0xac]
mov edx, ecx
not edx
or edx, 0xff
add edx, ecx
inc dword [esp + edx*4 + 0x930]
shr ecx, 8
inc dword [esp + ecx*4 + 0xd2c]
inc eax
cmp ebp, eax
jne 0x407a10
mov eax, dword [esp + 0xd2c]
jmp 0x407a63
lea eax, [esp + 0x92c]
push 0x800
push 0
push eax
call fcn.00408470
add esp, 0xc
xor ebp, ebp
mov byte [esp + 8], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebp
setne cl
inc ecx
mov dword [esp + 0x18], ecx
lea eax, [esp + 0xac]
mov dword [esp], eax
lea eax, [esp + 0x112c]
xor ecx, ecx
lea esi, [esp + 0x92c]
xor edx, edx
mov dword [esp + 0x1c], ebp
jmp 0x407abe
mov edx, dword [esp + 4]
inc edx
add ecx, 8
mov esi, dword [esp + 0xc]
add esi, 0x400
mov eax, ebx
cmp edx, dword [esp + 0x18]
je 0x407b59
mov dword [esp + 4], edx
mov ebx, dword [esp]
mov dword [esp], eax
mov edx, 3
xor eax, eax
nop
mov dword [esp + edx*4 + 0x520], eax
add eax, dword [esi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0x524], eax
add eax, dword [esi + edx*4 - 8]
mov dword [esp + edx*4 + 0x528], eax
add eax, dword [esi + edx*4 - 4]
mov dword [esp + edx*4 + 0x52c], eax
add eax, dword [esi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x407ad0
mov dword [esp + 0xc], esi
cmp byte [esp + 8], 0
jne 0x407aa0
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [ebx + edx*4]
shr eax, cl
movzx eax, al
mov ebp, dword [esp + eax*4 + 0x52c]
mov edi, dword [ebx + edx*4]
mov esi, dword [esp]
mov dword [esi + ebp*4], edi
mov edi, ebp
and ebp, 1
xor edi, 1
lea edi, [edi + ebp*2]
mov ebp, dword [esp + 0x1c]
mov dword [esp + eax*4 + 0x52c], edi
inc edx
cmp ebp, edx
jne 0x407b20
jmp 0x407aa0
test ebp, ebp
mov ebx, dword [esp + 0x15c4]
mov edi, dword [esp + 0x20]
je 0x407fbb
cmp ebp, 1
jne 0x407b7e
mov eax, dword [esp]
mov word [eax], 1
jmp 0x407e8c
mov edx, dword [esp]
movzx eax, word [edx + 4]
add word [edx], ax
lea eax, [ebp - 1]
mov dword [esp + 0xc], eax
cmp eax, 2
jl 0x407cd5
xor ecx, ecx
mov dword [esp + 4], 2
mov ebx, 1
jmp 0x407bee
movzx eax, word [edx + eax*4]
mov esi, edx
mov word [esp + 8], ax
mov edx, dword [esp + 4]
mov eax, edx
and eax, 1
xor edx, 1
lea edx, [edx + eax*2]
mov dword [esp + 4], edx
movzx eax, word [esp + 8]
add word [esi + ebx*4], ax
mov edx, esi
mov eax, ebx
xor eax, 1
and ebx, 1
lea ebx, [eax + ebx*2]
cmp ebx, dword [esp + 0xc]
jge 0x407ce4
movzx eax, word [edx + ecx*4]
mov esi, dword [esp + 4]
cmp esi, ebp
jge 0x407c10
mov dword [esp + 8], ecx
movzx ecx, word [edx + esi*4]
mov word [esp + 0x18], cx
cmp ax, cx
mov ecx, dword [esp + 8]
jae 0x407c20
mov word [edx + ebx*4], ax
mov word [edx + ecx*4], bx
inc ecx
jmp 0x407c2a
inc esi
movzx eax, word [esp + 0x18]
mov word [edx + ebx*4], ax
mov eax, esi
cmp esi, ebp
mov dword [esp + 4], esi
jge 0x407c60
cmp ecx, ebx
jge 0x407bb0
mov esi, edx
movzx edx, word [edx + ecx*4]
movzx eax, word [esi + eax*4]
cmp dx, ax
jae 0x407bb6
jmp 0x407c66
mov esi, edx
movzx edx, word [edx + ecx*4]
add word [esi + ebx*4], dx
mov word [esi + ecx*4], bx
inc ecx
jmp 0x407bd7
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x10]
lea edx, [ebx + eax]
add edx, 0x8194
xor eax, eax
xor ebp, ebp
jmp 0x407c9b
add eax, 2
cmp ecx, eax
je 0x4079b3
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x407cb6
mov word [esp + ebp*4 + 0xac], si
mov word [esp + ebp*4 + 0xae], ax
inc ebp
movzx esi, word [edx + eax*2]
test si, si
je 0x407c90
mov word [esp + ebp*4 + 0xac], si
lea esi, [eax + 1]
mov word [esp + ebp*4 + 0xae], si
inc ebp
jmp 0x407c90
lea ecx, [ebp - 2]
mov word [edx + ebp*4 - 8], 0
jmp 0x407d71
lea ecx, [ebp - 2]
mov word [edx + ebp*4 - 8], 0
cmp ebp, 3
jl 0x407d71
mov esi, edx
lea edx, [ebp - 3]
mov ebx, ebp
and ebx, 3
xor ebx, 2
mov dword [esp + 4], edx
je 0x407d21
mov edx, dword [esp + 4]
nop
nop
movzx eax, word [esi + edx*4]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4], ax
dec edx
dec ebx
jne 0x407d10
cmp dword [esp + 4], 3
jb 0x407d71
inc edx
mov esi, dword [esp]
nop
nop
nop
nop
movzx eax, word [esi + edx*4 - 4]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4 - 4], ax
movzx eax, word [esi + edx*4 - 8]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4 - 8], ax
movzx eax, word [esi + edx*4 - 0xc]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4 - 0xc], ax
movzx eax, word [esi + edx*4 - 0x10]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4 - 0x10], ax
add edx, 0xfffffffc
jne 0x407d30
mov dword [esp + 8], 1
xor edx, edx
jmp 0x407da3
mov ebx, dword [esp + 0xc]
mov dword [esp + 0xc], ebx
inc edx
mov esi, dword [esp + 4]
lea eax, [esi + esi]
mov dword [esp + 8], eax
test esi, esi
mov ebx, dword [esp + 0x15c4]
je 0x407e84
test ecx, ecx
js 0x407de0
lea eax, [ecx + 1]
mov dword [esp + 4], eax
mov ebx, ecx
not ebx
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, dword [esp]
movzx eax, word [eax + ecx*4]
cmp edx, eax
jne 0x407df0
inc esi
dec ecx
mov eax, ebx
add eax, esi
jne 0x407dc0
mov ecx, 0xffffffff
mov eax, dword [esp + 4]
jmp 0x407df2
xor eax, eax
jmp 0x407df2
mov eax, esi
mov ebx, dword [esp + 8]
mov esi, ebx
sub esi, eax
mov dword [esp + 4], eax
jle 0x407d80
and esi, 3
je 0x407e3f
mov eax, dword [esp]
mov ebx, dword [esp + 0xc]
lea eax, [eax + ebx*4]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [eax], dx
inc ebx
add eax, 0xfffffffc
cmp esi, ebx
jne 0x407e20
mov eax, dword [esp + 8]
mov esi, eax
sub esi, ebx
sub dword [esp + 0xc], ebx
mov ebx, eax
mov eax, dword [esp + 4]
jmp 0x407e41
mov esi, ebx
sub eax, ebx
cmp eax, 0xfffffffc
mov eax, dword [esp]
mov ebx, dword [esp + 0xc]
ja 0x407d84
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [eax + ebx*4], dx
mov word [eax + ebx*4 - 4], dx
mov word [eax + ebx*4 - 8], dx
mov word [eax + ebx*4 - 0xc], dx
add esi, 0xfffffffc
add ebx, 0xfffffffc
cmp esi, dword [esp + 4]
jg 0x407e60
jmp 0x407d84
test ebp, ebp
jle 0x407fbb
lea edx, [ebp - 1]
mov eax, ebp
and eax, 3
xor ecx, ecx
cmp edx, 3
mov ebx, dword [esp]
jb 0x407eda
mov edx, ebp
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebx + ecx*4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 8]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x28]
add ecx, 4
cmp edx, ecx
jne 0x407eb0
test eax, eax
je 0x407efd
mov edx, dword [esp]
lea ecx, [edx + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x28]
inc edx
cmp eax, edx
jne 0x407ef0
cmp ebp, 2
mov ebx, dword [esp + 0x15c4]
jl 0x407fbb
cmp ebx, 0x20
jge 0x407f80
mov eax, dword [esp + ebx*4 + 0x28]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x407f3c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
inc ecx
mov dword [esp + ebx*4 + 0x28], eax
dec edx
jne 0x407f30
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x407f78
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x38]
add ecx, 4
mov dword [esp + ebx*4 + 0x28], eax
cmp ecx, 0x20
jne 0x407f50
test ebx, ebx
jle 0x40822d
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x24]
shl esi, cl
mov edi, esi
and edi, eax
xor esi, eax
lea eax, [esi + edi*2]
dec edx
inc ecx
cmp edx, 1
ja 0x407f90
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
mov edi, dword [esp + 0x20]
jne 0x408253
shl edi, 5
mov esi, dword [esp + 0x10]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408470
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408470
add esp, 0xc
test ebx, ebx
mov esi, dword [esp]
jle 0x4080df
add esi, 0xfffffffe
mov eax, 1
add edi, dword [esp + 0x10]
mov dword [esp], esi
jmp 0x40802d
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x4080df
mov ecx, dword [esp + eax*4 + 0x28]
test ecx, ecx
jle 0x408020
mov edx, ecx
and edx, 3
je 0x408090
mov dword [esp + 0x1c], ebp
lea ebx, [esi + ebp*4]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, edi
movzx edi, word [ebx]
mov byte [edi + ebp + 0x8f12], al
mov edi, ebp
inc esi
add ebx, 0xfffffffc
cmp edx, esi
jne 0x408050
mov ebp, dword [esp + 0x1c]
sub ebp, esi
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp]
cmp ecx, 4
jb 0x408020
jmp 0x408097
mov edx, ecx
cmp ecx, 4
jb 0x408020
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esi + ebp*4]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebp*4 - 4]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebp*4 - 8]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebp*4 - 0xc]
add ebp, 0xfffffffc
mov byte [ecx + edi + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x4080a0
jmp 0x408020
mov ecx, dword [esp + 0x15c0]
mov dword [esp + 0x930], 0
cmp ebx, 2
jl 0x40814d
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x408107
xor eax, eax
mov edx, 2
jmp 0x408134
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x938], eax
add edx, 2
cmp ebx, edx
jne 0x408110
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x40814d
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x92c], eax
test ecx, ecx
jle 0x408222
xor eax, eax
mov edx, dword [esp + 0x14]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0x10]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp], edi
jmp 0x40819b
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x408222
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x408192
mov ecx, dword [esp + ebx*4 + 0x92c]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x92c], edi
xor edi, edi
cmp bl, 4
jb 0x4081ff
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, ecx
and edi, 2
or edi, esi
mov esi, ecx
shr esi, 2
and esi, 1
or esi, edi
mov edi, ecx
shr edi, 3
and edi, 1
lea edi, [edi + esi*2]
shr ecx, 4
add ebp, 0xfffffffc
jne 0x4081d0
and ebx, 3
je 0x408180
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
lea edi, [esi + edi*2]
shr ecx, 1
dec ebx
jne 0x408210
jmp 0x408180
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x408253
dec esi
mov dword [esp + ecx*4 + 0x28], esi
add dword [esp + ecx*4 + 0x2c], 2
dec eax
cmp eax, edx
je 0x407fbb
dec dword [esp + ebx*4 + 0x28]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40824a
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x408260
jmp 0x408240