Function at 0x40c9c0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x230
mov edx, dword [esp + 0x240]
push ebx
mov ebx, dword [esp + 0x240]
push ebp
xor eax, eax
push esi
or ecx, 0xffffffff
push edi
mov edi, ebx
repne scasb al, byte es:[edi]
mov dword [esp + 0x14], eax
mov word [esp + 0x18], ax
not ecx
mov byte [esp + 0x1a], al
mov al, byte [edx]
dec ecx
test al, al
mov dword [esp + 0x1c], ecx
jne 0x40ca17
xor eax, eax
mov ecx, 0x20
mov edi, edx
rep stosd dword es:[edi], eax
mov ecx, 7
lea edi, [esp + 0x3c]
mov dword [esp + 0x38], ebx
rep stosd dword es:[edi], eax
jmp 0x40ca55
mov byte [esp + 0x13], 0
xor esi, esi
lea edi, [esp + 0x38]
mov al, byte [esi + edx]
test al, al
mov byte [esp + 0x12], al
je 0x40ca46
lea ecx, [esp + 0x12]
push ecx
push ebx
call fcn.0040e950
mov edx, dword [esp + 0x258]
add esp, 8
mov dword [edi], eax
jmp 0x40ca4c
mov dword [edi], 0
inc esi
add edi, 4
cmp esi, 7
jle 0x40ca22
mov edx, dword [esp + 0x258]
lea eax, [edx - 1]
cmp eax, 1
jl 0x40ca99
mov ecx, dword [esp + 0x1c]
lea esi, [ecx + ebx - 1]
mov ebp, eax
inc dword [esp + 0x38]
lea eax, [esp + 0x3c]
mov edx, 7
cmp dword [eax - 4], esi
jbe 0x40ca90
mov dword [eax - 4], ebx
mov ecx, dword [eax]
test ecx, ecx
je 0x40ca8e
inc ecx
mov dword [eax], ecx
jmp 0x40ca90
mov dword [eax], ebx
add eax, 4
dec edx
jne 0x40ca7b
dec ebp
jne 0x40ca6e
mov edi, dword [esp + 0x244]
cmp dword [edi], 0
mov eax, dword [esp + 0x54]
je 0x40cd4d
test eax, eax
jne 0x40d08b
mov edx, dword [esp + 0x254]
cmp dword [edx], 0
jne 0x40d08b
xor eax, eax
lea edx, [esp + 0x38]
mov ecx, dword [edx]
test ecx, ecx
je 0x40cae6
mov cl, byte [ecx]
mov esi, dword [esp + 0x250]
mov byte [eax + esi], cl
inc eax
add edx, 4
cmp eax, 7
jle 0x40cacb
mov esi, dword [esp + 0x250]
lea edx, [esp + 0x80]
push edx
push esi
call fcn.0040aa30
add esp, 8
lea eax, [esp + 0xc0]
push eax
lea ecx, [esp + 0x84]
push ecx
call fcn.0040a060
add esp, 8
push 1
lea edx, [esp + 0xc4]
push edx
lea eax, [esp + 0x28]
push eax
push str.KGS____
call fcn.00401660
mov eax, dword [0x44e690]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
add esp, 0x10
push 0x40c870
push 8
push eax
mov dword [esp + 0x20], ecx
lea ecx, [esp + 0x20]
push 0x450b60
push ecx
mov dword [esp + 0x2c], edx
call fcn.0040fdf0
add esp, 0x14
test eax, eax
je 0x40ccf5
mov edx, dword [esi]
sub eax, 0x450b60
sar eax, 3
test edi, edi
mov dword [eax*8 + 0x4d0b80], edx
mov ecx, dword [esi + 4]
mov dword [eax*8 + 0x4d0b84], ecx
mov esi, edi
je 0x40ccf5
mov eax, dword [esi + 0x237]
xor ebp, ebp
test eax, eax
jne 0x40cce7
mov eax, dword [esi + 0x23b]
test eax, eax
jne 0x40cc15
mov edx, dword [0x44e690]
push 0x40c870
push 8
push edx
lea eax, [esi + 0xc8]
push 0x450b60
push eax
call fcn.0040fdf0
add esp, 0x14
test eax, eax
je 0x40cc15
sub eax, 0x450b60
sar eax, 3
mov cl, byte [eax*8 + 0x4d0b80]
test cl, cl
lea eax, [eax*8 + 0x4d0b80]
je 0x40cc15
push 7
push eax
lea ecx, [esi + 0x229]
push ecx
call fcn.0040dcf0
mov eax, dword [esi + 0x225]
add esp, 0xc
test eax, eax
mov ebp, 1
mov dword [esi + 0x23b], ebp
je 0x40cc15
mov dword [esi + 0x243], ebp
mov eax, dword [esi + 0x243]
test eax, eax
jne 0x40cc86
mov eax, dword [esi + 0x225]
test eax, eax
jne 0x40cc86
mov edx, dword [0x44e690]
push 0x40c870
push 8
push edx
lea eax, [esi + 0xd0]
push 0x450b60
push eax
call fcn.0040fdf0
add esp, 0x14
test eax, eax
je 0x40cc86
sub eax, 0x450b60
sar eax, 3
mov cl, byte [eax*8 + 0x4d0b80]
test cl, cl
lea eax, [eax*8 + 0x4d0b80]
je 0x40cc86
push 7
push eax
lea ecx, [esi + 0x230]
push ecx
call fcn.0040dcf0
mov ebp, 1
add esp, 0xc
mov dword [esi + 0x243], ebp
cmp ebp, 1
jne 0x40cce7
mov eax, dword [esi + 0x243]
test eax, eax
je 0x40cce7
mov eax, dword [esi + 0x23b]
test eax, eax
je 0x40cce7
push 7
lea edx, [esi + 0x229]
push edx
lea edi, [esi + 0xec]
push edi
call fcn.0040dcf0
add esp, 0xc
push 7
lea eax, [esi + 0x230]
push eax
lea ecx, [esi + 0xf3]
push ecx
call fcn.0040fcc0
add esp, 0xc
push ebp
push edi
push esi
call fcn.0040bc40
mov edi, dword [esp + 0x250]
add esp, 0xc
mov dword [esi + 0x237], ebp
mov esi, dword [esi + 0x257]
test esi, esi
jne 0x40cb8e
mov ebp, dword [esp + 0x25c]
cmp ebp, 1
jl 0x40cd34
mov edx, dword [esp + 0x1c]
lea esi, [edx + ebx - 1]
inc dword [esp + 0x38]
lea eax, [esp + 0x3c]
mov edx, 7
cmp dword [eax - 4], esi
jbe 0x40cd2b
mov dword [eax - 4], ebx
mov ecx, dword [eax]
test ecx, ecx
je 0x40cd29
inc ecx
mov dword [eax], ecx
jmp 0x40cd2b
mov dword [eax], ebx
add eax, 4
dec edx
jne 0x40cd16
dec ebp
jne 0x40cd09
mov eax, dword [esp + 0x54]
test eax, eax
je 0x40cab5
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x230
ret
test eax, eax
jne 0x40d08b
mov eax, dword [esp + 0x254]
cmp dword [eax], 0
jne 0x40d08b
xor eax, eax
lea edx, [esp + 0x38]
mov ecx, dword [edx]
test ecx, ecx
je 0x40cd86
mov cl, byte [ecx]
mov esi, dword [esp + 0x250]
mov byte [eax + esi], cl
inc eax
add edx, 4
cmp eax, 7
jle 0x40cd6b
cmp dword [edi], 0
je 0x40ce2d
mov esi, dword [esp + 0x250]
lea edx, [esp + 0x80]
push edx
push esi
call fcn.0040aa30
add esp, 8
lea eax, [esp + 0xc0]
push eax
lea ecx, [esp + 0x84]
push ecx
call fcn.0040a060
add esp, 8
push 1
lea edx, [esp + 0xc4]
push edx
lea eax, [esp + 0x28]
push eax
push str.KGS____
call fcn.00401660
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
add esp, 0x10
push 7
push esi
lea eax, [esp + 0x1c]
push eax
push edi
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], edx
call fcn.0040d0a0
add esp, 0x10
cmp eax, 1
jne 0x40d032
push edi
call fcn.004038c0
add esp, 4
push edi
call fcn.00403900
add esp, 4
test eax, eax
mov dword [esp + 0x244], eax
je 0x40d07b
mov edi, eax
jmp 0x40d032
xor ebp, ebp
test edi, edi
mov ebx, edi
je 0x40d007
xor ecx, ecx
mov dword [esp + 0x58], ecx
mov dword [esp + 0x5c], ecx
xor edx, edx
mov dword [esp + 0x60], ecx
mov dword [esp + 0x70], edx
mov dword [esp + 0x64], ecx
xor eax, eax
mov dword [esp + 0x68], ecx
mov dword [esp + 0x74], edx
mov dword [esp + 0x78], edx
mov dword [esp + 0x88], eax
mov byte [esp + 0x6c], cl
mov ecx, dword [esp + 0x250]
push 0xe
mov word [esp + 0x80], dx
mov dword [esp + 0x90], eax
push ecx
lea edx, [esp + 0x78]
mov dword [esp + 0x98], eax
push edx
mov dword [esp + 0xa0], eax
call fcn.0040dcf0
add esp, 0xc
lea eax, [esp + 0xa0]
push eax
lea ecx, [esp + 0x74]
push ecx
call fcn.0040aa30
add esp, 8
lea edx, [esp + 0x140]
push edx
lea eax, [esp + 0xa4]
push eax
call fcn.0040a060
add esp, 8
push 1
lea ecx, [esp + 0x144]
push ecx
lea edx, [esp + 0x90]
push edx
push str.KGS____
call fcn.00401660
add esp, 0x10
lea eax, [esp + 0x98]
push eax
lea ecx, [esp + 0x7b]
push ecx
call fcn.0040aa30
add esp, 8
lea edx, [esp + 0x1c0]
push edx
lea eax, [esp + 0x9c]
push eax
call fcn.0040a060
add esp, 8
push 1
lea ecx, [esp + 0x1c4]
push ecx
lea edx, [esp + 0x98]
push edx
push str.KGS____
call fcn.00401660
add esp, 0x10
push 0x10
lea eax, [esp + 0x8c]
push eax
lea ecx, [esp + 0x30]
push ecx
call fcn.0040dcf0
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x64], edx
mov edx, dword [esp + 0x40]
mov dword [esp + 0x68], eax
add esp, 0xc
lea eax, [esp + 0xa8]
mov dword [esp + 0x60], ecx
mov dword [esp + 0x64], edx
push eax
lea ecx, [ebx + 0x17a]
push ecx
lea edx, [esp + 0x60]
push edx
call fcn.00401000
add esp, 0xc
mov ecx, 0x18
lea edi, [esp + 0xa8]
lea esi, [ebx + 0x193]
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x40cff2
mov edx, dword [esp + 0x250]
mov eax, dword [edx]
lea ecx, [ebx + 0xec]
mov dword [ecx], eax
mov eax, dword [edx + 4]
mov dword [ecx + 4], eax
mov eax, dword [edx + 8]
mov dword [ecx + 8], eax
mov dx, word [edx + 0xc]
mov word [ecx + 0xc], dx
mov ecx, dword [esp + 0x28]
lea eax, [ebx + 0xc8]
mov dword [eax], ecx
mov edx, dword [esp + 0x2c]
mov dword [eax + 4], edx
mov ecx, dword [esp + 0x30]
mov dword [eax + 8], ecx
mov edx, dword [esp + 0x34]
mov ebp, 1
mov dword [eax + 0xc], edx
mov dword [ebx + 0x237], ebp
mov ebx, dword [ebx + 0x257]
test ebx, ebx
jne 0x40ce39
mov edi, dword [esp + 0x244]
cmp ebp, 1
jne 0x40d02b
push edi
call fcn.004038c0
add esp, 4
push edi
call fcn.00403900
add esp, 4
test eax, eax
mov dword [esp + 0x244], eax
je 0x40d07b
mov edi, eax
mov ebx, dword [esp + 0x24c]
inc dword [esp + 0x38]
mov eax, dword [esp + 0x1c]
lea esi, [eax + ebx - 1]
lea eax, [esp + 0x3c]
mov edx, 7
cmp dword [eax - 4], esi
jbe 0x40d05c
mov dword [eax - 4], ebx
mov ecx, dword [eax]
test ecx, ecx
je 0x40d05a
inc ecx
mov dword [eax], ecx
jmp 0x40d05c
mov dword [eax], ebx
add eax, 4
dec edx
jne 0x40d047
mov eax, dword [esp + 0x54]
test eax, eax
je 0x40cd55
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x230
ret
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x230
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x230
ret