Function at 0x100467f0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push esi
push edi
push es
mov edx, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x14]
cmp ecx, ebx
jge 0x1004680a
xchg ebx, ecx
cmp dword [edx + 8], 0
je 0x10046845
cmp eax, dword [edx + 0x14]
jl 0x100469dd
cmp eax, dword [edx + 0x18]
jge 0x100469dd
cmp ebx, dword [edx + 0xc]
jge 0x10046833
cmp ecx, dword [edx + 0xc]
jl 0x100469dd
mov ebx, dword [edx + 0xc]
cmp ecx, dword [edx + 0x10]
jl 0x10046845
cmp ebx, dword [edx + 0x10]
jge 0x100469dd
mov ecx, dword [edx + 0x10]
dec ecx
sub ecx, ebx
inc ecx
mov es, word [edx + 0x3c]
call dword [edx + 0x20]
mov edi, eax
add edi, ebx
cmp dword [sym.alleg40.dll__drawing_mode], 0
je 0x1004699c
cmp dword [sym.alleg40.dll__drawing_mode], 1
jne 0x1004688c
mov eax, dword [ebp + 0x10]
call dword [edx + 0x24]
mov esi, eax
add esi, ebx
mov bl, byte [ebp + 0x18]
lea esi, [esi]
mov al, byte es:[esi]
xor al, bl
mov byte es:[edi], al
inc esi
inc edi
dec ecx
jg 0x10046878
jmp 0x100469dd
cmp dword [sym.alleg40.dll__drawing_mode], 5
jne 0x10046910
mov eax, dword [ebp + 0x10]
call dword [edx + 0x24]
mov esi, eax
add esi, ebx
xor ebx, ebx
mov bh, byte [ebp + 0x18]
mov edx, dword [sym.alleg40.dll_color_map]
shr ecx, 1
jae 0x100468ba
mov bl, byte es:[esi]
mov al, byte [edx + ebx]
mov byte es:[edi], al
inc esi
inc edi
shr ecx, 1
jae 0x100468d7
mov ax, word es:[esi]
mov bl, al
mov al, byte [edx + ebx]
mov bl, ah
mov ah, byte [edx + ebx]
mov word es:[edi], ax
add esi, 2
add edi, 2
or ecx, ecx
je 0x100469dd
nop
mov eax, dword es:[esi]
mov bl, al
mov al, byte [edx + ebx]
mov bl, ah
mov ah, byte [edx + ebx]
rol eax, 0x10
mov bl, al
mov al, byte [edx + ebx]
mov bl, ah
mov ah, byte [edx + ebx]
rol eax, 0x10
mov dword es:[edi], eax
add esi, 4
add edi, 4
dec ecx
jg 0x100468e0
jmp 0x100469dd
mov eax, dword [ebp + 0x10]
sub ebx, dword [sym.alleg40.dll__drawing_x_anchor]
and ebx, dword [sym.alleg40.dll__drawing_x_mask]
sub eax, dword [sym.alleg40.dll__drawing_y_anchor]
and eax, dword [sym.alleg40.dll__drawing_y_mask]
mov edx, dword [sym.alleg40.dll__drawing_pattern]
mov eax, dword [edx + eax*4 + 0x40]
mov esi, eax
mov edx, dword [sym.alleg40.dll__drawing_x_mask]
cmp dword [sym.alleg40.dll__drawing_mode], 2
je 0x10046968
mov ah, byte [ebp + 0x18]
cmp dword [sym.alleg40.dll__drawing_mode], 3
je 0x10046978
mov esi, esi
mov al, byte [esi + ebx]
test al, al
je 0x1004695e
mov byte es:[edi], ah
inc ebx
and ebx, edx
inc edi
dec ecx
jg 0x10046954
jmp 0x100469dd
mov al, byte [esi + ebx]
mov byte es:[edi], al
inc ebx
and ebx, edx
inc edi
dec ecx
jg 0x10046968
jmp 0x100469dd
mov al, byte [esi + ebx]
test al, al
je 0x1004698c
mov byte es:[edi], ah
inc ebx
and ebx, edx
inc edi
dec ecx
jg 0x10046978
jmp 0x100469dd
mov byte es:[edi], 0
inc ebx
and ebx, edx
inc edi
dec ecx
jg 0x10046978
jmp 0x100469dd
mov dl, byte [ebp + 0x18]
mov dh, dl
shrd eax, edx, 0x10
mov ax, dx
cld
test edi, 1
je 0x100469b3
stosb byte es:[edi], al
dec ecx
test edi, 2
je 0x100469c2
sub ecx, 2
jl 0x100469ef
stosw word es:[edi], ax
mov dx, cx
shr ecx, 2
je 0x100469cc
rep stosd dword es:[edi], eax
test dx, 2
je 0x100469d5
stosw word es:[edi], ax
test dx, 1
je 0x100469dd
stosb byte es:[edi], al
pop es
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x1c]
call dword [eax + 8]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
add ecx, 2
jmp 0x100469c2