Function at 0x40bf00
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
mov esi, dword [esp + 0x24]
push edi
mov eax, dword [esi + 0x4530]
mov ecx, dword [esi + 0x4534]
mov edx, eax
mov edi, ecx
sub edx, 1
sbb edi, 0
mov dword [esi + 0x4530], edx
test ecx, ecx
mov dword [esi + 0x4534], edi
jg 0x40bf41
jl 0x40bf37
test eax, eax
ja 0x40bf41
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [esi + 0x14f30]
test eax, eax
jne 0x40c37c
mov eax, dword [esi + 0x4c]
test eax, eax
je 0x40c097
mov eax, dword [esi + 0x54]
mov byte [esi + 0x14f3c], 0
test eax, eax
je 0x40bf86
xor edi, edi
xor ecx, ecx
mov dword [esp + 0x28], edi
mov dword [esp + 0x10], ecx
mov dword [esi], 1
mov byte [esi + 0x14f3c], 1
jmp switch.0x0040c019
mov edx, dword [esi + 0x58]
mov ebx, dword [esi + 0x14f28]
mov ebp, dword [esi + 0x5c]
mov eax, 0x2800
mov ecx, 3
mov dword [esp + 0x14], eax
xor edi, edi
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], edx
cmp ecx, 3
jne 0x40c010
mov ecx, dword [esi + 0x4560]
mov edx, dword [esi + 0x64]
sub eax, edi
mov dword [esp + 0x28], eax
lea eax, [esp + 0x10]
push eax
mov eax, dword [esi + 0x60]
push ecx
mov ecx, 0x20
call fcn.004f44e0
mov edx, dword [esi + 0x60]
mov ecx, dword [esp + 0x20]
push eax
push edx
push ebp
lea edx, [esp + 0x3c]
push ecx
mov eax, ebp
push edx
push ebx
sar eax, 0x1f
push 0
call dword [esi + 0x455c]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x18]
add edi, eax
add ebx, eax
add ecx, eax
mov eax, dword [esp + 0x14]
adc ebp, 0
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x10]
cmp edi, eax
jb 0x40bfaa
cmp ecx, 3
mov dword [esp + 0x28], edi
ja case.default.0x40c019
jmp dword [ecx*4 + 0x40c3b4]
mov eax, edi
and eax, 0xffff
mov dword [esi + 0x14f30], eax
je 0x40c057
mov ebx, dword [esi + 0x58]
add ebx, eax
mov dword [esi + 0x58], ebx
mov edi, dword [esi + 0x5c]
adc edi, 0
xor eax, eax
test ecx, ecx
sete al
test ecx, ecx
sete cl
mov dword [esi + 0x5c], edi
mov dword [esi + 0x54], eax
mov byte [esi + 0x14f3c], cl
jmp case.default.0x40c019
mov dword [esi + 0x54], 1
jmp 0x40c06a
mov dword [esi + 0x14f30], 0xffffffff
mov byte [esi + 0x14f3c], 1
mov eax, dword [esi + 0x14f30]
test eax, eax
ja 0x40c238
mov eax, dword [esi + 0x54]
test eax, eax
jne 0x40c08d
mov byte [esi + 0x14f3c], 1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [esi + 0x14f28]
mov ecx, dword [esi + 0x14f3e]
mov ebx, dword [0x500208]
lea edx, [esp + 0x28]
push 0
push edx
push 0x2800
push eax
push ecx
call ebx
cmp eax, 1
jne 0x40c0d0
mov edx, dword [esp + 0x28]
and edx, 0xffff
mov dword [esi + 0x14f30], edx
jmp 0x40c0da
mov dword [esi + 0x14f30], 0xffffffff
mov eax, dword [esi + 0x14f30]
test eax, eax
mov eax, dword [esi + 0x4eba]
ja 0x40c0ff
test eax, eax
jne 0x40c107
mov byte [esi + 0x14f3c], 1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
test eax, eax
je 0x40c238
mov eax, dword [esi + 0x14f30]
test eax, eax
ja 0x40c238
mov eax, dword [esi + 0x4e14]
cmp eax, 0xffffffff
je 0x40c12f
mov ecx, dword [esi + 0x4ebe]
inc ecx
cmp ecx, eax
jg 0x40c307
call fcn.00404c70
mov eax, dword [esi + 0x4e14]
cmp eax, 0xffffffff
jne 0x40c170
mov eax, dword [esi + 0x38]
test eax, eax
je 0x40c15d
mov edx, dword [esi + 0x4ebe]
push esi
add edx, 2
push 0
push edx
call fcn.0040a3c0
add esp, 0xc
jmp 0x40c1ab
mov eax, dword [esi + 0x4ebe]
push 0x550de4
add eax, 2
push 0
push eax
jmp 0x40c19f
mov ecx, dword [esi + 0x38]
test ecx, ecx
je 0x40c18e
mov ecx, dword [esi + 0x4ebe]
inc eax
push esi
add ecx, 2
push eax
push ecx
call fcn.0040a3c0
add esp, 0xc
jmp 0x40c1ab
mov edx, dword [esi + 0x4ebe]
inc eax
push 0x550de4
add edx, 2
push eax
push edx
push 1
push 0
call fcn.004080e0
add esp, 0x14
cmp eax, 1
jne 0x40c27c
mov eax, dword [esi + 0x4ebe]
lea edi, [esi + 0x14f42]
add eax, 2
push eax
push edi
call fcn.0040cee0
add esp, 8
test eax, eax
je 0x40c22a
push edi
call fcn.00404c20
add esp, 4
test eax, eax
jne 0x40c22a
mov edx, dword [esi + 0x14f28]
lea ecx, [esp + 0x28]
push eax
mov eax, dword [esi + 0x14f3e]
push ecx
push 0x2800
push edx
push eax
call ebx
cmp eax, 1
jne 0x40c220
mov eax, dword [esp + 0x28]
test eax, eax
jbe 0x40c220
and eax, 0xffff
mov dword [esi + 0x14f30], eax
mov eax, dword [esi + 0x4ebe]
inc eax
mov dword [esi + 0x4ebe], eax
jmp 0x40c22a
mov dword [esi + 0x14f30], 0
mov eax, dword [esi + 0x4eba]
test eax, eax
jne 0x40c107
mov eax, dword [esi + 0x50]
test eax, eax
je 0x40c311
mov edi, dword [esi + 0x14f30]
test edi, edi
jbe 0x40c311
mov ecx, dword [esi + 0x4530]
mov eax, dword [esi + 0x4534]
add ecx, 1
adc eax, 0
xor edx, edx
cmp edx, eax
jl 0x40c295
jg 0x40c26f
cmp edi, ecx
jbe 0x40c295
mov ecx, dword [esi + 0x4530]
inc ecx
mov dword [esp + 0x14], ecx
jmp 0x40c299
cmp eax, 2
jne 0x40c307
mov dword [esi], 1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov dword [esp + 0x14], edi
mov eax, dword [esi + 0x4560]
mov ebx, dword [esi + 0x58]
mov edi, dword [esi + 0x5c]
lea edx, [esp + 0x10]
push edx
mov edx, dword [esi + 0x64]
push eax
mov eax, dword [esi + 0x60]
mov ecx, 0x20
mov dword [esp + 0x18], 3
call fcn.004f44e0
mov ecx, dword [esi + 0x60]
push eax
push ecx
mov ecx, dword [esi + 0x14f28]
push edi
lea eax, [esp + 0x28]
push ebx
mov edx, edi
push eax
push ecx
sar edx, 0x1f
push 2
call dword [esi + 0x455c]
mov eax, dword [esp + 0x10]
test eax, eax
jl 0x40c311
cmp eax, 2
jg 0x40c311
mov dword [esi + 0x14f30], 0xffffffff
mov byte [esi + 0x14f3c], 1
mov dword [esi], 1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [esi + 0x4ec2]
mov edi, dword [esi + 0x14f28]
test eax, eax
mov dword [esi + 0x14f2c], edi
je 0x40c37c
mov ecx, dword [esi + 0x4530]
mov eax, dword [esi + 0x4534]
mov ebx, dword [esi + 0x14f30]
add ecx, 1
adc eax, 0
xor edx, edx
cmp edx, eax
jl 0x40c354
jg 0x40c34b
cmp ebx, ecx
jbe 0x40c354
mov eax, dword [esi + 0x4530]
inc eax
jmp 0x40c356
mov eax, ebx
mov edx, eax
dec eax
test edx, edx
je 0x40c37c
lea ebp, [eax + 1]
call fcn.0040d3c0
mov ebx, eax
xor eax, eax
mov al, byte [edi]
xor ebx, eax
push ebx
call fcn.0040d3f0
add esp, 4
mov byte [edi], bl
inc edi
dec ebp
jne 0x40c360
mov ecx, dword [esi + 0x14f2c]
mov eax, dword [esp + 0x24]
pop edi
movzx dx, byte [ecx]
mov word [eax], dx
mov ecx, dword [esi + 0x14f2c]
mov eax, dword [esi + 0x14f30]
inc ecx
dec eax
mov dword [esi + 0x14f2c], ecx
mov dword [esi + 0x14f30], eax
pop esi
pop ebp
mov eax, 8
pop ebx
add esp, 0x10
ret