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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x778
mov eax, dword [0x50c070]
xor eax, esp
mov dword [esp + 0x774], eax
mov eax, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 8]
push edi
push 0x400
mov dword [esp + 0x20], eax
lea eax, [esp + 0x37c]
push 0
push eax
mov dword [esp + 0x20], esi
call fcn.0048e190
add esp, 0xc
lea eax, [esp + 0x378]
push 0x400
push eax
push esi
call dword [0x4e515c]
lea eax, [esp + 0x378]
push 0x400
push eax
call fcn.00498b9f
add esp, 8
cmp eax, 0x104
jl 0x40de03
push 0x40010
push 0x4f65d0
push 0x4f65e8
push 0
call dword [0x4e5294]
mov eax, 1
pop edi
pop esi
mov ecx, dword [esp + 0x774]
xor ecx, esp
call fcn.0048b5cc
mov esp, ebp
pop ebp
ret 0x10
mov edi, dword [0x4e5274]
lea eax, [esp + 0x378]
push eax
call edi
mov cl, byte [esp + 0x378]
lea edx, [esp + 0x378]
test cl, cl
je 0x40de54
cmp cl, 0x80
jb 0x40de2f
cmp cl, 0x9f
jbe 0x40de36
lea eax, [ecx + 0x20]
cmp al, 0xf
ja 0x40de3d
mov eax, 2
jmp 0x40de4b
cmp cl, 0x3f
je 0x40df13
mov eax, 1
mov cl, byte [edx + eax]
add edx, eax
test cl, cl
jne 0x40de25
push 0x104
lea eax, [esp + 0x37c]
push eax
push esi
call dword [0x4e515c]
lea eax, [esp + 0x378]
push eax
call edi
lea ecx, [esp + 0x378]
dec ecx
nop word [eax + eax]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x40de80
mov eax, dword [str.chsPAL.dll]
mov dword [ecx], eax
mov eax, dword [0x4f65a4]
mov dword [ecx + 4], eax
mov eax, dword [0x4f65a8]
mov dword [ecx + 8], eax
mov al, byte [0x4f65ac]
push 8
mov byte [ecx + 0xc], al
lea eax, [esp + 0x37c]
push 0
push eax
call dword [0x4e5158]
test eax, eax
je 0x40dde8
mov ecx, esi
call fcn.0040d260
test eax, eax
je 0x40dde8
cmp byte [0x510121], 0
mov edi, dword [0x4e517c]
jne 0x40df52
push 0x510350
push 1
push 0
push 0
call dword [0x4e5034]
mov dword [0x510130], eax
call dword [0x4e50cc]
cmp eax, 0xb7
jne 0x40df48
push dword [0x510130]
call edi
mov eax, 1
jmp 0x40df4a
lea eax, [esp + 0x378]
push eax
lea eax, [esp + 0x174]
push 0x4f6658
push eax
call dword [0x4e5298]
add esp, 0xc
lea eax, [esp + 0x170]
push 0x40010
push 0x4f65d0
push eax
jmp 0x40dde0
xor eax, eax
test eax, eax
jne 0x40dde8
lea eax, [esp + 0x28]
push eax
call dword [sym.imp.PAL.dll_PalDefaultCreate]
add esp, 4
mov dword [esp + 0x28], esi
cmp byte [0x510120], 0
mov dword [esp + 0x74], 0x40cf40
je 0x40df7f
mov eax, 1
jmp 0x40e162
push str.system.dat
push 0x510558
xorps xmm0, xmm0
mov dword [esp + 0x150], 0
lea eax, [esp + 0x380]
movaps xmmword [esp + 0x138], xmm0
push str._s_s
push eax
movq qword [esp + 0x150], xmm0
call dword [0x4e5298]
add esp, 0x10
lea eax, [esp + 0x170]
push eax
lea eax, [esp + 0x37c]
push eax
call dword [0x4e5040]
cmp eax, 0xffffffff
je 0x40dff7
mov esi, dword [esp + 0x170]
push eax
call dword [0x4e5050]
and esi, 0x10
jne 0x40dff3
xor eax, eax
jmp 0x40e162
mov esi, dword [esp + 0x14]
xorps xmm0, xmm0
mov dword [esp + 0xa8], esi
push 0x7f00
push 0
movlpd qword [esp + 0xa8], xmm0
movlpd qword [esp + 0xb4], xmm0
movlpd qword [esp + 0xbc], xmm0
mov dword [esp + 0xc4], 0x510350
mov dword [esp + 0xa4], 0x468850
mov dword [esp + 0xa0], 3
call dword [0x4e52c8]
push 0x7f00
push 0
mov dword [esp + 0xb8], eax
call dword [0x4e52e0]
push 5
mov dword [esp + 0xb0], eax
mov dword [esp + 0xa8], 0x1e
call dword [0x4e5018]
mov dword [esp + 0xb4], eax
lea eax, [esp + 0x98]
push eax
call dword [0x4e52d4]
test ax, ax
jne 0x40e099
xor eax, eax
jmp 0x40e162
push 0x96
lea eax, [esp + 0x24]
push 0x12c
push eax
call dword [sym.imp.PAL.dll_PalWindowGetPosCenter]
add esp, 0xc
push 0
push esi
push 0
push 0
push 0x96
push 0x12c
push dword [esp + 0x3c]
push dword [esp + 0x3c]
push 0x400000
push 0x510350
push 0x510350
push 8
call dword [0x4e5330]
mov esi, eax
test esi, esi
je 0x40e162
push 5
push esi
call dword [0x4e531c]
push esi
call dword [0x4e52c0]
push 1
push 0
push 0
push 0
lea eax, [esp + 0x140]
push eax
call dword [0x4e52e4]
test eax, eax
je 0x40e0f7
lea eax, [esp + 0x130]
push eax
push esi
call dword [0x4e52cc]
test eax, eax
jne 0x40e0f7
cmp dword [esp + 0x134], 0x12
je 0x40e14c
lea eax, [esp + 0x130]
push eax
call dword [0x4e52dc]
lea eax, [esp + 0x130]
push eax
call dword [0x4e52c4]
jmp 0x40e0f7
push dword [esp + 0x14]
push 0x510350
call dword [0x4e52e8]
mov eax, dword [esp + 0x138]
mov dword [esp + 0x2c], eax
mov eax, dword [0x510138]
cmp eax, 1
jne 0x40e17c
mov eax, 0x280
mov ecx, 0x1e0
jmp 0x40e1f1
cmp eax, 2
jne 0x40e18d
mov eax, 0x320
mov ecx, 0x258
jmp 0x40e1f1
cmp eax, 3
jne 0x40e19e
mov eax, 0x3c0
mov ecx, 0x258
jmp 0x40e1f1
cmp eax, 4
je 0x40e1e7
cmp eax, 5
jne 0x40e1b4
mov eax, 0x780
mov ecx, 0x438
jmp 0x40e1f1
cmp eax, 6
jne 0x40e1c5
mov eax, 0xa00
mov ecx, 0x5a0
jmp 0x40e1f1
cmp eax, 7
jne 0x40e1d6
mov eax, 0xf00
mov ecx, 0x870
jmp 0x40e1f1
cmp eax, 8
jne 0x40e1e7
mov eax, 0x1e00
mov ecx, 0x10e0
jmp 0x40e1f1
mov ecx, 0x2d0
mov eax, 0x500
push 0x208
mov dword [esp + 0x5c], eax
mov dword [esp + 0x64], eax
mov dword [0x510760], eax
lea eax, [esp + 0x174]
push 0
push eax
mov dword [esp + 0x68], ecx
mov dword [esp + 0x70], ecx
mov dword [esp + 0x58], 0x3c
mov dword [esp + 0x74], 0x5ff
mov dword [esp + 0x78], 0x5ff
mov dword [esp + 0x40], 0x510350
mov dword [esp + 0x44], 0x510350
mov dword [esp + 0x48], 0x65
mov dword [0x51012c], ecx
mov dword [esp + 0x3c], 0
call fcn.0048e190
add esp, 0xc
lea eax, [esp + 0x170]
push 0x510558
push str._sconfig.dat
push eax
call dword [0x4e5298]
add esp, 0xc
lea eax, [esp + 0x170]
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push eax
call dword [0x4e5060]
mov esi, eax
cmp esi, 0xffffffff
je 0x40e377
push 0
push esi
call dword [0x4e507c]
test eax, eax
je 0x40e377
push 0
lea eax, [esp + 0x1c]
push eax
push 0x24
lea eax, [esp + 0x13c]
push eax
push esi
call dword [0x4e5184]
push esi
call edi
cmp dword [esp + 0x18], 0x24
jne 0x40e377
mov eax, dword [esp + 0x130]
mov esi, dword [0x4e5310]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x134]
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x138]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x13c]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x140]
mov dword [esp + 0x84], eax
mov eax, dword [esp + 0x148]
mov dword [esp + 0x8c], eax
mov eax, dword [esp + 0x14c]
mov dword [esp + 0x88], eax
mov eax, dword [esp + 0x144]
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x150]
push 0x22
mov dword [esp + 0x94], eax
call esi
mov ecx, dword [esp + 0x58]
cmp ecx, eax
push 0x23
cmovl ecx, dword [0x510760]
mov dword [esp + 0x5c], ecx
call esi
cmp dword [esp + 0x5c], eax
jge 0x40e387
mov eax, dword [0x51012c]
mov dword [esp + 0x5c], eax
jmp 0x40e387
lea edx, [esp + 0x28]
lea ecx, [esp + 0x170]
call fcn.00468ce0
push 0x4f65b0
push dword [esp + 0x20]
call fcn.0048d1a0
mov esi, eax
add esp, 8
test esi, esi
je 0x40e473
push 9
inc esi
push str.MOVIESKIP
push esi
call fcn.004983b0
add esp, 0xc
test eax, eax
jne 0x40e3c6
mov byte [0x510122], 1
add esi, 9
jmp 0x40e45b
push 3
push 0x4f65c0
push esi
call fcn.004983b0
add esp, 0xc
test eax, eax
jne 0x40e3f4
mov eax, dword [esp + 0x84]
not eax
or eax, 8
add esi, 3
not eax
mov dword [esp + 0x84], eax
jmp 0x40e45b
push 2
push 0x4f65c4
push esi
call fcn.004983b0
add esp, 0xc
test eax, eax
jne 0x40e411
mov dword [esp + 0x88], eax
jmp 0x40e458
push 2
push 0x4f65c8
push esi
call fcn.004983b0
add esp, 0xc
test eax, eax
jne 0x40e43c
mov eax, dword [esp + 0x84]
not eax
or eax, 1
not eax
mov dword [esp + 0x84], eax
jmp 0x40e458
push 2
push 0x4f65cc
push esi
call fcn.004983b0
add esp, 0xc
test eax, eax
jne 0x40e45b
or dword [esp + 0x84], 8
add esi, 2
push 0x4f65b0
push esi
call fcn.0048d1a0
mov esi, eax
add esp, 8
test esi, esi
jne 0x40e3a2
mov ecx, dword [esp + 0x14]
call fcn.004648f0
mov dword [0x50c9e0], eax
lea eax, [esp + 0x28]
push eax
call dword [sym.imp.PAL.dll_PalInit]
add esp, 4
test eax, eax
je 0x40e8ff
xor ecx, ecx
call fcn.00469340
push str.system.dat
push 0x510558
lea eax, [esp + 0x380]
push str._s_s
push eax
call dword [0x4e5298]
lea eax, [esp + 0x174]
push eax
lea eax, [esp + 0x38c]
push eax
call dword [sym.imp.PAL.dll_PalFileCreate]
mov esi, eax
add esp, 0x18
cmp esi, 0xffffffff
je 0x40e5fb
push 1
push 0
push 2
push esi
call dword [0x4e504c]
push 0
lea eax, [esp + 0x20]
push eax
push 4
lea eax, [esp + 0x24]
push eax
push esi
call dword [0x4e5184]
push esi
call edi
lea eax, [esp + 0x164]
push eax
push str.Script.src
call dword [sym.imp.PAL.dll_PalFileCreate]
mov esi, eax
add esp, 8
cmp esi, 0xffffffff
je 0x40e55d
mov ecx, dword [esp + 0x164]
push 0
push 0
add ecx, 4
push ecx
push esi
call dword [0x4e504c]
push 0
lea eax, [esp + 0x20]
push eax
push 4
lea eax, [esp + 0x2c]
push eax
push esi
call dword [0x4e5184]
push esi
call edi
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x20]
je 0x40e5fb
cmp byte [0x510120], 0
je 0x40e5b5
call fcn.00469090
test eax, eax
jne 0x40e5fb
push 0x40020
push 0x4f66fc
push 0x4f670c
call dword [0x4e52a4]
push eax
call dword [0x4e5294]
call dword [sym.imp.PAL.dll_PalUninit]
push dword [0x510130]
call edi
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x774]
xor ecx, esp
call fcn.0048b5cc
mov esp, ebp
pop ebp
ret 0x10
push 0x40024
push 0x4f6744
push 0x4f6750
call dword [0x4e52a4]
mov esi, dword [0x4e5294]
push eax
call esi
cmp eax, 6
jne 0x40e58f
call fcn.00469090
test eax, eax
jne 0x40e5fb
push 0x40020
push 0x4f66fc
push 0x4f670c
call dword [0x4e52a4]
push eax
call esi
jmp 0x40e58f
push str.User32.dll
call dword [0x4e50c8]
mov dword [0x510778], eax
test eax, eax
je 0x40e623
push str.GetProductInfo
push dword [esp + 0x18]
call dword [0x4e50c4]
mov dword [0x51077c], eax
call dword [sym.imp.PAL.dll_PalDebugIs]
test eax, eax
je 0x40e77d
push 0x510454
call dword [sym.imp.PAL.dll_PalGetFilePath]
push eax
lea eax, [esp + 0x380]
push str._s_s.ini
push eax
call dword [0x4e5298]
mov edi, dword [0x4e5038]
lea eax, [esp + 0x388]
add esp, 0x10
push eax
push 1
push str.History
push str.DebugWindow
call edi
mov esi, dword [sym.imp.PAL.dll_PalDebugWindowCreate]
test eax, eax
je 0x40e687
push 1
push 0x4f6198
push 0xa
call esi
add esp, 0xc
lea eax, [esp + 0x378]
push eax
push 1
push str.UserMemory
push str.DebugWindow
call edi
test eax, eax
je 0x40e6af
push 3
push 0x4f61ac
push 0xb
call esi
add esp, 0xc
lea eax, [esp + 0x378]
push eax
push 1
push str.SystemMemory
push str.DebugWindow
call edi
test eax, eax
je 0x40e6d7
push 3
push 0x4f61cc
push 0xc
call esi
add esp, 0xc
lea eax, [esp + 0x378]
push eax
push 1
push str.TempMemory
push str.DebugWindow
call edi
test eax, eax
je 0x40e6ff
push 3
push 0x4f61e8
push 0xd
call esi
add esp, 0xc
lea eax, [esp + 0x378]
push eax
push 1
push 0x4f61fc
push str.DebugWindow
call edi
test eax, eax
je 0x40e727
push 3
push 0x4f6200
push 0xe
call esi
add esp, 0xc
lea eax, [esp + 0x378]
push eax
push 1
push 0x4f6210
push str.DebugWindow
call edi
test eax, eax
je 0x40e74f
push 3
push 0x4f6214
push 0xf
call esi
add esp, 0xc
lea eax, [esp + 0x378]
push eax
push 1
push str.Output
push str.DebugWindow
call edi
test eax, eax
je 0x40e777
push 1
push str.output
push 0x10
call esi
add esp, 0xc
mov edi, dword [0x4e517c]
call dword [sym.imp.PAL.dll_PalRun]
push 0x208
lea eax, [esp + 0x174]
push 0
push eax
call fcn.0048e190
add esp, 0xc
lea eax, [esp + 0x170]
push 0x510558
push str._sconfig.dat
push eax
call dword [0x4e5298]
add esp, 0xc
lea eax, [esp + 0x170]
push 0
push 0x80
push 2
push 0
push 2
push 0x40000000
push eax
call dword [0x4e5060]
mov esi, eax
cmp esi, 0xffffffff
je 0x40e8d5
lea eax, [esp + 0xc0]
push eax
call dword [sym.imp.PAL.dll_PalGetSystemParameters]
mov eax, dword [esp + 0xec]
add esp, 4
mov ecx, dword [esp + 0x11c]
mov dword [esp + 0x130], eax
or ecx, 8
mov eax, dword [esp + 0xec]
mov dword [esp + 0x134], eax
mov eax, dword [esp + 0xf0]
mov dword [esp + 0x138], eax
mov eax, dword [esp + 0xf4]
mov dword [esp + 0x13c], eax
mov eax, dword [esp + 0x124]
mov dword [esp + 0x148], eax
mov eax, dword [esp + 0x120]
mov dword [esp + 0x14c], eax
mov eax, dword [esp + 0x114]
mov dword [esp + 0x144], eax
mov eax, dword [esp + 0x128]
push 0
mov dword [esp + 0x154], eax
lea eax, [esp + 0x24]
push eax
push 0x24
lea eax, [esp + 0x13c]
mov dword [esp + 0x128], ecx
push eax
push esi
mov dword [esp + 0x154], ecx
call dword [0x4e5180]
test eax, eax
jne 0x40e8d2
lea eax, [esp + 0x170]
push eax
lea eax, [esp + 0x37c]
push 0x4fc2b0
push eax
call dword [0x4e5298]
add esp, 0xc
lea eax, [esp + 0x378]
push 0x40030
push 0x4fc2f0
push eax
call dword [0x4e52a4]
push eax
call dword [0x4e5294]
push esi
call edi
call dword [sym.imp.PAL.dll_PalUninit]
mov eax, dword [0x510778]
test eax, eax
je 0x40e8eb
push eax
call dword [0x4e50c0]
mov dword [0x510778], 0
mov dword [0x51077c], 0
push dword [0x510130]
call edi
mov ecx, dword [esp + 0x77c]
xor eax, eax
pop edi
pop esi
xor ecx, esp
mov dword [0x510130], 0
call fcn.0048b5cc
mov esp, ebp
pop ebp
ret 0x10