Function at 0xd04cc0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebx, dword [ebp + 0x18]
movzx eax, word [ebp + 8]
movzx edx, word [ebp + 0xc]
movzx ecx, word [ebp + 0x14]
add ebx, 2
mov edi, dword [ebp + 0x18]
mov word [ebp - 0x3c], ax
mov word [ebp - 0x3e], dx
mov word [ebp - 0x40], cx
mov dword [ebp - 0x24], ebx
add edi, 4
mov dword [esp + 8], 0x100
mov dword [esp + 4], 0
mov eax, dword [ebp + 0x1c]
mov dword [esp], eax
call sub.msvcrt.dll_memset
cmp word [ebp - 0x3e], 0x2665
mov word [ebp - 0x38], 0
jle 0xd04d2b
xor eax, eax
cmp word [ebp - 0x3e], 0x3999
setg al
add eax, 1
mov word [ebp - 0x38], ax
lea edx, [edi - 2]
mov ecx, dword [ebp - 0x24]
movzx eax, word [edx + 0xa]
movsx esi, word [ebp - 0x3c]
mov word [edi + 0xa], ax
movzx eax, word [edx + 8]
mov word [edi + 8], ax
movzx eax, word [edx + 6]
mov word [edi + 6], ax
movzx eax, word [edx + 4]
mov word [edi + 4], ax
movzx eax, word [edx + 2]
movzx edx, word [ebp - 0x3e]
mov word [edi + 2], ax
mov word [edi], dx
movzx ecx, word [ecx]
movsx ebx, cx
sub esi, ebx
mov eax, esi
mov edx, esi
sar eax, 0x1f
sar edx, 0xf
mov word [ebp - 0x3a], cx
mov ecx, eax
xor ecx, 0x7fff
cmp edx, eax
lea edx, [ebx + ebx]
cmovne esi, ecx
movsx eax, dx
sar eax, 1
cmp ebx, eax
je 0xd04da0
movzx edx, word [ebp - 0x3a]
sar dx, 0xf
xor dx, 0x7fff
cmp dx, si
jge 0xd04eb3
cmp word [ebp - 0x38], 1
jle 0xd04fbe
movzx edx, word [ebp - 0x38]
mov eax, dword [ebp + 0x18]
movzx ebx, word [ebp - 0x3c]
mov ecx, dword [ebp - 0x24]
mov word [ecx], bx
mov word [eax], dx
mov eax, edx
add ax, word [ebp - 0x40]
jne 0xd04e9f
mov dword [ebp - 0x20], 0
jmp 0xd04ded
add dword [ebp - 0x20], 2
cmp dword [ebp - 0x20], 0x80
je 0xd04e5e
mov ecx, dword [ebp - 0x20]
mov ebx, dword [ebp + 0x10]
movzx edx, word [ecx + ebx]
test dx, dx
je 0xd04de0
mov esi, ecx
xor edi, edi
add esi, dword [ebp + 0x1c]
jmp 0xd04e0f
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp + 0x10]
movzx edx, word [eax + ecx]
movsx eax, word [edi + edi + 0x12e2c60]
mov dword [esp + 4], eax
movsx eax, dx
mov dword [esp], eax
call fcn.00d05d30
movsx edx, word [esi]
cwde
add eax, edx
mov edx, eax
mov ecx, eax
sar edx, 0x1f
sar ecx, 0xf
mov ebx, edx
xor ebx, 0x7fff
cmp ecx, edx
cmovne eax, ebx
add edi, 1
mov word [esi], ax
add esi, 2
cmp edi, 0x40
jne 0xd04e05
add dword [ebp - 0x20], 2
cmp dword [ebp - 0x20], 0x80
jne 0xd04ded
xor esi, esi
mov edx, dword [ebp + 0x1c]
movsx eax, word [edx + esi*2]
movsx edx, word [edx + esi*2 + 0x80]
add eax, edx
mov edx, eax
mov ecx, eax
sar edx, 0x1f
sar ecx, 0xf
mov ebx, edx
xor ebx, 0x7fff
cmp ecx, edx
mov ecx, dword [ebp + 0x10]
cmovne eax, ebx
mov word [ecx + esi*2], ax
add esi, 1
cmp esi, 0x40
jne 0xd04e60
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp ax, 1
je 0xd04f38
jle 0xd04e5e
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
xor edx, edx
movzx ebx, word [ebp - 0x38]
cmp word [ebp - 0x3e], 0x2665
movsx ecx, word [ebp - 0x38]
setle dl
xor eax, eax
cmp word [edi + 2], 0x2665
setle al
add edx, eax
xor eax, eax
cmp word [edi + 4], 0x2665
setle al
add edx, eax
xor eax, eax
cmp word [edi + 6], 0x2665
setle al
add edx, eax
xor eax, eax
cmp word [edi + 8], 0x2665
setle al
add edx, eax
xor eax, eax
cmp word [edi + 0xa], 0x2665
setle al
add edx, eax
mov eax, 0
cmp dx, 3
mov edx, dword [ebp + 0x18]
cmovge ebx, eax
mov eax, 0
cmovge ecx, eax
movsx eax, word [edx]
add eax, 1
cmp eax, ecx
setl al
movzx eax, al
sub bx, ax
mov word [ebp - 0x38], bx
jmp 0xd04db4
mov dword [ebp - 0x1c], 0
jmp 0xd04f52
add dword [ebp - 0x1c], 2
cmp dword [ebp - 0x1c], 0x80
je 0xd04e5e
mov ebx, dword [ebp - 0x1c]
mov eax, dword [ebp + 0x10]
movzx edx, word [ebx + eax]
test dx, dx
je 0xd04f41
mov esi, ebx
xor edi, edi
add esi, dword [ebp + 0x1c]
jmp 0xd04f7a
mov ecx, dword [ebp - 0x1c]
mov ebx, dword [ebp + 0x10]
movzx edx, word [ecx + ebx]
movsx eax, word [edi + edi + 0x12e2ce0]
mov dword [esp + 4], eax
movsx eax, dx
mov dword [esp], eax
call fcn.00d05d30
movsx edx, word [esi]
cwde
add eax, edx
mov edx, eax
mov ecx, eax
sar edx, 0x1f
sar ecx, 0xf
mov ebx, edx
xor ebx, 0x7fff
cmp ecx, edx
cmovne eax, ebx
add edi, 1
mov word [esi], ax
add esi, 2
cmp edi, 0x40
jne 0xd04f70
jmp 0xd04f41
add word [ebp - 0x38], 1
jmp 0xd04db4