Function at 0x10040ac0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push esi
push edi
mov ecx, dword [esp + 0x1c]
cmp ecx, 0
je 0x10040c1b
pushfd
cld
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
mov ebp, dword [esp + 0x28]
lea esi, [esp - 0x40]
and esi, 0xffffffc0
lea edi, [edx - 0x7f]
sub edi, esi
neg edi
and edi, 0x3c0
sub esi, edi
mov edi, dword [esp + 0x2c]
xchg esi, esp
add esp, 4
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], ebp
call 0x10040b28
pop ebp
lea ebp, [ebp - 0x1068]
mov esi, 0x20
mov eax, dword [ebp]
mov ebx, dword [ebp + 0x20]
mov ecx, dword [ebp + 0x40]
mov edx, dword [ebp + 0x60]
lea ebp, [ebp + 0x80]
dec esi
jne 0x10040b34
mov eax, dword [esp + 0x24]
sub ebp, 0x1000
mov esi, dword [esp + 0x18]
mov edx, dword [eax + 0x110]
cmp edi, 0
je 0x10040c70
mov ecx, dword [esp + 0x20]
mov edi, dword [esp + 0x28]
shl edx, 6
lea edx, [eax + edx]
mov dword [esp + 0x10], edx
test ecx, 0xfffffff0
je 0x10040c24
mov eax, dword [edi]
mov ebx, dword [edi + 4]
mov ecx, dword [edi + 8]
mov edx, dword [edi + 0xc]
xor eax, dword [esi]
xor ebx, dword [esi + 4]
xor ecx, dword [esi + 8]
bswap eax
xor edx, dword [esi + 0xc]
bswap ebx
mov edi, dword [esp + 0x24]
bswap ecx
bswap edx
call fcn.1003e900
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
bswap eax
bswap ebx
bswap ecx
mov dword [edi], eax
bswap edx
mov dword [edi + 4], ebx
mov dword [edi + 8], ecx
mov dword [edi + 0xc], edx
mov ecx, dword [esp + 0x20]
lea esi, [esi + 0x10]
mov dword [esp + 0x18], esi
lea edx, [edi + 0x10]
mov dword [esp + 0x1c], edx
sub ecx, 0x10
test ecx, 0xfffffff0
mov dword [esp + 0x20], ecx
jne 0x10040b90
test ecx, 0xf
jne 0x10040c24
mov esi, dword [esp + 0x28]
mov ecx, dword [edi + 8]
mov edx, dword [edi + 0xc]
mov dword [esi], eax
mov dword [esi + 4], ebx
mov dword [esi + 8], ecx
mov dword [esi + 0xc], edx
mov esp, dword [esp + 0x14]
popfd
pop edi
pop esi
pop ebx
pop ebp
ret
mov eax, edi
mov edi, dword [esp + 0x1c]
push eax
mov ebx, 0x10
sub ebx, ecx
cmp edi, esi
je 0x10040c45
nop
nop
mov esi, esi
rep movsb byte es:[edi], byte [esi]
jmp 0x10040c48
lea edi, [edi + ecx]
mov ecx, ebx
xor eax, eax
mov esi, esi
rep stosb byte es:[edi], al
pop edi
mov esi, dword [esp + 0x1c]
mov eax, dword [edi]
mov ebx, dword [edi + 4]
mov dword [esp + 0x20], 0x10
jmp 0x10040b90
shl edx, 6
lea edx, [eax + edx]
mov dword [esp + 0x10], eax
mov dword [esp + 0x24], edx
cmp esi, dword [esp + 0x1c]
je 0x10040d50
mov edi, dword [esp + 0x28]
mov dword [esp + 0x2c], edi
mov eax, dword [esi]
mov ebx, dword [esi + 4]
mov ecx, dword [esi + 8]
bswap eax
mov edx, dword [esi + 0xc]
bswap ebx
mov edi, dword [esp + 0x24]
bswap ecx
bswap edx
call fcn.1003ed50
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0x20]
bswap eax
bswap ebx
bswap ecx
xor eax, dword [edi]
bswap edx
xor ebx, dword [edi + 4]
xor ecx, dword [edi + 8]
xor edx, dword [edi + 0xc]
sub esi, 0x10
jb 0x10040d28
mov dword [esp + 0x20], esi
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
mov dword [edi], eax
mov dword [edi + 4], ebx
mov dword [edi + 8], ecx
mov dword [edi + 0xc], edx
mov dword [esp + 0x2c], esi
lea esi, [esi + 0x10]
mov dword [esp + 0x18], esi
lea edi, [edi + 0x10]
mov dword [esp + 0x1c], edi
jne 0x10040c90
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0x28]
mov eax, dword [edi]
mov ebx, dword [edi + 4]
mov ecx, dword [edi + 8]
mov edx, dword [edi + 0xc]
mov dword [esi], eax
mov dword [esi + 4], ebx
mov dword [esi + 8], ecx
mov dword [esi + 0xc], edx
jmp 0x10040e04
lea edi, [esp + 0x2c]
mov dword [edi], eax
mov dword [edi + 4], ebx
mov dword [edi + 8], ecx
mov dword [edi + 0xc], edx
lea ecx, [esi + 0x10]
mov esi, edi
mov edi, dword [esp + 0x1c]
mov esi, esi
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x18]
jmp 0x10040d06
lea edi, [esp + 0x2c]
mov eax, dword [esi]
mov ebx, dword [esi + 4]
mov ecx, dword [esi + 8]
mov edx, dword [esi + 0xc]
mov dword [edi], eax
mov dword [edi + 4], ebx
mov dword [edi + 8], ecx
bswap eax
mov dword [edi + 0xc], edx
bswap ebx
mov edi, dword [esp + 0x24]
bswap ecx
bswap edx
call fcn.1003ed50
mov edi, dword [esp + 0x28]
mov esi, dword [esp + 0x1c]
bswap eax
bswap ebx
bswap ecx
xor eax, dword [edi]
bswap edx
xor ebx, dword [edi + 4]
xor ecx, dword [edi + 8]
xor edx, dword [edi + 0xc]
mov dword [esi], eax
mov dword [esi + 4], ebx
mov dword [esi + 8], ecx
mov dword [esi + 0xc], edx
lea esi, [esi + 0x10]
mov dword [esp + 0x1c], esi
lea esi, [esp + 0x2c]
mov eax, dword [esi]
mov ebx, dword [esi + 4]
mov ecx, dword [esi + 8]
mov edx, dword [esi + 0xc]
mov dword [edi], eax
mov dword [edi + 4], ebx
mov dword [edi + 8], ecx
mov dword [edi + 0xc], edx
mov esi, dword [esp + 0x18]
lea esi, [esi + 0x10]
mov dword [esp + 0x18], esi
mov ecx, dword [esp + 0x20]
sub ecx, 0x10
jb 0x10040dec
mov dword [esp + 0x20], ecx
jne 0x10040d50
jmp 0x10040e04
mov edi, dword [esp + 0x1c]
lea esi, [esp + 0x2c]
lea edi, [edi + ecx]
lea esi, [esi + ecx + 0x10]
neg ecx
mov esi, esi
rep movsb byte es:[edi], byte [esi]
nop
nop
nop
mov esp, dword [esp + 0x14]
popfd
pop edi
pop esi
pop ebx
pop ebp
ret