Function at 0x511540
Capabilities:
Print debug messages

Disassembly:
mov eax, dword [0xf9150c]
sub esp, 0x6c
test eax, eax
jne 0x511556
mov dword [0xf9150c], 0xf924a8
mov eax, dword [0x5d0198]
fild dword [0x5d0198]
test eax, eax
jge 0x51156b
fadd dword [0x5befa4]
mov ecx, dword [0x5d019c]
fild dword [0x5d019c]
test ecx, ecx
jge 0x511581
fadd dword [0x5befa4]
fdivp st(1)
mov eax, dword [0xf914e0]
test eax, eax
fstp dword [0x5d0190]
jne 0x5115a5
push 0xdc
call sub.d3d8.dll_Direct3DCreate8
test eax, eax
mov dword [0xf914e0], eax
je 0x5115b6
mov edx, dword [eax]
lea ecx, [esp + 0x14]
push ecx
push 0
push eax
call dword [edx + 0x20]
test eax, eax
jge 0x5115bf
mov eax, 0x80004005
add esp, 0x6c
ret
push ebx
push ebp
push esi
push edi
call fcn.00510ea0
mov ebp, dword [0x5d01a8]
cmp ebp, 0xffffffff
mov esi, dword [0xf91518]
mov edi, dword [0xf91510]
je 0x5115f7
cmp ebp, edi
ja 0x5115f7
jae 0x511652
mov edx, ebp
imul edx, edx, 0x508
cmp dword [edx + esi + 0x434], 1
je 0x511652
xor eax, eax
xor cl, cl
test edi, edi
jbe 0x511627
lea edx, [esi + 0x434]
test cl, cl
jne 0x51164c
cmp dword [edx], 1
jne 0x511612
mov ebp, eax
mov cl, 1
inc eax
add edx, 0x508
cmp eax, edi
jb 0x511605
test cl, cl
mov dword [0x5d01a8], ebp
jne 0x511652
push str.Couldnt_find_a_hardware_D3D_device_n
call fcn.004fefa0
mov eax, dword [0xf914e0]
mov ecx, dword [eax]
add esp, 4
push eax
call dword [ecx + 8]
pop edi
pop esi
pop ebp
mov eax, 0x80004005
pop ebx
add esp, 0x6c
ret
mov dword [0x5d01a8], ebp
cmp dword [0xf914e4], 1
mov ebx, 0x15
mov dword [0xf72394], 0x4b
je 0x5116a9
mov esi, dword [esp + 0x30]
cmp esi, 0x14
je 0x51169a
cmp esi, ebx
je 0x51169a
cmp esi, 0x16
je 0x51169a
mov dword [0xf914f4], 0x10
mov ebx, 0x17
mov dword [0xf72394], 0x50
jmp 0x5117f5
mov dword [0xf914f4], 0x20
jmp 0x5117f5
mov edi, dword [0xf914f4]
test edi, edi
jne 0x5116be
mov edi, 0x20
mov dword [0xf914f4], edi
mov edx, dword [0x5d0198]
mov ebx, dword [0x5d019c]
push edx
call fcn.005110e0
add esp, 4
cmp eax, 0xffffffff
mov dword [0xf91514], eax
jne 0x51174e
push str.Couldnt_find_display_mode_nDefaulting_to_640x480_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov edi, dword [0xf914f4]
push 0x280
mov ebx, 0x1e0
call fcn.005110e0
add esp, 4
cmp eax, 0xffffffff
mov dword [0xf91514], eax
jne 0x511742
cmp edi, 0x20
jne 0x511742
mov edi, 0x10
push 0x280
mov dword [0xf914f4], edi
call fcn.005110e0
add esp, 4
cmp eax, 0xffffffff
mov dword [0xf91514], eax
jne 0x5118f0
pop edi
pop esi
pop ebp
mov eax, 0x80004005
pop ebx
add esp, 0x6c
ret
mov ebp, dword [0x5d01a8]
mov esi, dword [0xf91518]
cmp edi, 0x10
je 0x5118fc
mov edx, ebp
imul edx, edx, 0x508
mov ecx, dword [edx + esi + 0x430]
shl eax, 4
mov esi, dword [ecx + eax + 0xc]
cmp esi, 0x16
mov dword [0xf72394], 0x4d
mov ebx, 0x15
je 0x511783
mov ebx, esi
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push 0x4d
push ebx
push esi
push 1
push ebp
push eax
call dword [edx + 0x30]
test eax, eax
jge 0x5117ef
mov edx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov ecx, dword [eax]
push 0x4b
push ebx
push esi
push 1
push edx
push eax
mov dword [0xf72394], 0x4b
call dword [ecx + 0x30]
test eax, eax
jge 0x5117ef
mov edx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov ecx, dword [eax]
push 0x47
push ebx
push esi
push 1
push edx
push eax
mov dword [0xf72394], 0x47
call dword [ecx + 0x30]
test eax, eax
jge 0x5117ef
mov dword [0xf72394], 0x50
mov ebp, dword [0x5d01a8]
push 0
push ebx
push esi
xor eax, eax
push 1
mov ecx, 0xd
mov edi, 0xf72658
rep stosd dword es:[edi], eax
mov eax, dword [0xf914e0]
mov ecx, dword [eax]
push ebp
push eax
call dword [ecx + 0x24]
mov esi, eax
test esi, esi
jge 0x511a70
mov eax, dword [0xf914f4]
cmp eax, 0x20
jne 0x51199b
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push 0
mov ebx, 0x17
push ebx
push ebx
push 1
push ecx
push eax
mov dword [0xf914f4], 0x10
mov dword [0xf72394], 0x50
call dword [edx + 0x24]
mov esi, eax
test esi, esi
jl 0x511a56
mov ecx, dword [0xf72394]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push ecx
mov ecx, dword [0x5d01a8]
push ebx
push ebx
push 1
push ecx
push eax
call dword [edx + 0x30]
test eax, eax
jge 0x511a52
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push 0x4d
push ebx
push ebx
push 1
push ecx
push eax
mov dword [0xf72394], 0x4d
call dword [edx + 0x30]
test eax, eax
jge 0x511a52
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push 0x4b
push ebx
push ebx
push 1
push ecx
push eax
mov dword [0xf72394], 0x4b
call dword [edx + 0x30]
test eax, eax
jge 0x511a52
mov dword [0xf72394], 0x47
jmp 0x511a52
mov ebp, dword [0x5d01a8]
mov esi, dword [0xf91518]
mov ecx, ebp
imul ecx, ecx, 0x508
mov edx, dword [ecx + esi + 0x430]
push 0x50
shl eax, 4
mov esi, dword [edx + eax + 0xc]
mov eax, dword [0xf914e0]
mov ecx, dword [eax]
push esi
push esi
push 1
push ebp
push eax
mov dword [0xf72394], 0x50
mov ebx, esi
call dword [ecx + 0x30]
test eax, eax
jge 0x5117ef
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push 0x4d
push esi
push esi
push 1
push ecx
push eax
mov dword [0xf72394], 0x4d
call dword [edx + 0x30]
test eax, eax
jge 0x5117ef
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push 0x4b
push esi
push esi
push 1
push ecx
push eax
mov dword [0xf72394], 0x4b
call dword [edx + 0x30]
test eax, eax
jge 0x5117ef
mov dword [0xf72394], 0x47
jmp 0x5117ef
cmp eax, 0x10
jne 0x511a52
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push 0
mov ebx, 0x15
push ebx
push 0x16
push 1
push ecx
mov edi, 0x4b
push eax
mov dword [0xf914f4], 0x20
mov dword [0xf72394], edi
call dword [edx + 0x24]
mov esi, eax
test esi, esi
jl 0x511a56
mov ecx, dword [0xf72394]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push ecx
mov ecx, dword [0x5d01a8]
push ebx
push 0x16
push 1
push ecx
push eax
call dword [edx + 0x30]
test eax, eax
jge 0x511a52
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push edi
push ebx
push 0x16
push 1
push ecx
push eax
mov dword [0xf72394], edi
call dword [edx + 0x30]
test eax, eax
jge 0x511a52
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push 0x47
push ebx
push 0x16
push 1
push ecx
push eax
mov dword [0xf72394], 0x47
call dword [edx + 0x30]
test eax, eax
jge 0x511a52
mov dword [0xf72394], 0x50
test esi, esi
jge 0x511a70
push str.Couldnt_Find_a_compatible_display_mode_n
call fcn.004fefa0
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 0x80004005
pop ebx
add esp, 0x6c
ret
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf914e0]
mov edx, dword [eax]
push ecx
push eax
xor esi, esi
xor ebp, ebp
call dword [edx + 0x38]
mov edx, eax
xor eax, eax
mov ecx, 0xa
lea edi, [esp + 0x54]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x54]
push eax
push edx
mov dword [esp + 0x5c], 0x28
call dword [sym.imp.USER32.dll_GetMonitorInfoA]
test eax, eax
je 0x511ab5
mov esi, dword [esp + 0x58]
mov ebp, dword [esp + 0x5c]
mov eax, dword [0xf914e4]
xor edx, edx
cmp eax, edx
je 0x511b95
mov ecx, dword [0x5d01a8]
mov eax, dword [0xf91518]
imul ecx, ecx, 0x508
lea ecx, [ecx + eax + 0x430]
mov eax, dword [0xf91514]
mov dword [0xf72674], edx
mov edi, dword [ecx]
shl eax, 4
mov edi, dword [eax + edi]
mov dword [0xf72658], edi
mov ecx, dword [ecx]
mov eax, dword [eax + ecx + 4]
mov ecx, dword [0xf72394]
mov dword [0xf7265c], eax
mov eax, dword [0x60bec4]
mov edi, 1
mov dword [0xf7267c], ecx
mov ecx, dword [0x5d019c]
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], edx
mov edx, dword [0x5d0198]
push 0xffffffffffffffec
push eax
mov dword [0xf72664], edi
mov dword [0xf7266c], edi
mov dword [0xf72660], ebx
mov dword [0xf72678], edi
mov dword [0xf72670], eax
mov dword [0xf72688], 0x80000000
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], ecx
call dword [sym.imp.USER32.dll_GetWindowLongA]
mov edx, dword [0x60bec4]
push 0x80080000
push 0xfffffffffffffff0
push edx
mov ebx, eax
call dword [sym.imp.USER32.dll_SetWindowLongA]
push ebx
push 0
push 0x80080000
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.USER32.dll_AdjustWindowRectEx]
push 0x160
jmp 0x511c28
mov eax, dword [0x5d0198]
mov ecx, dword [0x5d019c]
mov dword [0xf72660], ebx
mov ebx, dword [0xf72394]
mov dword [0xf7267c], ebx
mov ebx, dword [0x60bec4]
mov edi, 1
push 0xfffffffffffffff0
mov dword [0xf72670], ebx
push ebx
mov ebx, dword [sym.imp.USER32.dll_GetWindowLongA]
mov dword [0xf72674], edi
mov dword [0xf72658], eax
mov dword [0xf7265c], ecx
mov dword [0xf72664], edi
mov dword [0xf7266c], edi
mov dword [0xf72678], edi
mov dword [esp + 0x20], edx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ecx
call ebx
mov ecx, dword [0x60bec4]
push 0xffffffffffffffec
push ecx
mov dword [esp + 0x18], eax
call ebx
mov edx, dword [esp + 0x10]
push eax
push 0
push edx
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.USER32.dll_AdjustWindowRectEx]
push 0x140
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x24]
mov ebx, dword [esp + 0x18]
mov eax, dword [0x60bec4]
sub ecx, edx
mov edx, dword [esp + 0x20]
push ecx
sub edx, ebx
push edx
push ebp
push esi
push 0
push eax
call dword [sym.imp.USER32.dll_SetWindowPos]
mov esi, dword [0x5d01a8]
mov edx, dword [0xf91518]
mov ecx, esi
imul ecx, ecx, 0x508
mov ebp, dword [ecx + edx + 0x450]
test ebp, 0x10000
mov bl, byte [ecx + edx + 0x501]
lea eax, [ecx + edx + 0x434]
mov cl, byte [eax + 0xc5]
mov dl, byte [eax + 0xc4]
je 0x511c94
mov al, byte [0x5d01a4]
and al, 1
jmp 0x511c96
xor al, al
cmp byte [0xf9150a], 0
mov byte [0x5d01a4], al
je 0x511cc5
mov bl, byte [0xf91509]
test bl, bl
je 0x511ce7
test al, al
je 0x511ce7
cmp cl, 1
jb 0x511cbc
cmp dl, 1
jae 0x511ce7
xor al, al
mov byte [0x5d01a4], al
jmp 0x511ce7
test al, al
je 0x511ce0
cmp cl, 1
jb 0x511ce0
cmp dl, 1
jb 0x511ce0
test bl, bl
jbe 0x511ce0
and byte [0xf91509], 1
jmp 0x511ce7
mov byte [0xf91509], 0
mov ecx, dword [0xf914e0]
mov edx, dword [ecx]
neg al
push 0xf914dc
push 0xf72658
sbb eax, eax
and eax, 0x20
add eax, 0x20
push eax
mov eax, dword [0x60bec4]
push eax
push edi
push esi
push ecx
call dword [edx + 0x3c]
test eax, eax
jge 0x511d4b
mov edx, dword [0x60bec4]
mov eax, dword [0xf914e0]
mov ecx, dword [eax]
push 0xf914dc
push 0xf72658
push 0x20
push edx
mov edx, dword [0x5d01a8]
push edi
push edx
push eax
call dword [ecx + 0x3c]
test eax, eax
jl 0x51163f
mov byte [0x5d01a4], 0
jmp 0x511d5e
mov al, byte [0x5d01a4]
test al, al
mov dword [0xf9151c], 0
jne 0x511d68
mov dword [0xf9151c], 0x10
call fcn.00512aa0
mov eax, dword [0xf72658]
test eax, eax
mov esi, dword [0xf7265c]
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
mov dword [0x5d0198], eax
mov dword [0x5d019c], esi
jge 0x511d95
fadd dword [0x5befa4]
fld dword [0x5bf140]
fmul st(1)
call fcn.00581d24
test esi, esi
mov dword [esp + 0x10], esi
fild dword [esp + 0x10]
mov dword [0xf914f8], eax
jge 0x511db9
fadd dword [0x5befa4]
fst dword [esp + 0x10]
fmul dword [0x5bf140]
call fcn.00581d24
fmul dword [0x5bf13c]
mov dword [0xf914fc], eax
call fcn.00581d24
fld dword [esp + 0x10]
fmul dword [0x5bf13c]
mov dword [0xf91500], eax
call fcn.00581d24
push 0xf914e8
push 0
mov dword [0xf91504], eax
mov eax, dword [0xf914dc]
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x40]
mov eax, dword [0xf914f0]
mov edx, dword [0xf914e8]
mov dword [0xf72398], eax
xor eax, eax
mov ecx, 8
lea edi, [esp + 0x34]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x34]
push eax
mov dword [0xf71f68], edx
mov ecx, dword [edx]
push edx
call dword [ecx + 0x20]
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x50]
push 0
push 0x3f800000
push 0
push 1
push 0
mov dword [0xf72658], eax
mov dword [0x5d0198], eax
mov eax, dword [0xf914dc]
push 0
mov dword [0xf7265c], ecx
mov dword [0x5d019c], ecx
mov ecx, dword [eax]
push eax
call dword [ecx + 0x90]
mov eax, dword [0xf914dc]
mov edx, dword [eax]
push 0
push 0
push 0
push 0
push eax
call dword [edx + 0x3c]
mov eax, dword [0xf914dc]
mov ecx, dword [eax]
push 0
push 0x3f800000
push 0
push 1
push 0
push 0
push eax
call dword [ecx + 0x90]
mov eax, dword [0xf914dc]
mov edx, dword [eax]
push 0
push 0
push 0
push 0
push eax
call dword [edx + 0x3c]
mov al, byte [0x5d01a6]
test al, al
je 0x511f39
mov al, byte [0x5d01a5]
test al, al
je 0x511f39
call fcn.00499840
mov ecx, dword [eax + 0x3c]
test ch, 1
jne 0x511edb
call fcn.00499840
test byte [eax + 0x3c], 2
jne 0x511f39
mov eax, dword [0xf914dc]
mov ecx, dword [eax]
lea edx, [esp + 0x10]
push edx
mov edx, dword [esp + 0x38]
push 0
push edx
mov edx, dword [0x5d019c]
push 1
push 1
push edx
mov edx, dword [0x5d0198]
push edx
push eax
call dword [ecx + 0x50]
test eax, eax
jl 0x511f39
mov eax, dword [0xf914e8]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov eax, dword [esp + 0x10]
mov edx, dword [eax]
push 0xf71f68
push 0
push eax
call dword [edx + 0x3c]
mov eax, dword [esp + 0x10]
mov ecx, dword [0xf71f68]
mov dword [0xf914ec], eax
mov dword [0xf914e8], ecx
mov eax, dword [0xf914dc]
mov edx, dword [eax]
push 0xf72398
push eax
call dword [edx + 0x84]
mov eax, dword [0xf72398]
push 0
push 0x3f800000
push 0
push 3
push 0
mov dword [0xf914f0], eax
mov eax, dword [0xf914dc]
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x90]
fld dword [0x5d01b8]
fcomp dword [0x5bef98]
fnstsw ax
test ah, 0x41
jne 0x511fad
mov edx, dword [0x5d01b8]
mov dword [esp + 0x10], edx
mov dword [0x5d01b8], 0x3dcccccd
call fcn.00513460
mov eax, dword [esp + 0x10]
mov dword [0x5d01b8], eax
call fcn.00513460
call fcn.00515450
call fcn.00515480
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x6c
ret