Function at 0x417d40
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov eax, dword [ebx]
push ebx
mov dword [ebp - 4], 0
mov ecx, dword [eax]
mov dword [ebp - 0x14], ecx
call fcn.004179e0
mov esi, dword [ebx + 0x40]
add esp, 4
test esi, esi
mov ecx, eax
jne 0x417d93
mov eax, dword [ebx + 0x34]
test eax, eax
je 0x417d7f
mov eax, dword [ebx + 0x30]
add eax, ecx
cdq
idiv dword [ebx + 0x18]
mov dword [ebx + 8], edx
test esi, esi
jne 0x417d93
mov eax, dword [ebx + 0x14]
mov ecx, dword [ebx + 0x1c]
dec eax
imul eax, dword [ebx + 0x10]
imul eax, ecx
jmp 0x417daa
sub ecx, dword [ebx + 8]
mov edx, ecx
jns 0x417d9d
add edx, dword [ebx + 0x18]
dec edx
jns 0x417da2
xor edx, edx
mov ecx, dword [ebx + 0x1c]
mov eax, ecx
imul eax, edx
mov edx, dword [ebp + 0x10]
cmp edx, eax
jle 0x417dbd
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x18]
mov edi, dword [ebx + 8]
sub eax, edi
imul eax, ecx
cmp edx, eax
jle 0x417dd6
sub edx, eax
mov dword [ebp + 0x10], eax
mov dword [ebp - 4], edx
mov edx, eax
mov eax, dword [sym.imp.alleg40.dll_Ordinal_166]
mov eax, dword [eax]
mov eax, dword [eax + 0x30]
test eax, eax
mov dword [ebp - 0x10], eax
je 0x417e06
mov edi, dword [ebx + 4]
test edi, edi
jl 0x417e06
mov eax, edx
mov esi, dword [ebx + 8]
cdq
idiv ecx
add eax, esi
push eax
push esi
push edi
call dword [ebp - 0x10]
mov edx, dword [ebp + 0x10]
add esp, 0xc
jmp 0x417e11
imul ecx, dword [ebx + 8]
mov eax, dword [ebx]
add ecx, dword [eax + 0x20]
mov eax, ecx
test eax, eax
jne 0x417e21
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x14], 0x10
jne 0x417e8e
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x10], edx
test edx, edx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], eax
je 0x417ea3
test dl, 7
je 0x417e5e
mov si, word [ecx]
sub edx, 2
xor si, 0x8000
add ecx, 2
mov word [eax], si
add eax, 2
test dl, 7
jne 0x417e3c
mov dword [ebp - 0x10], edx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x10]
shr ecx, 3
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 8]
mov ebx, 0x80008000
mov eax, dword [esi]
mov edx, dword [esi + 4]
add esi, 8
xor eax, ebx
xor edx, ebx
mov dword [edi], eax
mov dword [edi + 4], edx
add edi, 8
dec ecx
jne 0x417e6f
mov ebx, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
jmp 0x417ea3
mov esi, dword [ebp + 0xc]
mov ecx, edx
mov edi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0xc]
mov eax, dword [sym.imp.alleg40.dll_Ordinal_166]
add ecx, edx
mov dword [ebp + 0xc], ecx
mov ecx, dword [eax]
mov ecx, dword [ecx + 0x34]
test ecx, ecx
je 0x417ec9
mov eax, dword [ebx + 4]
test eax, eax
jl 0x417ec9
push eax
call ecx
mov edx, dword [ebp + 0x10]
add esp, 4
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x417fb9
mov eax, dword [sym.imp.alleg40.dll_Ordinal_166]
mov eax, dword [eax]
mov esi, dword [eax + 0x30]
test esi, esi
je 0x417f00
mov edi, dword [ebx + 4]
test edi, edi
jl 0x417f00
mov eax, ecx
cdq
idiv dword [ebx + 0x1c]
push eax
push 0
push edi
call esi
mov ecx, dword [ebp - 4]
mov edx, dword [ebp + 0x10]
add esp, 0xc
jmp 0x417f05
mov eax, dword [ebx]
mov eax, dword [eax + 0x20]
test eax, eax
jne 0x417f15
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x14], 0x10
jne 0x417f7f
mov esi, dword [ebp + 0xc]
mov edx, eax
test cl, 7
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x14], esi
mov dword [ebp + 0xc], edx
je 0x417f4f
mov ax, word [esi]
sub ecx, 2
xor ax, 0x8000
add esi, 2
mov word [edx], ax
add edx, 2
test cl, 7
jne 0x417f2e
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x14], esi
mov dword [ebp + 0xc], edx
mov ecx, dword [ebp - 0x10]
shr ecx, 3
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp + 0xc]
mov ebx, 0x80008000
mov eax, dword [esi]
mov edx, dword [esi + 4]
add esi, 8
xor eax, ebx
xor edx, ebx
mov dword [edi], eax
mov dword [edi + 4], edx
add edi, 8
dec ecx
jne 0x417f60
mov ebx, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
jmp 0x417f92
mov esi, dword [ebp + 0xc]
mov edi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [sym.imp.alleg40.dll_Ordinal_166]
mov eax, dword [ecx]
mov ecx, dword [eax + 0x34]
test ecx, ecx
je 0x417fb6
mov eax, dword [ebx + 4]
test eax, eax
jl 0x417fb6
push eax
call ecx
mov ecx, dword [ebp - 4]
mov edx, dword [ebp + 0x10]
add esp, 4
jmp 0x417fb9
mov ecx, dword [ebp - 4]
lea eax, [ecx + edx]
mov edi, dword [ebx + 8]
cdq
idiv dword [ebx + 0x1c]
mov edx, dword [ebx + 0x18]
add edi, eax
mov ecx, edi
mov dword [ebx + 8], edi
cmp ecx, edx
jl 0x417fd6
sub ecx, edx
mov dword [ebx + 8], ecx
mov ecx, dword [ebx + 0x44]
mov edx, dword [ebx + 0x40]
add ecx, eax
add edx, eax
mov dword [ebx + 0x44], ecx
mov ecx, dword [ebx + 0x14]
mov dword [ebx + 0x40], edx
mov edx, dword [ebx + 0x38]
mov esi, 1
push ecx
push edx
mov dword [ebx + 0x34], esi
call fcn.00418f20
mov eax, dword [ebx + 0x2c]
add esp, 8
test eax, eax
mov dword [ebx + 0x3c], 0
jne 0x41802a
mov eax, dword [ebx + 4]
test eax, eax
jl 0x41802a
mov ecx, dword [ebx + 0x40]
mov edx, dword [ebx + 0x30]
cmp ecx, edx
jl 0x41802a
push eax
call dword [sym.imp.alleg40.dll_Ordinal_738]
add esp, 4
mov dword [ebx + 0x2c], esi
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret