Function at 0x504740
Capabilities:
Access peb ldr_data
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x190
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x4f3b40
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.user32.dll_EnumDisplayMonitors]
sub esp, 0x10
call fcn.004e51e0
mov ebx, eax
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4aa2
xor eax, eax
test ebx, ebx
setne al
mov dword [esp + 4], str.Failed_to_create_a_ddraw_object._n
mov dword [esp], eax
call fcn.004e6560
call fcn.004e5430
mov esi, eax
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4aa4
xor eax, eax
test esi, esi
setne al
mov dword [esp + 4], str.Failed_to_create_a_window._n
mov dword [esp], eax
call fcn.004e6560
mov eax, dword [ebx]
mov dword [esp + 8], 0x11
mov dword [esp + 4], esi
mov dword [esp], ebx
call dword [eax + 0x50]
sub esp, 0xc
mov edi, eax
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4aa7
xor eax, eax
test edi, edi
sete al
mov dword [esp + 8], edi
mov dword [esp], eax
mov dword [esp + 4], str.SetCooperativeLevel_failed__hr__lx._n
call fcn.004e6560
lea edx, [ebp - 0xe8]
xor eax, eax
mov ecx, 0x37
mov edi, edx
rep stosd dword es:[edi], eax
mov eax, 0xdc
mov word [ebp - 0xa4], ax
mov dword [esp + 8], edx
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0
call dword [sym.imp.user32.dll_EnumDisplaySettingsW]
sub esp, 0xc
mov edi, eax
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4aac
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp], edi
lea edi, [ebp - 0x164]
mov dword [esp + 4], str.EnumDisplaySettingsW_failed__error__lu._n
mov dword [esp + 8], eax
call fcn.004e6560
mov dword [ebp - 0x164], 0x7c
mov eax, dword [ebx]
mov dword [esp + 4], edi
mov dword [esp], ebx
call dword [eax + 0x30]
sub esp, 8
mov dword [ebp - 0x184], eax
call fcn.0054f6e0
mov edx, dword [ebp - 0x184]
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ab0
xor eax, eax
test edx, edx
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.GetDisplayMode_failed__hr__lx._n
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ab1
mov eax, dword [ebp - 0x164]
mov dword [esp + 4], str.Got_dwSize__lu._n
cmp eax, 0x7c
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ab2
mov eax, dword [ebp - 0x160]
mov dword [esp + 8], 0x4100e
cmp eax, 0x4100e
mov dword [esp + 0xc], eax
sete al
mov dword [esp + 4], str.Expected_dwFlags__lx__got__lx._n
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ab4
mov edx, dword [ebp - 0x158]
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], str.Expected_width__lu__got__lu._n
mov dword [esp + 0xc], edx
cmp edx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ab6
mov edx, dword [ebp - 0x15c]
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], str.Expected_height__lu__got__lu._n
mov dword [esp + 0xc], edx
cmp edx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ab8
mov edx, dword [ebp - 0x14c]
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], str.Expected_frequency__lu__got__lu._n
mov dword [esp + 0xc], edx
cmp edx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4aba
mov eax, dword [ebp - 0x11c]
mov dword [esp + 4], str.Got_ddpfPixelFormat.dwSize__lu._n
cmp eax, 0x20
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4abc
mov edx, dword [ebp - 0x110]
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.Expected_ddpfPixelFormat.dwRGBBitCount__lu__got__lu._n
mov dword [esp + 0xc], edx
cmp edx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4abf
mov eax, dword [ebp - 0x3c]
imul eax, dword [ebp - 0x40]
mov edx, dword [ebp - 0x154]
mov dword [esp + 4], str.Expected_pitch__lu__got__lu._n
mov dword [esp + 0xc], edx
shr eax, 3
cmp edx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
xor edx, edx
xor eax, eax
mov dword [ebp + eax - 0x180], edx
add eax, 4
cmp eax, 0x1c
jb 0x504ab7
mov eax, dword [ebp - 0x14c]
lea ecx, [ebp - 0x180]
mov dword [ebp - 0x178], eax
mov eax, dword [ebx]
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], 0x4e5940
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], ebx
call dword [eax + 0x20]
sub esp, 0x14
mov dword [ebp - 0x184], eax
call fcn.0054f6e0
mov edx, dword [ebp - 0x184]
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ac7
xor eax, eax
test edx, edx
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.EnumDisplayModes_failed__hr__lx._n
call fcn.004e6560
mov eax, dword [ebp - 0x16c]
test eax, eax
je 0x504d10
mov edx, dword [ebx]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x168]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x170]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x174]
mov dword [esp], ebx
mov dword [esp + 4], eax
call dword [edx + 0x54]
sub esp, 0x18
mov dword [ebp - 0x184], eax
call fcn.0054f6e0
mov edx, dword [ebp - 0x184]
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ad0
xor eax, eax
test edx, edx
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.SetDisplayMode_failed__hr__lx._n
call fcn.004e6560
mov eax, dword [ebx]
mov dword [esp + 4], edi
mov dword [esp], ebx
call dword [eax + 0x30]
sub esp, 8
mov edi, eax
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ad2
xor eax, eax
test edi, edi
sete al
mov dword [esp + 8], edi
mov dword [esp], eax
mov dword [esp + 4], str.GetDisplayMode_failed__hr__lx._n
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ad3
mov edx, dword [ebp - 0x158]
mov eax, dword [ebp - 0x174]
mov dword [esp + 4], str.Expected_width__u__got__lu._n
mov dword [esp + 0xc], edx
cmp edx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ad5
mov edx, dword [ebp - 0x15c]
mov eax, dword [ebp - 0x170]
mov dword [esp + 4], str.Expected_height__u__got__lu._n
mov dword [esp + 0xc], edx
cmp edx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ad7
mov edx, dword [ebp - 0x14c]
mov eax, dword [ebp - 0x16c]
mov dword [esp + 4], str.Expected_frequency__u__got__lu._n
mov dword [esp + 0xc], edx
cmp edx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
call fcn.0054f6e0
mov dword [eax], 0x57df88
mov dword [eax + 4], 0x4ad9
mov eax, dword [ebp - 0x110]
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0x40]
mov dword [esp + 4], str.Expected_ddpfPixelFormat.dwRGBBitCount__lu__got__lu._n
mov dword [esp + 8], edx
cmp dword [ebp - 0x168], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004e6560
mov dword [esp], esi
call dword [sym.imp.user32.dll_DestroyWindow]
mov eax, dword [ebx]
sub esp, 4
mov dword [esp], ebx
call dword [eax + 8]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0x4aca
call fcn.004e5d30
mov dword [esp], str.Failed_to_find_a_display_mode_with_a_different_frequency._n
call fcn.004e5ff0
jmp 0x504ceb