Function at 0x413940
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x20
mov ecx, dword [esp + 0x24]
push ebx
push esi
xor esi, esi
xor eax, eax
cmp ecx, esi
push edi
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], esi
mov dword [esp + 0x14], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0xc], esi
jne 0x413973
mov eax, 0xe101
mov ebx, dword [esp + 0x34]
cmp ebx, esi
jne 0x413980
mov eax, 0xe115
cmp dword [esp + 0x4c], esi
jne 0x41398b
mov eax, 0xe11c
cmp dword [esp + 0x48], esi
jne 0x413996
mov eax, 0xe11d
cmp dword [esp + 0x50], esi
jne 0x4139a8
pop edi
pop esi
mov eax, 0xe121
pop ebx
add esp, 0x20
ret
cmp eax, esi
jne 0x413d33
mov edi, dword [esp + 0x58]
push ebp
push edi
push ecx
call fcn.0040fd70
mov ebp, eax
push edi
push ebx
mov dword [esp + 0x44], ebp
call fcn.0040fd70
add esp, 0x10
mov ebx, eax
cmp ebp, esi
mov dword [esp + 0x38], ebx
je 0x413d0f
cmp ebx, esi
je 0x413d0f
cmp dword [ebp], 0x2001
je 0x4139f5
mov esi, 0xe103
jmp 0x413d14
cmp dword [ebx], 0x2003
je 0x413a07
mov esi, 0xe116
jmp 0x413d14
push edi
push ebp
call fcn.00418a70
mov ebx, eax
mov eax, dword [esp + 0x40]
neg ebx
sbb ebx, ebx
push edi
push eax
inc ebx
call fcn.004189e0
add esp, 0x10
neg eax
sbb eax, eax
inc eax
test ebx, eax
jne 0x413a36
mov esi, 0xf003
jmp 0x413c78
mov eax, dword [ebp + 8]
test eax, eax
jne 0x413a47
mov esi, 0xe103
jmp 0x413c78
mov ecx, dword [eax]
mov dword [esp + 0x14], eax
cmp ecx, 0xd000
je 0x413a5f
mov esi, 0xe103
jmp 0x413c78
mov ecx, dword [eax + 0x18]
lea edx, [esp + 0x1c]
lea eax, [esp + 0x5c]
push edx
mov ebx, dword [ecx + 8]
push eax
add ebx, 7
push ebp
shr ebx, 3
call fcn.00418950
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x58]
mov ebp, dword [esp + 0x64]
add esp, 0xc
lea eax, [ecx + edx + 0x14]
test ebp, ebp
mov dword [esp + 0x2c], eax
jne 0x413aa1
mov ecx, dword [esp + 0x54]
mov dword [ecx], eax
jmp 0x413c72
mov edx, dword [esp + 0x54]
cmp dword [edx], eax
jae 0x413ab3
mov esi, 0xe123
jmp 0x413c74
mov edx, dword [esp + 0x34]
lea eax, [esp + 0x24]
push edi
lea ecx, [esp + 0x24]
push eax
push ecx
push 0
push 0
push 0
push 0
push edx
call fcn.00418ac0
mov esi, eax
add esp, 0x20
test esi, esi
jne 0x413c74
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x5c]
push edi
push ebp
push eax
mov eax, dword [edx + 4]
push ecx
mov ecx, dword [esp + 0x24]
push eax
push ecx
call fcn.004186e0
mov esi, eax
add esp, 0x18
test esi, esi
jne 0x413c74
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x18]
push edi
push edx
push eax
add ebp, ecx
call fcn.00419580
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x413c74
push edi
push ebx
call fcn.0040fd90
add esp, 8
mov dword [esp + 0x28], eax
test eax, eax
jne 0x413b47
mov esi, 0xf001
jmp 0x413c74
push edi
push ebx
push 0
push eax
call fcn.0040fe30
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x28]
push edi
push edx
mov eax, dword [ecx + 4]
mov ecx, dword [esp + 0x38]
push eax
mov edx, dword [ecx + 8]
mov ecx, dword [esp + 0x30]
push edx
push ecx
call dword [eax + 0x9c]
mov esi, eax
add esp, 0x24
cmp esi, 0xff00
jne 0x413b89
mov esi, 0xf502
jmp 0x413c74
cmp esi, 0xf001
je 0x413c74
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x28]
mov edx, dword [esp + 0x18]
push esi
mov ecx, dword [eax + 0x18]
push ebx
push edx
mov edx, dword [ecx + 4]
push edx
push 1
call fcn.00415e30
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x50]
push edi
add eax, 0x14
push ebp
push eax
push ecx
push edx
push esi
push ebx
call fcn.00419360
mov esi, eax
add esp, 0x30
test esi, esi
jne 0x413c74
mov ebx, dword [esp + 0x4c]
test ebx, ebx
jbe 0x413bf5
mov ecx, dword [esp + 0x50]
mov eax, ebp
sub ecx, ebp
mov esi, ebx
mov dl, byte [ecx + eax]
xor byte [eax], dl
inc eax
dec esi
jne 0x413bec
mov ecx, dword [esp + 0x34]
lea eax, [esp + 0x10]
push edi
push eax
mov edx, dword [ecx + 8]
add ebx, ebp
mov eax, dword [edx + 0x14]
push eax
push ebx
push 0x14
call fcn.004190f0
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x413c74
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0x10]
push edi
push ebp
push ecx
push edx
call fcn.004191d0
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x413c74
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x10]
push edi
push eax
push ecx
push edx
call fcn.004191d0
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x413c74
push edi
push ebx
lea eax, [esp + 0x18]
push 0x14
push eax
call fcn.00419280
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x413c74
mov edx, dword [esp + 0x54]
mov ecx, dword [esp + 0x2c]
mov dword [edx], ecx
xor esi, esi
mov ebp, dword [esp + 0x34]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x413c92
push edi
push 0
lea eax, [esp + 0x18]
push 0x14
push eax
call fcn.00419280
add esp, 0x10
mov eax, dword [esp + 0x28]
test eax, eax
je 0x413ca4
push edi
push eax
call fcn.0040fdc0
add esp, 8
mov eax, dword [esp + 0x18]
test eax, eax
je 0x413cbf
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x18]
push edi
push ecx
push edx
call fcn.00419070
add esp, 0xc
mov eax, dword [esp + 0x38]
push edi
push eax
call fcn.004188b0
mov eax, dword [esp + 0x28]
add esp, 8
test eax, eax
je 0x413ce6
push edi
lea ecx, [esp + 0x24]
push 0
push ecx
push ebp
call fcn.00418ea0
add esp, 0x10
mov eax, dword [esp + 0x24]
test eax, eax
je 0x413cff
lea edx, [esp + 0x24]
push edi
push edx
push 0
push ebp
call fcn.00418ea0
add esp, 0x10
push edi
push ebp
call fcn.00418900
mov ebx, dword [esp + 0x40]
add esp, 8
jmp 0x413d14
mov esi, 0xf003
test ebp, ebp
je 0x413d22
push edi
push ebp
call fcn.0040fd80
add esp, 8
test ebx, ebx
pop ebp
je 0x413d31
push edi
push ebx
call fcn.0040fd80
add esp, 8
mov eax, esi
pop edi
pop esi
pop ebx
add esp, 0x20
ret