Function at 0x4391da
Capabilities:
Encode data using xor

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xffffffbc
mov word [esp], ax
xor ebx, ebx
movsx eax, word [esp]
mov edx, dword [0x4be754]
mov eax, dword [edx + eax*4 - 4]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x30]
fild qword [eax + 0x14c]
mov eax, dword [esp + 0x30]
fild qword [eax + 0x144]
fsubp st(1)
call fcn.004028e8
add eax, 1
adc edx, 0
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edx
fild qword [esp + 0x38]
fistp qword [esp + 8]
wait
mov eax, dword [esp + 0x30]
fild qword [eax + 0x14c]
fcomp dword [0x4396b0]
fnstsw ax
sahf
jne 0x438f57
mov eax, dword [esp + 0x30]
mov eax, dword [eax + 0xc]
mov edx, dword [eax + 0x10]
mov dword [esp + 8], edx
mov edx, dword [eax + 0x14]
mov dword [esp + 0xc], edx
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 0
jne 0x439009
mov eax, dword [0x4be784]
cmp byte [eax + 0x18a2], 3
je 0x438f85
mov eax, dword [0x4be784]
cmp byte [eax + 0x18a2], 4
jne 0x438fc0
push dword [esp + 0xc]
push dword [esp + 0xc]
push 0
push 2
call fcn.004af060
test eax, eax
je 0x438fc0
push 0
push 2
mov ax, 0xc7
call fcn.004aa600
call fcn.004ae0e4
mov eax, dword [0x4bedb0]
mov edx, 3
call fcn.004b12a8
jmp 0x4396a4
mov eax, dword [0x4be784]
cmp byte [eax + 0x18a2], 4
jbe 0x439009
push dword [esp + 0xc]
push dword [esp + 0xc]
push 0
push 4
call fcn.004af060
test eax, eax
je 0x439009
push 0
push 4
mov ax, 0xc7
call fcn.004aa600
call fcn.004ae0e4
mov eax, dword [0x4bedb0]
mov edx, 3
call fcn.004b12a8
jmp 0x4396a4
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 2
jne 0x439044
push dword [esp + 0xc]
push dword [esp + 0xc]
push 0
push 2
call fcn.004af060
test eax, eax
je 0x439044
mov ax, 0xc8
call fcn.004aa600
mov edx, 3
call fcn.004b12a8
jmp 0x4396a4
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 3
jne 0x43908d
push dword [esp + 0xc]
push dword [esp + 0xc]
push 0
push 4
call fcn.004af060
test eax, eax
je 0x43908d
push 0
push 4
mov ax, 0xc7
call fcn.004aa600
call fcn.004ae0e4
mov eax, dword [0x4bedb0]
mov edx, 3
call fcn.004b12a8
jmp 0x4396a4
mov eax, dword [0x4be784]
mov al, byte [eax + 0x18af]
cmp al, 2
jb 0x4390c8
mov edx, dword [0x4be784]
cmp al, 3
ja 0x4390c8
push 0
push 0
mov eax, dword [esp + 0x38]
mov ax, word [eax + 0x424]
xor ecx, ecx
mov dl, 0xb
call fcn.00430df8
test al, al
je 0x4396a4
jmp 0x4390e8
push 0
push 0
mov eax, dword [esp + 0x38]
mov ax, word [eax + 0x424]
xor ecx, ecx
mov dl, 8
call fcn.00430df8
test al, al
je 0x4396a4
mov eax, dword [esp + 0x30]
mov eax, dword [eax + 0xc]
mov edx, dword [eax + 0x1a0]
call dword [edx + 0x10]
test al, al
je 0x4396a4
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 4
jae 0x43913c
mov edx, dword [0x4be784]
movzx edx, byte [edx + 0x18af]
mov eax, 2
call fcn.004aa570
add ax, 0xeb
call fcn.004aa600
mov edx, eax
mov eax, dword [0x4bec98]
call fcn.004b81b0
jmp 0x439151
mov ax, 0xeb
call fcn.004aa600
mov edx, eax
mov eax, dword [0x4bec98]
call fcn.004b81b0
mov eax, dword [0x4bec98]
xor edx, edx
call fcn.004ad8ec
fild qword [esp + 8]
fsub dword [0x4396b4]
fdiv dword [0x4396b8]
call fcn.004028f4
inc eax
mov word [esp + 0x26], ax
mov eax, 0xe000
call fcn.00402504
mov esi, eax
mov eax, dword [esp + 0x30]
mov edx, dword [eax + 0x144]
mov dword [esp + 0x10], edx
mov edx, dword [eax + 0x148]
mov dword [esp + 0x14], edx
xor eax, eax
mov dword [0x4c1088], eax
mov ax, word [esp + 0x26]
test ax, ax
jbe 0x4395c7
mov word [esp + 0x34], ax
mov word [esp + 0x24], 1
mov ax, word [esp + 0x24]
cmp ax, word [esp + 0x26]
jne 0x4391ee
fild qword [esp + 8]
fsub dword [0x4396b4]
add esp, 0xfffffff8
fistp qword [esp]
wait
push 0
push 0xe000
call fcn.004af060
inc eax
mov word [esp + 0x28], ax
jmp 0x4391f5
mov word [esp + 0x28], 0xe000
movzx ebx, word [esp + 0x28]
push ebx
lea edx, [esp + 0x14]
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 0xc]
mov ecx, esi
mov edi, dword [eax + 0x1a0]
call dword [edi + 0x18]
mov dword [esp + 0x20], eax
cmp ebx, dword [esp + 0x20]
jne 0x4395c7
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 0
jne 0x439239
mov dx, word [esp + 0x20]
mov eax, esi
call fcn.004396c4
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 1
jne 0x439262
mov di, word [esp + 0x20]
test di, di
jbe 0x439262
mov bx, 1
movzx eax, bx
not byte [esi + eax - 1]
inc ebx
dec di
jne 0x439255
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 4
jne 0x439296
mov di, word [esp + 0x20]
test di, di
jbe 0x439296
mov bx, 1
mov eax, dword [0x4be784]
mov al, byte [eax + 0x18aa]
movzx edx, bx
xor byte [esi + edx - 1], al
inc ebx
dec di
jne 0x43927e
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 0xa
jne 0x4392af
mov edx, dword [esp + 0x20]
mov eax, esi
call fcn.00433cdc
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 7
jne 0x4392e3
mov di, word [esp + 0x20]
test di, di
jbe 0x4392e3
mov bx, 1
mov eax, dword [0x4be784]
mov al, byte [eax + 0x182c]
movzx edx, bx
or byte [esi + edx - 1], al
inc ebx
dec di
jne 0x4392cb
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 8
jne 0x439317
mov di, word [esp + 0x20]
test di, di
jbe 0x439317
mov bx, 1
mov eax, dword [0x4be784]
mov al, byte [eax + 0x182d]
movzx edx, bx
and byte [esi + edx - 1], al
inc ebx
dec di
jne 0x4392ff
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 5
jne 0x4393a3
mov di, word [esp + 0x20]
test di, di
jbe 0x4393a3
mov bx, 1
movzx eax, bx
shl byte [esi + eax - 1], 1
movzx eax, bx
cmp eax, dword [esp + 0x20]
jge 0x43934f
movzx eax, bx
mov al, byte [esi + eax]
mov byte [esp + 0x2a], al
jmp 0x43938b
mov ax, word [esp + 0x24]
cmp ax, word [esp + 0x26]
jne 0x439362
mov byte [esp + 0x2a], 0
jmp 0x43938b
push 1
lea ecx, [esp + 0x2e]
lea edx, [esp + 0x14]
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 0xc]
mov ebp, dword [eax + 0x1a0]
call dword [ebp + 0x18]
fild qword [esp + 0x10]
fsub dword [0x4396b4]
fistp qword [esp + 0x10]
wait
mov al, byte [esp + 0x2a]
and al, 0x80
cmp al, 0x80
jne 0x43939d
movzx eax, bx
or byte [esi + eax - 1], 1
inc ebx
dec di
jne 0x439333
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 6
jne 0x43941c
mov eax, dword [esp + 0x20]
mov dl, byte [esi + eax - 1]
mov bx, word [esp + 0x20]
cmp bx, 1
jb 0x439418
movzx eax, bx
xor ecx, ecx
mov cl, byte [esi + eax - 1]
shr ecx, 1
mov byte [esi + eax - 1], cl
cmp bx, 1
jbe 0x4393e3
mov cl, byte [esi + eax - 2]
mov byte [esp + 0x2a], cl
jmp 0x4393fa
cmp word [esp + 0x24], 1
jne 0x4393f2
mov byte [esp + 0x2a], 0
jmp 0x4393fa
mov cl, byte [esp + 0x2c]
mov byte [esp + 0x2a], cl
mov cl, byte [esp + 0x2a]
and cl, 1
cmp cl, 1
jne 0x43940d
or byte [esi + eax - 1], 0x80
jmp 0x439412
and byte [esi + eax - 1], 0x7f
dec ebx
test bx, bx
jne 0x4393c4
mov byte [esp + 0x2c], dl
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 2
jne 0x439464
mov di, word [esp + 0x20]
test di, di
jbe 0x439464
mov ax, 1
movzx edx, ax
mov ecx, edx
and ecx, 1
cmp ecx, 1
jne 0x43945e
movzx ecx, ax
mov bl, byte [esi + ecx - 1]
mov byte [esp + 0x2a], bl
mov bl, byte [esi + edx]
mov byte [esi + ecx - 1], bl
mov cl, byte [esp + 0x2a]
mov byte [esi + edx], cl
inc eax
dec di
jne 0x439438
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 3
jne 0x4394bf
mov di, word [esp + 0x20]
test di, di
jbe 0x4394bf
mov ax, 1
movzx edx, ax
mov ecx, edx
and ecx, 3
cmp ecx, 1
jne 0x4394b9
movzx ecx, ax
mov cl, byte [esi + ecx - 1]
mov bl, byte [esi + edx]
mov byte [esp + 0x2b], bl
mov bl, byte [esi + edx + 2]
movzx ebp, ax
mov byte [esi + ebp - 1], bl
mov bl, byte [esi + edx + 1]
mov byte [esi + edx], bl
mov bl, byte [esp + 0x2b]
mov byte [esi + edx + 1], bl
mov byte [esi + edx + 2], cl
inc eax
dec di
jne 0x439480
fild dword [esp + 0x20]
fild qword [esp + 0x10]
fsubrp st(1)
fistp qword [esp + 0x10]
wait
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 9
je 0x4394ff
mov eax, dword [esp + 0x20]
push eax
lea edx, [esp + 0x14]
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 0xc]
mov ecx, esi
call fcn.0041c768
cmp eax, dword [esp + 0x20]
jne 0x4395c7
jmp 0x43955e
mov eax, dword [0x4be784]
fild dword [eax + 0xa40]
fild qword [esp + 0x10]
faddp st(1)
fistp qword [esp + 0x18]
wait
fild qword [esp + 0x18]
fcomp dword [0x4396bc]
fnstsw ax
sahf
jb 0x439528
xor ebx, ebx
jmp 0x43953f
fild qword [esp + 0x18]
fchs
call fcn.004028e8
mov ebx, eax
xor eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov edi, dword [esp + 0x20]
sub edi, ebx
push edi
mov ecx, esi
add ecx, ebx
lea edx, [esp + 0x1c]
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 0xc]
call fcn.0041c768
cmp eax, edi
jne 0x4395c7
movzx eax, word [esp + 0x24]
dec eax
imul eax, eax, 0xe000
movzx edx, word [esp + 0x28]
add eax, edx
mov dword [esp + 0x40], eax
fild dword [esp + 0x40]
fild qword [esp + 8]
fdivp st(1)
fmul dword [0x4396c0]
call fcn.004028e8
mov edx, dword [0x4be344]
mov byte [edx], al
mov eax, dword [0x4be344]
mov al, byte [eax]
mov edx, dword [0x4be8d0]
cmp al, byte [edx]
je 0x4395a8
call fcn.004b5c48
call fcn.004ae0a4
mov eax, dword [0x4bed48]
cmp byte [eax], 0
jne 0x4395c7
inc word [esp + 0x24]
dec word [esp + 0x34]
jne 0x4391bd
mov eax, dword [esp + 0x30]
push dword [eax + 0x148]
push dword [eax + 0x144]
mov eax, dword [esp + 0x38]
fild qword [eax + 0x144]
fild qword [esp + 0x10]
faddp st(1)
fsub dword [0x4396b4]
add esp, 0xfffffff8
fistp qword [esp]
wait
mov eax, dword [esp + 0x40]
mov eax, dword [eax + 0xc]
call fcn.00418ac4
mov eax, dword [esp + 0x30]
mov eax, dword [eax + 0xc]
mov edx, dword [eax + 0x1a0]
call dword [edx + 0x14]
mov eax, esi
call fcn.00402524
call fcn.004adbe0
mov eax, dword [esp + 0x30]
mov byte [eax + 0x443], 1
mov bl, 1
mov eax, dword [0x4be784]
mov al, byte [eax + 0x18af]
cmp al, 2
jb 0x439650
mov edx, dword [0x4be784]
cmp al, 3
ja 0x439650
mov eax, dword [0x4be784]
cmp byte [eax + 0x18f1], 4
jbe 0x43965e
mov eax, dword [esp + 0x30]
mov eax, dword [eax + 0xc]
mov byte [eax + 0xd2], 0
mov eax, dword [0x4be784]
cmp byte [eax + 0x18af], 0
jne 0x4396a4
mov eax, dword [0x4be784]
cmp byte [eax + 0x18d7], 0
jne 0x4396a4
fild dword [0x4c1088]
add esp, 0xfffffff8
fistp qword [esp]
wait
mov ax, 0x55
call fcn.004aa600
call fcn.004ae0e4
mov eax, dword [0x4bedb0]
mov edx, 4
call fcn.004b12a8
mov eax, ebx
add esp, 0x44
pop ebp
pop edi
pop esi
pop ebx
ret