Function at 0x4181b0
Capabilities:
Check if file exists
Get geographical location
Read .ini file
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x5fe901
mov eax, dword fs:[0]
push eax
sub esp, 0x280
mov eax, dword [0x6687b8]
xor eax, esp
mov dword [esp + 0x278], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6687b8]
xor eax, esp
push eax
lea eax, [esp + 0x294]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x2a4]
lea ebx, [esp + 0x24]
mov dword [esp + 0x40], ebp
call fcn.0047a980
mov dword [esp + 0x29c], 0
mov edx, dword [esp + 0x24]
mov eax, dword [edx - 0xc]
test eax, eax
jle 0x41823b
lea ecx, [eax - 1]
test ecx, ecx
jl 0x418496
cmp ecx, eax
jg 0x418496
movzx eax, word [edx + ecx*2]
cmp ax, 0x5c
je 0x41823b
push 0x5c
mov edi, ebx
call fcn.0040af90
lea edi, [esp + 0x20]
call fcn.0047ac70
mov byte [esp + 0x29c], 1
mov edx, dword [esp + 0x20]
mov eax, dword [edx - 0xc]
test eax, eax
jle 0x41827b
lea ecx, [eax - 1]
test ecx, ecx
jl 0x418496
cmp ecx, eax
jg 0x418496
movzx eax, word [edx + ecx*2]
cmp ax, 0x5c
je 0x41827b
push 0x5c
call fcn.0040af90
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x1c]
push ecx
mov ebx, str.celldict.dat
call fcn.0040aab0
add esp, 8
mov byte [esp + 0x29c], 2
mov edx, dword [esp + 0x18]
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push edx
call esi
test eax, eax
jne 0x4182f6
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.0040aab0
add esp, 8
lea edi, [esp + 0x18]
mov byte [esp + 0x29c], 3
call fcn.0040ab90
mov byte [esp + 0x29c], 2
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4182f6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x18]
push ecx
call esi
test eax, eax
je 0x418896
mov eax, ebp
call fcn.004190d0
mov edx, dword [esp + 0x18]
xor eax, eax
push edx
push 0x14
mov dword [esp + 0x5e], eax
mov dword [esp + 0x62], eax
mov dword [esp + 0x66], eax
mov dword [esp + 0x6a], eax
mov dword [esp + 0x6e], eax
mov dword [esp + 0x72], eax
mov dword [esp + 0x76], eax
mov dword [esp + 0x7a], eax
mov dword [esp + 0x7e], eax
mov word [esp + 0x82], ax
lea eax, [esp + 0x5c]
push eax
xor edi, edi
push edi
push str.provincecounts
push str.setting
mov word [esp + 0x6c], di
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
push 0xa
lea ecx, [esp + 0x58]
push edi
push ecx
call fcn.005d419b
add esp, 0xc
push 0x208
lea edx, [esp + 0x82]
mov esi, eax
push edi
push edx
mov dword [esp + 0x5c], esi
mov word [esp + 0x88], di
call fcn.005da970
mov eax, dword [0x677600]
mov edx, dword [eax + 0xc]
add esp, 0xc
mov ecx, 0x677600
call edx
add eax, 0x10
mov dword [esp + 0x2c], eax
cmp esi, edi
mov byte [esp + 0x29c], 4
mov dword [esp + 0x3c], edi
jbe 0x41886e
mov eax, dword [esp + 0x3c]
push eax
push str.province_u
lea edi, [esp + 0x34]
call fcn.0040ac80
mov edx, dword [0x677600]
mov eax, dword [edx + 0xc]
add esp, 8
mov ecx, 0x677600
call eax
add eax, 0x10
mov dword [esp + 0x1c], eax
mov byte [esp + 0x29c], 5
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x2c]
xor eax, eax
push ecx
push 0x14
lea edx, [esp + 0x5c]
push edx
push eax
push str.province
push esi
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], eax
mov dword [esp + 0x88], eax
mov dword [esp + 0x8c], eax
mov dword [esp + 0x90], eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0x54]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x418450
sub eax, edx
sar eax, 1
lea ecx, [esp + 0x54]
mov ebx, eax
push ecx
lea eax, [esp + 0x20]
call fcn.004037a0
mov ebp, dword [esp + 0x1c]
cmp dword [ebp - 0xc], 0
jne 0x4184a0
lea eax, [ebp - 0x10]
mov byte [esp + 0x29c], 4
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x41884d
push 0x80070057
call fcn.00403650
mov ecx, dword [esp + 0x18]
xor eax, eax
push ecx
push 0x14
lea edx, [esp + 0x5c]
push edx
push eax
push str.citycounts
push esi
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], eax
mov dword [esp + 0x88], eax
mov dword [esp + 0x8c], eax
mov dword [esp + 0x90], eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
push 0xa
lea eax, [esp + 0x58]
push 0
push eax
call fcn.005d419b
mov edx, dword [0x677600]
mov edi, eax
mov eax, dword [edx + 0xc]
add esp, 0xc
mov ecx, 0x677600
mov dword [esp + 0x4c], edi
call eax
add eax, 0x10
mov dword [esp + 0x38], eax
mov byte [esp + 0x29c], 6
mov edx, dword [0x677600]
mov eax, dword [edx + 0xc]
mov ecx, 0x677600
call eax
add eax, 0x10
mov dword [esp + 0x34], eax
xor eax, eax
test edi, edi
mov byte [esp + 0x29c], 7
mov dword [esp + 0x30], eax
jbe 0x4187e5
jmp 0x418564
mov esi, dword [esp + 0x2c]
push eax
push str.city_u
lea edi, [esp + 0x40]
call fcn.0040ac80
push 0x20a
lea ecx, [esp + 0x88]
push 0
push ecx
call fcn.005da970
mov edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x4c]
add esp, 0x14
push edx
push 0x105
lea eax, [esp + 0x84]
push eax
push 0
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0x7c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4185b1
sub eax, edx
sar eax, 1
lea edx, [esp + 0x7c]
mov ebx, eax
push edx
lea eax, [esp + 0x38]
call fcn.004037a0
mov eax, dword [esp + 0x34]
cmp dword [eax - 0xc], 0
je 0x4187d0
push 0x18
call fcn.005d2776
add esp, 4
test eax, eax
je 0x4187d0
mov esi, eax
call fcn.00418940
mov esi, eax
test esi, esi
mov dword [esp + 0x44], esi
je 0x4187d0
push esi
lea ecx, [esp + 0x38]
push ecx
call fcn.00418b50
test eax, eax
je 0x4187c2
mov esi, dword [esp + 0x40]
mov eax, dword [esi + 0x28]
mov edi, dword [eax]
add esi, 0x24
mov dword [esp + 0x28], 0
lea esp, [esp]
cmp esi, esi
mov ebx, dword [esi + 4]
je 0x41863c
call fcn.005d29f1
cmp edi, ebx
je 0x4186b4
cmp edi, dword [esi + 4]
jne 0x41864a
call fcn.005d29f1
mov edx, dword [edi + 8]
mov eax, dword [edx]
push ebp
push eax
call fcn.005d2da6
add esp, 8
test eax, eax
jne 0x41869c
cmp edi, dword [esi + 4]
mov dword [esp + 0x28], 1
jne 0x41866f
call fcn.005d29f1
mov esi, dword [edi + 8]
mov ebx, dword [esi + 8]
mov ecx, dword [ebx + 4]
add esi, 4
lea eax, [esp + 0x44]
push eax
push ecx
push ebx
call fcn.0041a450
mov ecx, esi
mov ebp, eax
call fcn.0041a490
mov dword [ebx + 4], ebp
mov edx, dword [ebp + 4]
mov dword [edx], ebp
mov ebp, dword [esp + 0x1c]
mov esi, dword [esp + 0x40]
add esi, 0x24
cmp edi, dword [esi + 4]
jne 0x4186ad
call fcn.005d29f1
mov edi, dword [edi]
jmp 0x418630
cmp dword [esp + 0x28], 0
jne 0x4187d0
push 0x10
call fcn.005d2776
mov edi, eax
add esp, 4
mov dword [esp + 0x48], edi
test edi, edi
mov byte [esp + 0x29c], 8
je 0x418708
mov eax, dword [0x677600]
mov edx, dword [eax + 0xc]
mov ecx, 0x677600
call edx
add eax, 0x10
mov dword [edi], eax
mov byte [esp + 0x29c], 9
call fcn.0041a430
mov dword [edi + 8], eax
mov dword [edi + 0xc], 0
jmp 0x41870a
xor edi, edi
test edi, edi
mov byte [esp + 0x29c], 7
mov dword [esp + 0x48], edi
je 0x4187d0
mov ebx, dword [edi]
lea eax, [ebp - 0x10]
sub ebx, 0x10
cmp eax, ebx
je 0x418773
cmp dword [ebx + 0xc], 0
lea ebp, [ebx + 0xc]
jl 0x418764
mov ecx, dword [eax]
cmp ecx, dword [ebx]
jne 0x418764
call fcn.0040a210
mov dword [esp + 0x28], eax
or edx, 0xffffffff
lock xadd dword [ebp], edx
dec edx
test edx, edx
jg 0x418759
mov ecx, dword [ebx]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebx
call edx
mov eax, dword [esp + 0x28]
add eax, 0x10
mov dword [edi], eax
jmp 0x418773
mov eax, dword [esp + 0x1c]
mov ebx, dword [eax - 0xc]
push eax
mov eax, edi
call fcn.004037a0
lea ebp, [edi + 4]
mov edi, dword [ebp + 4]
mov edx, dword [edi + 4]
lea ecx, [esp + 0x44]
push ecx
push edx
push edi
call fcn.0041a450
mov ecx, ebp
mov ebx, eax
call fcn.0041a490
mov dword [edi + 4], ebx
mov eax, dword [ebx + 4]
mov dword [eax], ebx
mov edi, dword [esi + 4]
mov ecx, dword [edi + 4]
lea eax, [esp + 0x48]
push eax
push ecx
push edi
call fcn.0041a450
mov ecx, esi
mov ebx, eax
call fcn.0041a490
mov ebp, dword [esp + 0x1c]
mov dword [edi + 4], ebx
mov eax, dword [ebx + 4]
mov dword [eax], ebx
jmp 0x4187d0
call fcn.004189b0
push esi
call fcn.005d2367
add esp, 4
mov eax, dword [esp + 0x30]
add eax, 1
cmp eax, dword [esp + 0x4c]
mov dword [esp + 0x30], eax
jb 0x418560
mov byte [esp + 0x29c], 6
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x41880d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x29c], 5
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x418835
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov byte [esp + 0x29c], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x418859
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x3c]
add eax, 1
cmp eax, dword [esp + 0x50]
mov dword [esp + 0x3c], eax
jb 0x4183bc
mov byte [esp + 0x29c], 2
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x418896
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x29c], 1
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4188be
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x29c], 0
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4188e6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x29c], 0xffffffff
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x418911
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x294]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x278]
xor ecx, esp
call fcn.005d28b3
add esp, 0x28c
ret 4