Function at 0x40a310
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x24
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
push esi
mov esi, dword [ebp + 0xc]
push edi
test eax, eax
mov dword [esp + 0x10], ebx
jne 0x40a36f
test esi, esi
jne 0x40a36f
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 4]
mov edi, dword [eax + 0x20]
test edi, edi
je 0x40a36f
push str.BearMsg
call dword [sym.imp.USER32.dll_RegisterWindowMessageA]
mov esi, eax
mov eax, dword [edi + 0x20]
push 0
push 4
push esi
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [edi + 0x20]
push 1
push 4
push esi
push ecx
mov dword [ebp + 8], eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov esi, eax
mov edx, dword [ebp + 8]
mov ecx, ebx
mov dword [0x41eef0], edx
mov dword [0x41eeec], esi
call fcn.00406a30
test eax, eax
mov dword [0x41ee6c], eax
jle 0x40adba
lea eax, [eax*4 + 8]
push eax
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [0x41ee98], eax
test eax, eax
jne 0x40a3c0
push eax
push eax
push str.OUT_OF_MEMORY___left_swapping_array
call sub.MFC42.DLL_AfxMessageBox
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [0x41ee6c]
lea edx, [ecx*4 + 8]
push edx
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [0x41ee94], eax
test eax, eax
jne 0x40a3f9
push eax
push eax
push str.OUT_OF_MEMORY___right_swapping_array
call sub.MFC42.DLL_AfxMessageBox
call fcn.0040add0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
call fcn.0040b700
test eax, eax
jne 0x40a421
push eax
push eax
push str.Error_allocating_memory_for_point_index
call sub.MFC42.DLL_AfxMessageBox
call fcn.0040add0
call fcn.0040ade0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [0x41eef0]
test ecx, ecx
je 0x40a435
push str.Reading_in_point_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41ee90]
xor esi, esi
mov dword [0x41eee8], eax
mov dword [0x41eee4], eax
mov eax, dword [0x41ee80]
mov dword [0x41eeb8], eax
mov dword [0x41eeb4], eax
mov eax, dword [0x41ee6c]
test eax, eax
jbe 0x40a4a4
mov edi, 4
push esi
mov ecx, ebx
call fcn.00408360
mov ecx, dword [0x41eeb4]
cdq
xor eax, edx
sub eax, edx
mov dword [ecx], eax
mov edx, dword [0x41eee4]
mov dword [edx], esi
mov eax, dword [0x41eeb4]
mov edx, dword [0x41eee4]
add eax, edi
mov dword [0x41eeb4], eax
mov eax, dword [0x41ee6c]
add edx, edi
inc esi
cmp esi, eax
mov dword [0x41eee4], edx
jb 0x40a463
mov ecx, dword [0x41eef0]
mov eax, dword [0x41eee4]
test ecx, ecx
mov dword [0x41eee0], eax
je 0x40a4c2
push str.Sorting_point_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov ecx, dword [0x41eee8]
mov edx, dword [0x41eeb8]
mov eax, dword [0x41eee0]
add ecx, 4
lea esi, [edx + 4]
cmp ecx, eax
mov dword [0x41eee4], ecx
mov dword [0x41eeb4], esi
jae 0x40a58d
mov eax, dword [esi]
mov edx, dword [esi - 4]
cmp eax, edx
jl 0x40a552
mov edi, dword [0x41eeb8]
mov eax, esi
sub eax, edi
mov edi, 0x64
sar eax, 2
cdq
idiv edi
test edx, edx
jne 0x40a535
mov eax, dword [0x41eeec]
test eax, eax
je 0x40a535
mov ecx, dword [eax + 0x20]
push edx
push edx
push 0x405
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [0x41eee4]
mov esi, dword [0x41eeb4]
mov eax, dword [0x41eee0]
add ecx, 4
add esi, 4
cmp ecx, eax
mov dword [0x41eee4], ecx
mov dword [0x41eeb4], esi
jb 0x40a4ed
jmp 0x40a58d
mov edx, dword [0x41ee98]
mov dword [0x41ee70], 0
mov dword [edx], 0
mov eax, dword [0x41eee0]
mov esi, dword [0x41eee8]
mov ecx, dword [0x41ee94]
mov edx, dword [0x41ee70]
sub eax, esi
sar eax, 2
dec eax
mov dword [ecx + edx*4], eax
call fcn.0040adf0
mov ecx, dword [0x41eef0]
test ecx, ecx
je 0x40a5a1
push str.Writing_point_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41eee8]
mov ecx, dword [0x41eee0]
xor edi, edi
cmp eax, ecx
mov dword [0x41eee4], eax
jae 0x40a5e7
mov esi, dword [0x41eee8]
mov edi, eax
mov ax, word [eax]
sub edi, esi
sar edi, 2
push eax
push edi
mov ecx, ebx
call fcn.00406e90
mov eax, dword [0x41eee4]
mov ecx, dword [0x41eee0]
add eax, 4
cmp eax, ecx
mov dword [0x41eee4], eax
jb 0x40a5b7
call fcn.0040b800
mov eax, dword [0x41ee6c]
mov dword [esp + 0x18], 0x39a08cea
test eax, eax
mov dword [esp + 0x1c], 0xc6293e59
mov dword [esp + 0x20], 0x39a08cea
mov dword [esp + 0x24], 0xc6293e59
mov dword [esp + 0x14], 0
jbe 0x40a9d3
mov ecx, dword [esp + 0x14]
push ecx
mov ecx, ebx
call fcn.00407c00
mov esi, eax
mov eax, dword [0x41ee6c]
mov edx, esi
and edx, 0xffff
cmp edx, eax
jge 0x40a6c6
push esi
mov ecx, ebx
call fcn.00407d70
fst qword [esp + 0x28]
fld qword [esp + 0x18]
fsub qword [0x419448]
fxch st(1)
fcompp
fnstsw ax
test ah, 1
jne 0x40a6c1
push esi
mov ecx, ebx
call fcn.00407e20
fld qword [esp + 0x28]
fsub qword [esp + 0x18]
fabs
fcomp qword [0x419448]
fnstsw ax
test ah, 1
je 0x40a68f
fcom qword [esp + 0x20]
fnstsw ax
test ah, 1
jne 0x40a6bf
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
fstp qword [esp + 0x20]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x1c], ecx
mov ecx, dword [0x41ee6c]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jb 0x40a621
jmp 0x40a9d3
fstp st(0)
mov eax, dword [0x41ee6c]
xor esi, esi
test eax, eax
jbe 0x40a739
push esi
mov ecx, ebx
call fcn.00407d70
fstp qword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
push edx
push eax
call dword [sym.imp.MSVCRT.dll__isnan]
add esp, 8
test eax, eax
jne 0x40a720
fld qword [esp + 0x18]
fcomp qword [0x4196d0]
fnstsw ax
test ah, 1
je 0x40a70f
push 1
push 0xd8635fa9
push esi
mov ecx, ebx
call fcn.00407530
fld qword [esp + 0x18]
fcomp qword [0x419590]
fnstsw ax
test ah, 0x41
jne 0x40a72f
push 1
push 0xd8635fa9
push esi
mov ecx, ebx
call fcn.00407530
mov eax, dword [0x41ee6c]
inc esi
cmp esi, eax
jb 0x40a6cc
xor esi, esi
test eax, eax
jbe 0x40a7ac
push esi
mov ecx, ebx
call fcn.00407e20
fstp qword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
push ecx
push edx
call dword [sym.imp.MSVCRT.dll__isnan]
add esp, 8
test eax, eax
jne 0x40a793
fld qword [esp + 0x18]
fcomp qword [0x4196d0]
fnstsw ax
test ah, 1
je 0x40a782
push 1
push 0xd8635fa9
push esi
mov ecx, ebx
call fcn.004075e0
fld qword [esp + 0x18]
fcomp qword [0x419590]
fnstsw ax
test ah, 0x41
jne 0x40a7a2
push 1
push 0xd8635fa9
push esi
mov ecx, ebx
call fcn.004075e0
mov eax, dword [0x41ee6c]
inc esi
cmp esi, eax
jb 0x40a73f
call fcn.0040b740
test eax, eax
jne 0x40a7d4
push eax
push eax
push str.Error_allocating_memory_for_chainage_index
call sub.MFC42.DLL_AfxMessageBox
call fcn.0040add0
call fcn.0040ade0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [0x41eef0]
test ecx, ecx
je 0x40a7e8
push str.Reading_in_chainage_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41ee8c]
xor esi, esi
mov dword [0x41eedc], eax
mov dword [0x41eed8], eax
mov eax, dword [0x41ee7c]
mov dword [0x41eeb0], eax
mov dword [0x41eeac], eax
mov eax, dword [0x41ee6c]
test eax, eax
jbe 0x40a87f
push esi
mov ecx, ebx
call fcn.00407d70
mov eax, dword [0x41eeac]
fstp qword [eax]
mov eax, dword [0x41eeac]
mov ecx, dword [eax + 4]
mov edx, dword [eax]
push ecx
push edx
call dword [sym.imp.MSVCRT.dll__isnan]
add esp, 8
test eax, eax
je 0x40a851
mov eax, dword [0x41eeac]
mov dword [eax], 0
mov ecx, dword [0x41eeac]
mov dword [ecx + 4], 0
mov edx, dword [0x41eed8]
mov dword [edx], esi
mov eax, dword [0x41eeac]
mov edx, dword [0x41eed8]
add eax, 8
mov dword [0x41eeac], eax
mov eax, dword [0x41ee6c]
add edx, 4
inc esi
cmp esi, eax
mov dword [0x41eed8], edx
jb 0x40a811
mov ecx, dword [0x41eef0]
mov eax, dword [0x41eed8]
test ecx, ecx
mov dword [0x41eed4], eax
je 0x40a89d
push str.Sorting_chainage_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov ecx, dword [0x41eedc]
mov edx, dword [0x41eeb0]
mov eax, dword [0x41eed4]
add ecx, 4
lea esi, [edx + 8]
cmp ecx, eax
mov dword [0x41eed8], ecx
mov dword [0x41eeac], esi
jae 0x40a96f
fld qword [esi]
fcomp qword [esi - 8]
fnstsw ax
test ah, 1
jne 0x40a934
mov ebx, dword [0x41eeb0]
mov eax, esi
sub eax, ebx
mov ebx, 0x64
sar eax, 3
cdq
idiv ebx
test edx, edx
jne 0x40a913
mov eax, dword [0x41eeec]
test eax, eax
je 0x40a913
mov eax, dword [eax + 0x20]
push edx
push edx
push 0x405
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [0x41eed8]
mov esi, dword [0x41eeac]
mov eax, dword [0x41eed4]
mov ebx, dword [esp + 0x10]
add ecx, 4
add esi, 8
cmp ecx, eax
mov dword [0x41eed8], ecx
mov dword [0x41eeac], esi
jb 0x40a8c8
jmp 0x40a96f
mov ecx, dword [0x41ee98]
mov dword [0x41ee70], 0
mov dword [ecx], 0
mov edx, dword [0x41eed4]
mov esi, dword [0x41eedc]
mov eax, dword [0x41ee94]
mov ecx, dword [0x41ee70]
sub edx, esi
sar edx, 2
dec edx
mov dword [eax + ecx*4], edx
call fcn.0040b010
mov ecx, dword [0x41eef0]
test ecx, ecx
je 0x40a983
push str.Writing_chainage_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41eedc]
mov ecx, dword [0x41eed4]
cmp eax, ecx
mov dword [0x41eed8], eax
jae 0x40a9c7
mov edx, dword [0x41eedc]
mov edi, eax
sub edi, edx
mov dx, word [eax]
sar edi, 2
push edx
push edi
mov ecx, ebx
call fcn.00406f50
mov eax, dword [0x41eed8]
mov ecx, dword [0x41eed4]
add eax, 4
cmp eax, ecx
mov dword [0x41eed8], eax
jb 0x40a997
call fcn.0040b820
mov ecx, ebx
call fcn.0040b8a0
call fcn.0040b780
test eax, eax
jne 0x40a9fb
push eax
push eax
push str.Error_allocating_memory_for_easting_index
call sub.MFC42.DLL_AfxMessageBox
call fcn.0040add0
call fcn.0040ade0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [0x41eef0]
test ecx, ecx
je 0x40aa0f
push str.Reading_in_easting_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41ee88]
xor esi, esi
mov dword [0x41eed0], eax
mov dword [0x41eecc], eax
mov eax, dword [0x41ee78]
mov dword [0x41eea8], eax
mov dword [0x41eea4], eax
mov eax, dword [0x41ee6c]
test eax, eax
jbe 0x40aa75
push esi
mov ecx, ebx
call fcn.00407f70
mov eax, dword [0x41eea4]
fstp qword [eax]
mov ecx, dword [0x41eecc]
mov dword [ecx], esi
mov eax, dword [0x41eea4]
mov edx, dword [0x41eecc]
add eax, 8
mov dword [0x41eea4], eax
mov eax, dword [0x41ee6c]
add edx, 4
inc esi
cmp esi, eax
mov dword [0x41eecc], edx
jb 0x40aa38
mov ecx, dword [0x41eef0]
mov edx, dword [0x41eecc]
test ecx, ecx
mov dword [0x41eec8], edx
je 0x40aa95
push str.Sorting_easting_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41eed0]
mov edx, dword [0x41eea8]
lea ecx, [eax + 4]
mov eax, dword [0x41eec8]
lea esi, [edx + 8]
cmp ecx, eax
mov dword [0x41eecc], ecx
mov dword [0x41eea4], esi
jae 0x40ab66
fld qword [esi]
fcomp qword [esi - 8]
fnstsw ax
test ah, 1
jne 0x40ab2b
mov ebx, dword [0x41eea8]
mov eax, esi
sub eax, ebx
mov ebx, 0x64
sar eax, 3
cdq
idiv ebx
test edx, edx
jne 0x40ab0a
mov eax, dword [0x41eeec]
test eax, eax
je 0x40ab0a
mov eax, dword [eax + 0x20]
push edx
push edx
push 0x405
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [0x41eecc]
mov esi, dword [0x41eea4]
mov eax, dword [0x41eec8]
mov ebx, dword [esp + 0x10]
add ecx, 4
add esi, 8
cmp ecx, eax
mov dword [0x41eecc], ecx
mov dword [0x41eea4], esi
jb 0x40aabf
jmp 0x40ab66
mov ecx, dword [0x41ee98]
mov dword [0x41ee70], 0
mov dword [ecx], 0
mov edx, dword [0x41eec8]
mov esi, dword [0x41eed0]
mov eax, dword [0x41ee94]
mov ecx, dword [0x41ee70]
sub edx, esi
sar edx, 2
dec edx
mov dword [eax + ecx*4], edx
call fcn.0040b260
mov ecx, dword [0x41eef0]
test ecx, ecx
je 0x40ab7a
push str.Writing_easting_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41eed0]
mov ecx, dword [0x41eec8]
cmp eax, ecx
mov dword [0x41eecc], eax
jae 0x40abbe
mov edx, dword [0x41eed0]
mov edi, eax
sub edi, edx
mov dx, word [eax]
sar edi, 2
push edx
push edi
mov ecx, ebx
call fcn.00406ff0
mov eax, dword [0x41eecc]
mov ecx, dword [0x41eec8]
add eax, 4
cmp eax, ecx
mov dword [0x41eecc], eax
jb 0x40ab8e
call fcn.0040b840
call fcn.0040b7c0
test eax, eax
jne 0x40abeb
push eax
push eax
push str.Error_allocating_memory_for_easting_index
call sub.MFC42.DLL_AfxMessageBox
call fcn.0040add0
call fcn.0040ade0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebp + 8]
test eax, eax
je 0x40ac02
mov ecx, dword [0x41eef0]
push str.Reading_northing_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41ee84]
xor esi, esi
mov dword [0x41eec4], eax
mov dword [0x41eec0], eax
mov eax, dword [0x41ee74]
mov dword [0x41eea0], eax
mov dword [0x41ee9c], eax
mov eax, dword [0x41ee6c]
test eax, eax
jbe 0x40ac68
push edi
mov ecx, ebx
call fcn.00407eb0
mov eax, dword [0x41ee9c]
fstp qword [eax]
mov ecx, dword [0x41eec0]
mov dword [ecx], esi
mov eax, dword [0x41ee9c]
mov edx, dword [0x41eec0]
add eax, 8
mov dword [0x41ee9c], eax
mov eax, dword [0x41ee6c]
add edx, 4
inc esi
cmp esi, eax
mov dword [0x41eec0], edx
jb 0x40ac2b
mov ecx, dword [0x41eef0]
mov edx, dword [0x41eec0]
test ecx, ecx
mov dword [0x41eebc], edx
je 0x40ac88
push str.Sorting_northing_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41eec4]
mov edx, dword [0x41eea0]
lea ecx, [eax + 4]
mov eax, dword [0x41eebc]
lea esi, [edx + 8]
cmp ecx, eax
mov dword [0x41eec0], ecx
mov dword [0x41ee9c], esi
jae 0x40ad55
fld qword [esi]
fcomp qword [esi - 8]
fnstsw ax
test ah, 1
jne 0x40ad1a
mov edi, dword [0x41eea0]
mov eax, esi
sub eax, edi
mov edi, 0x64
sar eax, 3
cdq
idiv edi
test edx, edx
jne 0x40acfd
mov eax, dword [0x41eeec]
test eax, eax
je 0x40acfd
mov eax, dword [eax + 0x20]
push edx
push edx
push 0x405
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [0x41eec0]
mov esi, dword [0x41ee9c]
mov eax, dword [0x41eebc]
add ecx, 4
add esi, 8
cmp ecx, eax
mov dword [0x41eec0], ecx
mov dword [0x41ee9c], esi
jb 0x40acb2
jmp 0x40ad55
mov ecx, dword [0x41ee98]
mov dword [0x41ee70], 0
mov dword [ecx], 0
mov edx, dword [0x41eebc]
mov esi, dword [0x41eec4]
mov eax, dword [0x41ee94]
mov ecx, dword [0x41ee70]
sub edx, esi
sar edx, 2
dec edx
mov dword [eax + ecx*4], edx
call fcn.0040b4b0
mov ecx, dword [0x41eef0]
test ecx, ecx
je 0x40ad69
push str.Writing_northing_index
call sub.MFC42.DLL_CWnd::SetWindowTextA
mov eax, dword [0x41eec4]
mov ecx, dword [0x41eebc]
cmp eax, ecx
mov dword [0x41eec0], eax
jae 0x40adab
mov ecx, dword [0x41eec4]
mov dx, word [eax]
sub eax, ecx
push edx
sar eax, 2
push eax
mov ecx, ebx
call fcn.00407090
mov eax, dword [0x41eec0]
mov ecx, dword [0x41eebc]
add eax, 4
cmp eax, ecx
mov dword [0x41eec0], eax
jb 0x40ad7d
call fcn.0040b860
call fcn.0040add0
call fcn.0040ade0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8