Function at 0x682c40
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x10
push ebx
mov ebx, ecx
push ebp
push edi
mov eax, dword [ebx + 0x738]
mov dword [esp + 0x18], ebx
cmp eax, 0xffffffff
je 0x682e83
push eax
call fcn.0045c0b0
xor ebp, ebp
add esp, 4
cmp eax, ebp
je 0x682e83
push ebp
add eax, 0x14
push 4
push eax
mov eax, dword [0x829474]
lea ecx, [eax*4 + 0x820de0]
push ecx
call fcn.0045cba0
mov eax, dword [0x829474]
add esp, 0x10
lea edi, [eax*4 + 0x820de0]
inc eax
cmp eax, 8
mov dword [esp + 0x14], edi
mov dword [0x829474], eax
jl 0x682cab
mov dword [0x829474], ebp
push ebp
call fcn.0045d120
mov eax, dword [0x81c700]
add esp, 4
inc eax
cmp eax, 0x186a0
mov dword [0x81c700], eax
jb 0x682e7b
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, eax
mov dword [0x81c700], ebp
sub edx, ecx
cmp edx, eax
jne 0x682cf3
call fcn.00406630
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, ecx
sub edx, eax
cmp edx, ecx
jne 0x682d00
call fcn.00406630
mov ecx, 0x83f450
call fcn.004065e0
mov ecx, dword [0x829468]
cmp eax, ecx
jb 0x682d2a
mov edx, ecx
or edx, eax
je 0x682d2a
mov edx, eax
sub edx, ecx
cmp edx, 0x3a98
jbe 0x682e7b
mov cl, byte [0x81c6fc]
test cl, cl
jne 0x682e7b
mov dword [0x829468], eax
mov eax, dword [0x8294e8]
push esi
mov esi, dword [0x829478]
cmp eax, ebp
mov byte [0x81c6fc], 1
not esi
mov dword [esp + 0x14], ebp
jle 0x682de0
mov dword [esp + 0x10], 0x820e44
jmp 0x682d6a
xor ebp, ebp
mov eax, dword [esp + 0x10]
mov eax, dword [eax]
cmp eax, ebp
je 0x682db8
mov ecx, dword [eax + 4]
cmp ecx, ebp
jle 0x682db8
mov edi, dword [eax]
mov ebp, dword [edi + 0xc]
sar ebp, 2
test edi, edi
je 0x682db8
xor ebx, ebx
test ecx, ecx
jle 0x682db8
mov ecx, edi
call fcn.00406620
xor esi, eax
lea eax, [edi + 0x14]
test ebp, ebp
jle 0x682da9
mov ecx, ebp
mov edx, dword [eax]
add eax, 4
xor esi, edx
dec ecx
jne 0x682d9f
mov ecx, dword [esp + 0x10]
mov edi, dword [edi + 4]
inc ebx
mov edx, dword [ecx]
cmp ebx, dword [edx + 4]
jl 0x682d8d
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov ecx, dword [0x8294e8]
inc eax
add edx, 4
cmp eax, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edx
jl 0x682d68
mov edi, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
xor ebp, ebp
mov eax, dword [0x8294d8]
cmp esi, eax
pop esi
je 0x682def
call fcn.00406630
cmp dword [0x8294e8], ebp
je 0x682e74
mov ecx, 0x829464
mov dword [esp + 0xc], ebp
call fcn.00406620
test eax, eax
je 0x682e36
mov ecx, dword [0x829464]
lea eax, [esp + 0xc]
push eax
push ecx
call fcn.00407b70
add esp, 8
test al, al
je 0x682e31
mov eax, dword [esp + 0xc]
cmp eax, ebp
je 0x682e31
cmp dword [eax], 0x29874362
je 0x682e36
call fcn.00406630
mov ecx, 0x8294b0
mov dword [esp + 0xc], ebp
call fcn.00406620
test eax, eax
je 0x682e74
mov eax, dword [0x8294b0]
lea edx, [esp + 0xc]
push edx
push eax
call fcn.00407b70
add esp, 8
test al, al
je 0x682e6f
mov eax, dword [esp + 0xc]
cmp eax, ebp
je 0x682e6f
cmp dword [eax], 0xbad0bad
je 0x682e74
call fcn.00406630
mov byte [0x81c6fc], 0
cmp edi, ebp
je 0x682e83
mov eax, dword [edi]
jmp 0x682e88
mov eax, dword [0x89fe8c]
mov cl, byte [esp + 0x24]
test cl, cl
je 0x682e9d
mov ecx, ebx
call fcn.007204c0
mov eax, dword [eax + 0x88]
mov edx, dword [ebx]
push eax
mov eax, dword [esp + 0x24]
push 0x3f800000
push eax
mov ecx, ebx
call dword [edx + 0x54]
pop edi
pop ebp
pop ebx
add esp, 0x10
ret 8