Function at 0x409120
Capabilities:
Check if file exists
Check os version
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x52c9e3
mov eax, dword fs:[0]
push eax
sub esp, 0xd0
push ebx
push ebp
push esi
push edi
mov eax, dword [0x56b1dc]
xor eax, esp
push eax
lea eax, [esp + 0xe4]
mov dword fs:[0], eax
lea ebx, [esp + 0x30]
call fcn.0045e390
mov dword [esp + 0xec], 0
mov edx, dword [esp + 0x30]
mov eax, dword [edx - 0xc]
test eax, eax
jle 0x409192
lea ecx, [eax - 1]
test ecx, ecx
jl 0x4093f0
cmp ecx, eax
jg 0x4093f0
movzx eax, word [edx + ecx*2]
cmp ax, 0x5c
je 0x409192
push 0x5c
mov edi, ebx
call fcn.004118c0
lea edi, [esp + 0x34]
call fcn.0045e680
mov byte [esp + 0xec], 1
mov edx, dword [esp + 0x34]
mov eax, dword [edx - 0xc]
test eax, eax
jle 0x4091d2
lea ecx, [eax - 1]
test ecx, ecx
jl 0x4093f0
cmp ecx, eax
jg 0x4093f0
movzx eax, word [edx + ecx*2]
cmp ax, 0x5c
je 0x4091d2
push 0x5c
call fcn.004118c0
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x1c]
push ecx
mov ebx, str.celldict.dat
call fcn.004036c0
add esp, 8
mov byte [esp + 0xec], 2
mov edx, dword [esp + 0x18]
mov esi, dword [0x5313c0]
push edx
call esi
test eax, eax
jne 0x40924d
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x30]
push ecx
call fcn.004036c0
add esp, 8
lea edi, [esp + 0x18]
mov byte [esp + 0xec], 3
call fcn.00401dd0
mov byte [esp + 0xec], 2
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40924d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor ebp, ebp
mov eax, 0xa
mov dword [esp + 0x58], ebp
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x60], ebp
mov dword [esp + 0x64], ebp
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], ebp
mov dword [esp + 0x70], ebp
mov dword [esp + 0x74], ebp
mov dword [esp + 0x78], ebp
mov dword [esp + 0x7c], ebp
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], ebp
mov dword [esp + 0xa0], ebp
mov dword [esp + 0xa4], ebp
mov dword [esp + 0xa8], ebp
mov dword [esp + 0xac], ebp
mov dword [esp + 0xb0], eax
mov dword [esp + 0xb4], ebp
mov dword [esp + 0x88], ebp
mov dword [esp + 0x8c], ebp
mov dword [esp + 0x90], ebp
mov dword [esp + 0x94], ebp
mov dword [esp + 0x98], eax
mov dword [esp + 0x9c], ebp
mov byte [esp + 0xec], 7
mov ecx, dword [esp + 0x18]
push ecx
call esi
test eax, eax
je 0x409a31
mov edx, dword [esp + 0x18]
mov esi, dword [0x53133c]
push edx
push ebp
push str.cellcount
push str.celldict
call esi
mov edi, eax
mov eax, dword [esp + 0x18]
push eax
push ebp
push str.maxranditem
push str.celldict
mov dword [esp + 0xe4], edi
call esi
mov ecx, dword [esp + 0x18]
push ecx
push ebp
push str.itemcount
push str.dialect
mov dword [esp + 0xe8], eax
call esi
mov edx, dword [0x5759e8]
mov dword [esp + 0xdc], eax
mov eax, dword [edx + 0xc]
mov ecx, 0x5759e8
call eax
add eax, 0x10
mov dword [esp + 0x2c], eax
xor eax, eax
cmp edi, ebp
mov byte [esp + 0xec], 8
mov dword [esp + 0x14], eax
jbe 0x40985a
push eax
push str.cell_u
lea edi, [esp + 0x34]
call fcn.00401f20
mov edx, dword [0x5759e8]
mov eax, dword [edx + 0xc]
add esp, 8
mov ecx, 0x5759e8
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x38], esi
mov byte [esp + 0xec], 9
mov eax, dword [esi - 8]
mov edi, dword [esp + 0x18]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x400
or eax, ecx
jge 0x4093d0
mov ecx, 0x400
lea eax, [esp + 0x38]
call fcn.00402120
mov esi, dword [esp + 0x38]
mov ecx, dword [esp + 0x2c]
push edi
push 0x400
push esi
push ebp
push ecx
push str.celldict
call dword [0x531350]
cmp esi, ebp
jne 0x4093fa
xor eax, eax
jmp 0x409411
push 0x80070057
call fcn.004026a0
mov eax, esi
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
cmp cx, bp
jne 0x409400
sub eax, edx
sar eax, 1
js 0x4093f0
cmp eax, dword [esi - 8]
jg 0x4093f0
mov dword [esi - 0xc], eax
mov word [esi + eax*2], bp
cmp dword [esi - 0xc], ebp
je 0x40981e
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], ebp
push 0x2c
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x40]
push edx
mov byte [esp + 0xf8], 0xa
call fcn.00466500
mov ebx, dword [esp + 0x2c]
add esp, 0xc
cmp ebx, 7
jb 0x409802
cmp ebx, ebp
jbe 0x4093f0
mov edi, dword [esp + 0x1c]
mov eax, dword [edi]
cmp dword [eax - 0xc], ebp
je 0x409806
cmp ebx, 1
jbe 0x4093f0
mov ecx, dword [edi + 4]
cmp dword [ecx - 0xc], ebp
je 0x409806
cmp ebx, 2
jbe 0x4093f0
mov edx, dword [edi + 8]
cmp dword [edx - 0xc], ebp
je 0x409806
cmp ebx, 5
jbe 0x4093f0
mov eax, dword [edi + 0x14]
cmp dword [eax - 0xc], ebp
je 0x409806
cmp ebx, 6
jbe 0x4093f0
mov ecx, dword [edi + 0x18]
cmp dword [ecx - 0xc], ebp
je 0x409806
cmp ebx, 3
jbe 0x4093f0
mov edx, dword [edi + 0xc]
cmp dword [edx - 0xc], ebp
lea eax, [edi + 0xc]
jne 0x4094ef
cmp ebx, 4
jbe 0x4093f0
mov ecx, dword [edi + 0x10]
cmp dword [ecx - 0xc], ebp
je 0x409806
push eax
mov ecx, str._none_
call fcn.0040d440
add esp, 4
test al, al
je 0x409529
cmp dword [esp + 0x20], 4
jbe 0x4093f0
mov eax, dword [esp + 0x1c]
add eax, 0x10
push eax
mov ecx, str._none_
call fcn.0040d440
add esp, 4
test al, al
jne 0x4097fe
cmp dword [esp + 0x20], 5
jbe 0x4093f0
mov esi, dword [esp + 0x1c]
mov edx, dword [esi + 0x14]
mov ecx, dword [edx - 0xc]
add esi, 0x14
push 0xa
push 0
call fcn.00401ff0
push eax
call fcn.0050095a
add esp, 0xc
cmp dword [esp + 0x20], 5
mov ebp, eax
jbe 0x4093f0
mov esi, dword [esp + 0x1c]
add esi, 0x14
or eax, 0xffffffff
call fcn.00411620
mov edi, 6
cmp dword [esp + 0x20], edi
jbe 0x4093f0
mov esi, dword [esp + 0x1c]
mov eax, dword [esi + 0x18]
mov ecx, dword [eax - 0xc]
add esi, 0x18
push 0xa
push 0
call fcn.00401ff0
push eax
call fcn.0050095a
add esp, 0xc
cmp dword [esp + 0x20], edi
mov ebx, eax
jbe 0x4093f0
mov esi, dword [esp + 0x1c]
add esi, 0x18
or eax, 0xffffffff
call fcn.00411620
lea edi, [esp + 0x3c]
call fcn.004054a0
lea edi, [esp + 0xb8]
call fcn.004054a0
mov byte [esp + 0xec], 0xc
cmp dword [esp + 0x20], 0
jbe 0x4093f0
mov eax, dword [esp + 0x1c]
lea edi, [esp + 0x44]
call fcn.00401dd0
cmp dword [esp + 0x20], 1
jbe 0x4093f0
mov eax, dword [esp + 0x1c]
add eax, 4
lea edi, [esp + 0x48]
call fcn.00401dd0
cmp dword [esp + 0x20], 2
jbe 0x4093f0
mov eax, dword [esp + 0x1c]
add eax, 8
lea edi, [esp + 0x40]
call fcn.00401dd0
mov edx, dword [esp + 0xdc]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0xb8]
add ecx, edx
push eax
lea eax, [esp + 0x40]
mov dword [esp + 0x50], ebp
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], ecx
call fcn.00409b80
cmp dword [esp + 0x20], 3
jbe 0x4093f0
mov eax, dword [esp + 0x1c]
add eax, 0xc
lea edi, [esp + 0x3c]
call fcn.00401dd0
cmp dword [esp + 0x20], 4
jbe 0x4093f0
mov eax, dword [esp + 0x1c]
add eax, 0x10
lea edi, [esp + 0xb8]
call fcn.00401dd0
lea eax, [esp + 0x3c]
call fcn.00405580
test al, al
je 0x4096ad
lea eax, [esp + 0x3c]
call fcn.004057f0
test al, al
je 0x4096ad
lea esi, [esp + 0x3c]
lea eax, [esp + 0x58]
jmp 0x4097c2
lea eax, [esp + 0xb8]
call fcn.00405580
test al, al
je 0x4096d6
lea eax, [esp + 0xb8]
call fcn.004057f0
test al, al
je 0x4096d6
lea eax, [esp + 0x58]
jmp 0x4097bb
lea eax, [esp + 0x3c]
call fcn.00405580
test al, al
je 0x4096f0
lea esi, [esp + 0x3c]
lea eax, [esp + 0x58]
jmp 0x4097c2
lea eax, [esp + 0xb8]
call fcn.00405580
test al, al
je 0x409709
lea eax, [esp + 0x58]
jmp 0x4097bb
lea eax, [esp + 0x3c]
call fcn.00405520
test al, al
je 0x409730
lea eax, [esp + 0x3c]
call fcn.004057f0
test al, al
je 0x409730
lea esi, [esp + 0x3c]
lea eax, [esp + 0x70]
jmp 0x4097c2
lea eax, [esp + 0xb8]
call fcn.00405520
test al, al
je 0x409756
lea eax, [esp + 0xb8]
call fcn.004057f0
test al, al
je 0x409756
lea eax, [esp + 0x70]
jmp 0x4097bb
lea eax, [esp + 0x3c]
call fcn.00405520
test al, al
je 0x40976d
lea esi, [esp + 0x3c]
lea eax, [esp + 0x70]
jmp 0x4097c2
lea eax, [esp + 0xb8]
call fcn.00405520
test al, al
je 0x409783
lea eax, [esp + 0x70]
jmp 0x4097bb
lea eax, [esp + 0x3c]
call fcn.004054d0
test al, al
jne 0x4097a4
mov edi, dword [esp + 0x14]
lea esi, [esp + 0x3c]
lea eax, [esp + 0xa0]
call fcn.0040e470
lea eax, [esp + 0xb8]
call fcn.004054d0
test al, al
jne 0x4097cb
lea eax, [esp + 0x88]
lea esi, [esp + 0xb8]
mov edi, dword [esp + 0x14]
call fcn.0040e470
lea edi, [esp + 0xb8]
call fcn.00409b50
lea edi, [esp + 0x3c]
call fcn.00409b50
lea esi, [esp + 0x1c]
call fcn.00401f00
lea ecx, [esp + 0x38]
mov byte [esp + 0xec], 8
call fcn.00402660
xor ebp, ebp
jmp 0x409842
mov ebx, dword [esp + 0x20]
mov edi, dword [esp + 0x1c]
cmp edi, ebp
je 0x40981e
call fcn.00401fc0
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.004ff948
add esp, 4
xor ebp, ebp
lea eax, [esi - 0x10]
or ecx, 0xffffffff
lea edx, [eax + 0xc]
mov byte [esp + 0xec], 8
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x409842
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x14]
add eax, 1
cmp eax, dword [esp + 0xd4]
mov dword [esp + 0x14], eax
jb 0x409375
cmp dword [esp + 0x5c], ebp
jne 0x4099a9
cmp dword [esp + 0x74], ebp
jne 0x4099a9
cmp dword [esp + 0xa4], ebp
jne 0x4099a9
cmp dword [esp + 0x8c], ebp
jne 0x4099a9
mov byte [esp + 0xec], 7
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 0x4098b0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esp + 0x88]
call fcn.004103b0
mov eax, dword [esp + 0x9c]
cmp eax, ebp
je 0x4098d0
push eax
call fcn.004ff948
add esp, 4
lea eax, [esp + 0xa0]
call fcn.004103b0
mov eax, dword [esp + 0xb4]
cmp eax, ebp
je 0x4098f0
push eax
call fcn.004ff948
add esp, 4
lea eax, [esp + 0x70]
call fcn.004103b0
mov eax, dword [esp + 0x84]
cmp eax, ebp
je 0x40990d
push eax
call fcn.004ff948
add esp, 4
lea eax, [esp + 0x58]
call fcn.004103b0
mov eax, dword [esp + 0x6c]
cmp eax, ebp
je 0x409927
push eax
call fcn.004ff948
add esp, 4
mov byte [esp + 0xec], 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 0x40994f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xec], 0
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x409977
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0xec], 0xffffffff
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4099a2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x409b28
mov esi, dword [esp + 0xf4]
push ebp
lea edx, [esp + 0xa4]
mov ecx, esi
call fcn.0040a9d0
push 1
lea edx, [esp + 0xa4]
mov ecx, esi
call fcn.0040a9d0
push esi
xor ecx, ecx
lea ebx, [esp + 0x8c]
call fcn.0040af00
push esi
mov ecx, 1
call fcn.0040af00
lea ecx, [esp + 0x58]
push ecx
push esi
call fcn.00409be0
mov edx, dword [esp + 0xd8]
push edx
lea eax, [esp + 0x74]
push eax
push esi
call fcn.0040a110
mov byte [esp + 0xec], 7
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 0x409a2f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor ebp, ebp
lea eax, [esp + 0x88]
call fcn.004103b0
mov eax, dword [esp + 0x9c]
cmp eax, ebp
je 0x409a51
push eax
call fcn.004ff948
add esp, 4
lea eax, [esp + 0xa0]
call fcn.004103b0
mov eax, dword [esp + 0xb4]
cmp eax, ebp
je 0x409a71
push eax
call fcn.004ff948
add esp, 4
lea eax, [esp + 0x70]
call fcn.004103b0
mov eax, dword [esp + 0x84]
cmp eax, ebp
je 0x409a8e
push eax
call fcn.004ff948
add esp, 4
lea eax, [esp + 0x58]
call fcn.004103b0
mov eax, dword [esp + 0x6c]
cmp eax, ebp
je 0x409aa8
push eax
call fcn.004ff948
add esp, 4
mov byte [esp + 0xec], 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 0x409ad0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xec], 0
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x409af8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0xec], 0xffffffff
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x409b23
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0xe4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xdc
ret 4