Function at 0x408150
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00408be0
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00408c90
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x1c], ebx
je 0x40820c
test esi, esi
mov ecx, esi
jle 0x4089c0
xor eax, eax
cmp ecx, 1
je 0x4081d8
mov ecx, dword [esp + 0x15c8]
and ecx, 0xfffffffe
mov eax, dword [esp + 0x1c]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x30]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x30]
add eax, 2
cmp ecx, eax
jne 0x4081c0
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x4089c0
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c8]
inc dword [esp + eax*4 + 0x30]
jmp 0x4089c0
lea eax, [ebx + ebx*8]
mov dword [esp + 0x14], eax
shl eax, 6
test esi, esi
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], eax
jle 0x408309
cmp esi, 1
jne 0x408b0e
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408265
mov ecx, dword [esp + 0x28]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408265
mov word [esp + ebx*4 + 0x4b4], cx
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408c90
add esp, 0xc
test ebx, ebx
sete byte [esp + 0xb]
je 0x408320
xor eax, eax
cmp ebx, 1
je 0x4082df
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b4]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
movzx edx, word [esp + eax*4 + 0x4b8]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
add eax, 2
cmp ecx, eax
jne 0x4082a0
test bl, 1
je 0x408300
movzx eax, word [esp + eax*4 + 0x4b4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x934]
shr eax, 8
inc dword [esp + eax*4 + 0xd34]
mov eax, dword [esp + 0xd34]
jmp 0x408329
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408c90
add esp, 0xc
xor ebx, ebx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov edi, 2
sub edi, ecx
lea eax, [ebx - 1]
mov dword [esp + 0x20], eax
mov eax, ebx
and eax, 0xfffffffe
mov dword [esp + 0x10], eax
xor esi, esi
lea eax, [esp + 0x1134]
mov dword [esp + 4], eax
lea eax, [esp + 0x4b4]
lea ebp, [esp + 0x934]
xor ecx, ecx
mov dword [esp], ebx
mov dword [esp + 0x2c], edi
jmp 0x408388
inc esi
add ecx, 8
add ebp, 0x400
mov edx, dword [esp + 0xc]
mov eax, edx
cmp esi, edi
je 0x4084cb
mov edx, dword [esp + 4]
mov dword [esp + 0xc], edx
mov dword [esp + 4], eax
mov edx, 3
xor eax, eax
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0xa8], eax
add eax, dword [ebp + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xac], eax
add eax, dword [ebp + edx*4 - 8]
mov dword [esp + edx*4 + 0xb0], eax
add eax, dword [ebp + edx*4 - 4]
mov dword [esp + edx*4 + 0xb4], eax
add eax, dword [ebp + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x4083a0
cmp byte [esp + 0xb], 0
jne 0x408370
mov dword [esp + 0x18], esi
cmp dword [esp + 0x20], 0
je 0x408471
xor edx, edx
mov edi, dword [esp + 0xc]
mov ebx, dword [esp + 4]
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [ebx + edx*4]
shr eax, cl
mov ebx, eax
xor ebx, 0x3fffff00
or eax, 0xff
and eax, ebx
mov ebx, dword [esp + eax*4 + 0xb4]
mov esi, dword [esp + 4]
mov esi, dword [esi + edx*4]
mov dword [edi + ebx*4], esi
lea esi, [ebx + 1]
mov ebx, dword [esp + 4]
movzx ebx, word [ebx + edx*4 + 4]
shr ebx, cl
mov dword [esp + eax*4 + 0xb4], esi
mov eax, ebx
xor eax, 0x3fffff00
or ebx, 0xff
and ebx, eax
mov eax, dword [esp + ebx*4 + 0xb4]
lea esi, [eax + 1]
mov dword [esp + ebx*4 + 0xb4], esi
mov ebx, dword [esp + 4]
mov esi, dword [ebx + edx*4 + 4]
mov dword [edi + eax*4], esi
add edx, 2
cmp dword [esp + 0x10], edx
jne 0x408400
jmp 0x408473
xor edx, edx
mov ebx, dword [esp]
test bl, 1
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0x18]
je 0x408370
mov eax, dword [esp + 4]
movzx eax, word [eax + edx*4]
shr eax, cl
mov esi, eax
xor esi, 0x3fffff00
or eax, 0xff
and eax, esi
mov esi, dword [esp + eax*4 + 0xb4]
lea ebx, [esi + 1]
mov dword [esp + eax*4 + 0xb4], ebx
mov ebx, dword [esp]
mov eax, dword [esp + 4]
mov eax, dword [eax + edx*4]
mov edx, dword [esp + 0xc]
mov dword [edx + esi*4], eax
mov esi, dword [esp + 0x18]
jmp 0x408370
test ebx, ebx
mov esi, dword [esp + 0x14]
mov ebp, edx
je 0x408887
mov ecx, dword [esp]
cmp ecx, 1
jne 0x4084ec
mov word [ebp], 1
jmp 0x40875d
movzx eax, word [ebp + 4]
add word [ebp], ax
mov eax, ecx
or eax, 0xfffffffe
mov ecx, dword [esp + 0x10]
mov edx, eax
add eax, ecx
inc eax
cmp eax, 2
jl 0x4085b8
add edx, ecx
neg edx
mov dword [esp + 4], edx
mov eax, 1
xor edx, edx
mov edi, 2
jmp 0x40854c
movzx ecx, word [ebx + edx*4]
add word [ebx + eax*4], cx
mov word [ebx + edx*4], ax
inc edx
mov ebp, ebx
mov ecx, dword [esp + 4]
add ecx, eax
inc ecx
inc eax
cmp ecx, 1
je 0x4085b8
mov esi, dword [esp]
cmp edi, esi
jge 0x408570
mov ebx, ebp
movzx ebp, word [ebp + edi*4]
movzx ecx, word [ebx + edx*4]
cmp cx, bp
jb 0x408577
inc edi
mov word [ebx + eax*4], bp
cmp edi, esi
jge 0x408530
jmp 0x408584
movzx ecx, word [ebp + edx*4]
mov ebx, ebp
mov word [ebx + eax*4], cx
mov word [ebx + edx*4], ax
inc edx
cmp edi, esi
jge 0x408530
cmp edx, eax
jge 0x4085a0
movzx ecx, word [ebx + edx*4]
movzx ebp, word [ebx + edi*4]
cmp cx, bp
jb 0x408534
jmp 0x4085a4
movzx ebp, word [ebx + edi*4]
movzx ecx, word [ebx + eax*4]
inc edi
mov esi, ecx
and esi, ebp
xor ecx, ebp
lea ecx, [ecx + esi*2]
mov word [ebx + eax*4], cx
jmp 0x40853d
mov edx, dword [esp]
mov eax, edx
xor eax, 0x3ffffffd
mov ecx, edx
and ecx, 0x1ffffffd
lea eax, [eax + ecx*2]
mov word [ebp + eax*4 + 4], 0
cmp edx, 3
jl 0x408655
mov eax, dword [esp]
lea ecx, [eax - 3]
lea edx, [eax + 2]
mov eax, ecx
and edx, 3
je 0x408604
mov eax, ecx
nop
nop
nop
nop
nop
movzx esi, word [ebp + eax*4]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + eax*4], si
dec eax
dec edx
jne 0x4085f0
cmp ecx, 3
jb 0x408655
inc eax
nop
nop
nop
nop
nop
nop
movzx ecx, word [ebp + eax*4 - 4]
movzx ecx, word [ebp + ecx*4]
inc ecx
mov word [ebp + eax*4 - 4], cx
movzx ecx, word [ebp + eax*4 - 8]
movzx ecx, word [ebp + ecx*4]
inc ecx
mov word [ebp + eax*4 - 8], cx
movzx ecx, word [ebp + eax*4 - 0xc]
movzx ecx, word [ebp + ecx*4]
inc ecx
mov word [ebp + eax*4 - 0xc], cx
movzx ecx, word [ebp + eax*4 - 0x10]
movzx ecx, word [ebp + ecx*4]
inc ecx
mov word [ebp + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x408610
mov eax, dword [esp]
add eax, 0xfffffffe
mov edi, 1
xor ebx, ebx
mov edx, dword [esp + 0x20]
jmp 0x408684
mov ebp, dword [esp + 0xc]
lea edi, [esi + esi]
inc ebx
test esi, esi
mov esi, dword [esp + 0x14]
jle 0x408753
test eax, eax
js 0x4086b0
lea esi, [eax + 1]
xor ebp, ebp
nop
nop
nop
mov ecx, dword [esp + 0xc]
movzx ecx, word [ecx + eax*4]
cmp ebx, ecx
jne 0x4086c0
inc ebp
dec eax
cmp esi, ebp
jne 0x408690
mov eax, 0xffffffff
jmp 0x4086c2
xor esi, esi
jmp 0x4086c2
mov esi, ebp
mov ebp, edi
sub ebp, esi
jle 0x408670
mov ecx, esi
not ecx
add ecx, edi
mov dword [esp + 4], ecx
and ebp, 3
mov dword [esp + 0x10], ebp
je 0x408713
mov dword [esp + 0x18], esi
mov ecx, dword [esp + 0xc]
lea ecx, [ecx + edx*4]
xor ebp, ebp
mov esi, dword [esp + 0x10]
nop
nop
nop
nop
mov word [ecx], bx
inc ebp
add ecx, 0xfffffffc
cmp esi, ebp
jne 0x4086f0
sub edx, ebp
sub edi, ebp
mov ebp, dword [esp + 0xc]
mov esi, dword [esp + 0x18]
cmp dword [esp + 4], 3
jae 0x408730
jmp 0x408674
mov ebp, dword [esp + 0xc]
cmp dword [esp + 4], 3
jb 0x408674
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp + edx*4], bx
mov word [ebp + edx*4 - 4], bx
mov word [ebp + edx*4 - 8], bx
mov word [ebp + edx*4 - 0xc], bx
add edx, 0xfffffffc
add edi, 0xfffffffc
cmp edi, esi
jg 0x408730
jmp 0x408674
cmp dword [esp], 0
jle 0x408887
mov ebx, esi
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x20], 3
jb 0x4087ab
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x30]
add ecx, 4
cmp edx, ecx
jne 0x408780
test eax, eax
je 0x4087cd
lea ecx, [ecx*4]
add ecx, ebp
xor edx, edx
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x30]
inc edx
cmp eax, edx
jne 0x4087c0
cmp dword [esp], 2
mov esi, ebx
jl 0x408887
mov edx, dword [esp + 0x15cc]
lea eax, [edx + 1]
cmp eax, 0x21
jge 0x408850
mov ecx, dword [esp + edx*4 + 0x30]
neg edx
mov esi, dword [esp + 0x15cc]
and edx, 3
je 0x40880c
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + esi*4 + 0x30], ecx
inc eax
dec edx
jne 0x408800
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408848
add eax, 3
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x24]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + edx*4 + 0x30], ecx
add eax, 4
cmp eax, 0x24
jne 0x408820
test edx, edx
jle 0x408b75
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x2c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x408860
mov edx, 1
mov ecx, dword [esp + 0x15cc]
shl edx, cl
cmp eax, edx
mov esi, ebx
jne 0x408b99
shl esi, 5
mov ebx, dword [esp + 0x24]
lea eax, [ebx + esi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408c90
add esp, 0xc
mov eax, dword [esp + 0x28]
mov edi, ebx
add eax, ebx
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408c90
add esp, 0xc
cmp dword [esp + 0x15cc], 0
jle 0x4089b9
add ebp, 0xfffffffe
mov eax, 1
mov dword [esp + 0xc], ebp
mov dword [esp + 0x14], esi
jmp 0x408910
mov ebx, ebp
mov ebp, dword [esp]
mov edi, dword [esp + 0x24]
mov dword [esp], ebp
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15cc]
mov eax, ecx
mov ebp, ebx
je 0x4089b9
mov ebx, dword [esp + eax*4 + 0x30]
test ebx, ebx
jle 0x4088f0
mov edx, ebx
and edx, 3
je 0x408960
mov dword [esp + 4], ebx
mov ecx, dword [esp]
lea ebp, [ebp + ecx*4]
mov ecx, edi
xor edi, edi
nop
nop
movzx esi, word [ebp]
mov ebx, dword [esp + 0x14]
add ebx, ecx
mov byte [esi + ebx + 0x8f12], al
inc edi
add ebp, 0xfffffffc
cmp edx, edi
jne 0x408930
mov ebx, dword [esp + 4]
mov edx, ebx
sub edx, edi
sub dword [esp], edi
mov esi, dword [esp + 0x14]
jmp 0x408962
mov edx, ebx
cmp ebx, 4
mov ebp, dword [esp]
mov ebx, dword [esp + 0xc]
jb 0x4088f5
dec edx
nop
movzx ecx, word [ebx + ebp*4]
mov edi, esi
mov esi, dword [esp + 0x24]
add esi, edi
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebx + ebp*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebx + ebp*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebx + ebp*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
mov esi, edi
add ebp, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408970
jmp 0x4088f5
mov ecx, dword [esp + 0x15c8]
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x408a3d
lea ecx, [eax - 1]
cmp eax, 2
jne 0x4089e8
xor eax, eax
mov edx, 2
jmp 0x408a24
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x93c], eax
add eax, dword [esp + edx*4 + 0x38]
add eax, eax
mov dword [esp + edx*4 + 0x940], eax
add edx, 2
cmp ebx, edx
jne 0x408a00
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c8]
je 0x408a3d
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
test ecx, ecx
jle 0x408b03
xor eax, eax
mov edx, dword [esp + 0x1c]
lea edx, [edx + edx*8]
mov esi, edx
shl esi, 5
add esi, edi
mov dword [esp + 4], esi
shl edx, 6
add edx, edi
mov dword [esp + 0x10], edx
jmp 0x408a88
mov ecx, dword [esp + 0x10]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c8]
inc eax
cmp eax, ecx
je 0x408b03
mov edx, dword [esp + 4]
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x408a83
mov edx, dword [esp + ebx*4 + 0x934]
lea edi, [edx + 1]
mov dword [esp + ebx*4 + 0x934], edi
xor edi, edi
cmp bl, 1
je 0x408aeb
mov ebp, ebx
and ebp, 0xfffffffe
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, edx
not esi
or esi, 1
add esi, edx
mov ecx, edx
shr ecx, 1
shl edi, 2
add esi, esi
add esi, 2
or esi, edi
mov edi, ecx
not edi
or edi, 1
add edi, ecx
inc edi
or edi, esi
shr edx, 2
add ebp, 0xfffffffe
jne 0x408ac0
test bl, 1
je 0x408a70
add edi, edi
mov ecx, edx
not ecx
or ecx, 1
add ecx, edx
inc ecx
or edi, ecx
jmp 0x408a70
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, esi
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x408b3b
add eax, 2
cmp ecx, eax
je 0x408233
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408b56
mov word [esp + ebx*4 + 0x4b4], si
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x408b30
mov word [esp + ebx*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b6], si
inc ebx
jmp 0x408b30
mov esi, ebx
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x408b99
dec eax
cmp eax, edx
je 0x408887
mov ecx, dword [esp + 0x15cc]
dec dword [esp + ecx*4 + 0x30]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408b90
mov edi, dword [esp + ecx*4 + 0x2c]
dec ecx
test edi, edi
je 0x408bb0
mov esi, edi
not esi
lea esi, [esi + edi*2]
mov dword [esp + ecx*4 + 0x30], esi
mov esi, ebx
add dword [esp + ecx*4 + 0x34], 2
jmp 0x408b90