Function at 0x4581e0
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x158
mov eax, dword [0x4d0b90]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x148], ecx
push 0x20
call dword [sym.imp.d3d9.dll_Direct3DCreate9]
mov ecx, dword [ebp - 0x148]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x148]
cmp dword [edx + 4], 0
jne 0x458237
push 0x10
push 0x4c5a88
push str._ERR:I001_Direct3DCreate_FAILED_
push 0
mov ecx, dword [ebp - 0x148]
call fcn.00458f60
or eax, 0xffffffff
jmp 0x458752
mov eax, dword [ebp - 0x148]
mov ecx, dword [ebp + 0x10]
mov dword [eax + 0x374], ecx
mov edx, dword [ebp - 0x148]
mov eax, dword [ebp + 0x14]
mov dword [edx + 0x378], eax
push 0x130
push 0
lea ecx, [ebp - 0x144]
push ecx
call fcn.0049efc0
add esp, 0xc
lea edx, [ebp - 0x144]
push edx
push 1
push 0
mov eax, dword [ebp - 0x148]
mov ecx, dword [eax + 4]
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 4]
mov ecx, dword [ecx]
push eax
mov edx, dword [ecx + 0x38]
call edx
cmp dword [ebp - 0xec], 0x800
ja 0x4582b2
push 0x30
push 0x4c5ab8
push 0x4c5ac0
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, dword [ebp - 0x148]
mov byte [ecx + 0x3c8], 0
mov edx, dword [ebp - 0x108]
and edx, 2
jne 0x4582e4
mov eax, dword [ebp - 0x108]
and eax, 0x100
jne 0x4582e4
mov ecx, dword [ebp - 0x148]
mov byte [ecx + 0x3c8], 1
lea edx, [ebp - 0x14]
push edx
push 0
mov eax, dword [ebp - 0x148]
mov ecx, dword [eax + 4]
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 4]
mov ecx, dword [ecx]
push eax
mov edx, dword [ecx + 0x20]
call edx
test eax, eax
jge 0x458329
push 0x10
push 0x4c5b94
push str._ERR:I002_GetAdapterDisplayMode_FAILED_
push 0
mov ecx, dword [ebp - 0x148]
call fcn.00458f60
or eax, 0xffffffff
jmp 0x458752
mov eax, dword [ebp - 8]
mov dword [ebp - 0x14c], eax
mov ecx, dword [ebp - 0x14c]
sub ecx, 0x14
mov dword [ebp - 0x14c], ecx
cmp dword [ebp - 0x14c], 0x3c
ja case.0x45835b.11
mov edx, dword [ebp - 0x14c]
movzx eax, byte [edx + 0x45877c]
jmp dword [eax*4 + 0x458764]
push str.DISPLAYMODE:____R8G8B8
mov ecx, dword [ebp - 0x148]
add ecx, 0x41
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp case.0x45835b.11
push str.DISPLAYMODE:__A8R8G8B8
mov edx, dword [ebp - 0x148]
add edx, 0x41
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp case.0x45835b.11
push str.DISPLAYMODE:__X8R8G8B8
mov eax, dword [ebp - 0x148]
add eax, 0x41
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp case.0x45835b.11
push str.DISPLAYMODE:____R5G6B5
mov ecx, dword [ebp - 0x148]
add ecx, 0x41
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp case.0x45835b.11
push str.DisplayMode:____UNKNOWN
mov edx, dword [ebp - 0x148]
add edx, 0x41
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x38
push 0
mov eax, dword [ebp - 0x148]
add eax, 0x170
push eax
call fcn.0049efc0
add esp, 0xc
mov ecx, dword [ebp - 0x148]
mov dword [ecx + 0x188], 1
mov edx, dword [ebp - 0x148]
mov dword [edx + 0x1a4], 0
mov dword [ebp - 8], 0x16
mov eax, dword [ebp - 0x148]
mov cl, byte [ebp + 0xc]
mov byte [eax + 0x19], cl
mov edx, dword [ebp - 0x148]
mov dword [edx + 0x190], 1
mov eax, dword [ebp - 0x148]
mov ecx, dword [ebp - 8]
mov dword [eax + 0x178], ecx
mov edx, dword [ebp - 0x148]
mov dword [edx + 0x17c], 1
mov eax, dword [ebp - 0x148]
mov dword [eax + 0x194], 1
mov ecx, dword [ebp - 0x148]
mov dword [ecx + 0x198], 0x4b
mov edx, dword [ebp - 0x148]
mov dword [edx + 0x1a0], 0
mov eax, dword [ebp - 0x148]
mov dword [eax + 0x19c], 1
mov ecx, dword [ebp - 0x148]
mov edx, dword [ebp + 0x10]
mov dword [ecx + 0x170], edx
mov eax, dword [ebp - 0x148]
mov ecx, dword [ebp + 0x14]
mov dword [eax + 0x174], ecx
mov edx, dword [ebp - 0x148]
mov eax, dword [ebp + 8]
mov dword [edx + 0x18c], eax
push 0x4b
push 1
push 2
mov ecx, dword [ebp - 8]
push ecx
push 1
push 0
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 4]
mov ecx, dword [ebp - 0x148]
mov edx, dword [ecx + 4]
mov eax, dword [eax]
push edx
mov ecx, dword [eax + 0x28]
call ecx
test eax, eax
jge 0x45850b
push 0x10
push str.MESSAGE
push str._ERR:I003_CheckDeviceFormat_:_D3DFMT_X8R8G8B8_FAILED
push 0
mov ecx, dword [ebp - 0x148]
call fcn.00458f60
push 0
call fcn.004a1801
jmp 0x4585a7
push 0x4b
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 8]
push eax
push 1
push 0
mov ecx, dword [ebp - 0x148]
mov edx, dword [ecx + 4]
mov eax, dword [ebp - 0x148]
mov ecx, dword [eax + 4]
mov edx, dword [edx]
push ecx
mov eax, dword [edx + 0x30]
call eax
test eax, eax
jl 0x458549
mov ecx, dword [ebp - 0x148]
mov dword [ecx + 0x198], 0x4b
jmp 0x4585a7
push 0x4b
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 8]
push eax
push 2
push 0
mov ecx, dword [ebp - 0x148]
mov edx, dword [ecx + 4]
mov eax, dword [ebp - 0x148]
mov ecx, dword [eax + 4]
mov edx, dword [edx]
push ecx
mov eax, dword [edx + 0x30]
call eax
test eax, eax
jl 0x458587
mov ecx, dword [ebp - 0x148]
mov dword [ecx + 0x198], 0x4b
jmp 0x4585a7
push 0x10
push 0x4c5c80
push str._ERR:I005_CheckDepthStencilMatch_:_HALREF_D24S8_FAILED_
push 0
mov ecx, dword [ebp - 0x148]
call fcn.00458f60
push 0
call fcn.004a1801
mov edx, dword [ebp - 0x148]
add edx, 8
push edx
mov eax, dword [ebp - 0x148]
add eax, 0x170
push eax
push 0x44
mov ecx, dword [ebp + 8]
push ecx
push 1
push 0
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 4]
mov ecx, dword [ebp - 0x148]
mov edx, dword [ecx + 4]
mov eax, dword [eax]
push edx
mov ecx, dword [eax + 0x40]
call ecx
test eax, eax
jge 0x4586f2
mov edx, dword [ebp - 0x148]
add edx, 8
push edx
mov eax, dword [ebp - 0x148]
add eax, 0x170
push eax
push 0x24
mov ecx, dword [ebp + 8]
push ecx
push 1
push 0
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 4]
mov ecx, dword [ebp - 0x148]
mov edx, dword [ecx + 4]
mov eax, dword [eax]
push edx
mov ecx, dword [eax + 0x40]
call ecx
test eax, eax
jge 0x4586d8
mov edx, dword [ebp - 0x148]
add edx, 8
push edx
mov eax, dword [ebp - 0x148]
add eax, 0x170
push eax
push 0x24
mov ecx, dword [ebp + 8]
push ecx
push 2
push 0
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 4]
mov ecx, dword [ebp - 0x148]
mov edx, dword [ecx + 4]
mov eax, dword [eax]
push edx
mov ecx, dword [eax + 0x40]
call ecx
test eax, eax
jge 0x4586be
push 0x10
push str.SDX_MESSAGE
push str._ERR:I004_CreateDevice_FAILED_
push 0
mov ecx, dword [ebp - 0x148]
call fcn.00458f60
mov edx, dword [ebp - 0x148]
cmp dword [edx + 4], 0
je 0x4586b5
mov eax, dword [ebp - 0x148]
mov ecx, dword [eax + 4]
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 4]
mov ecx, dword [ecx]
push eax
mov edx, dword [ecx + 8]
call edx
mov eax, dword [ebp - 0x148]
mov dword [eax + 4], 0
xor eax, eax
jmp 0x458752
push str.DEVICE_MODE:__REF
mov ecx, dword [ebp - 0x148]
add ecx, 0x109
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x4586f0
push str.DEVICE_MODE:__SOFTWARE_HAL
mov edx, dword [ebp - 0x148]
add edx, 0x109
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x458709
push str.DEVICE_MODE:__HAL
mov eax, dword [ebp - 0x148]
add eax, 0x109
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
xor ecx, ecx
mov dword [ebp - 0x158], ecx
mov dword [ebp - 0x154], ecx
mov dword [ebp - 0x150], ecx
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 8]
mov dword [ebp - 0x158], eax
lea ecx, [ebp - 0x158]
push ecx
call dword [sym.imp.emotedriver.dll_class_IEmoteDevice____cdecl_EmoteCreate_struct_IEmoteDevice::InitParam_const__]
add esp, 4
mov edx, dword [ebp - 0x148]
mov dword [edx + 0xc], eax
mov ecx, dword [ebp - 0x148]
call fcn.004587c0
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0049d708
mov esp, ebp
pop ebp
ret 0x10