Function at 0x515ea0
Capabilities:
Inspect load icon resource

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x602788
mov eax, dword fs:[0]
push eax
sub esp, 0x68
push ebx
push esi
push edi
mov eax, dword [0x6a4108]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
push 0x20
call sub.SDL2.dll_SDL_Init
add esp, 4
test eax, eax
js 0x51626c
call fcn.004e47b0
mov dword [edi + 0x2f0], eax
call fcn.004e4790
mov dword [edi + 0x2f4], eax
call fcn.004e4830
mov dword [edi + 0x2f8], eax
call fcn.004e4810
mov dword [edi + 0x2fc], eax
call fcn.004e47f0
test eax, eax
je 0x515ff5
push 0xa
push 1
push 1
push 0
push 0
push 0x65ace0
call sub.SDL2.dll_SDL_CreateWindow
mov ebx, eax
push ebx
call sub.SDL2.dll_SDL_GL_CreateContext
push eax
push ebx
mov dword [ebp - 0x18], eax
call sub.SDL2.dll_SDL_GL_MakeCurrent
add esp, 0x24
lea eax, [ebp - 0x10]
push eax
push 0x8d57
mov dword [ebp - 0x10], 0
call dword [sym.imp.OPENGL32.dll_glGetIntegerv]
mov ecx, dword [ebp - 0x10]
test ecx, ecx
jg 0x515f67
mov dword [0x75adf0], 0
jmp 0x515faf
cmp ecx, 2
jg 0x515f78
mov dword [0x75adf0], 1
jmp 0x515faf
cmp ecx, 4
jg 0x515f89
mov dword [0x75adf0], 2
jmp 0x515faf
cmp ecx, 8
jg 0x515f9a
mov dword [0x75adf0], 3
jmp 0x515faf
mov eax, dword [0x75adf0]
mov edx, 4
cmp ecx, 0x10
cmovge eax, edx
mov dword [0x75adf0], eax
call fcn.004e47f0
mov esi, eax
call fcn.0050e480
cmp esi, eax
jle 0x515fc6
call fcn.0050e480
mov esi, eax
push dword [ebp - 0x18]
call sub.SDL2.dll_SDL_GL_DeleteContext
push ebx
call sub.SDL2.dll_SDL_DestroyWindow
add esp, 8
test esi, esi
je 0x515ff5
push 1
push 0xd
call sub.SDL2.dll_SDL_GL_SetAttribute
push esi
call fcn.005436c0
push eax
push 0xe
call sub.SDL2.dll_SDL_GL_SetAttribute
add esp, 0x14
call fcn.004e4830
sub eax, 0
je 0x51611c
dec eax
je 0x516098
dec eax
jne 0x51619c
lea eax, [ebp - 0x1c]
push eax
call fcn.004e4850
add esp, 4
mov esi, eax
mov dword [ebp - 4], 1
lea eax, [ebp - 0x44]
push 6
push eax
call fcn.0050fe20
mov ecx, dword [eax + 0xc]
add esp, 4
lea eax, [ebp - 0x54]
push ecx
push eax
call fcn.0050fe20
mov eax, dword [eax + 8]
add esp, 4
mov ecx, esi
push eax
push 0x2fff0000
push 0x2fff0000
call fcn.005163b0
push eax
call sub.SDL2.dll_SDL_CreateWindow
add esp, 0x18
mov dword [edi + 0x2d8], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x1c]
call fcn.004f8230
mov eax, dword [edi + 0x2d8]
test eax, eax
je 0x51626c
push 0x1001
push eax
call sub.SDL2.dll_SDL_SetWindowFullscreen
add esp, 8
jmp 0x51619c
lea eax, [ebp - 0x14]
push eax
call fcn.004e4850
add esp, 4
mov esi, eax
mov dword [ebp - 4], 2
lea eax, [ebp - 0x64]
push 6
push eax
call fcn.0050fe20
mov ecx, dword [eax + 0xc]
add esp, 4
lea eax, [ebp - 0x74]
push ecx
push eax
call fcn.0050fe20
mov eax, dword [eax + 8]
add esp, 4
mov ecx, esi
push eax
push 0x2fff0000
push 0x2fff0000
call fcn.005163b0
push eax
call sub.SDL2.dll_SDL_CreateWindow
add esp, 0x18
mov dword [edi + 0x2d8], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.004f8230
mov eax, dword [edi + 0x2d8]
test eax, eax
je 0x51626c
push 1
push eax
call sub.SDL2.dll_SDL_SetWindowFullscreen
add esp, 8
jmp 0x51619c
lea eax, [ebp - 0x24]
push eax
call fcn.004e4850
add esp, 4
mov dword [ebp - 4], 0
push 6
push dword [edi + 0x2f4]
mov ecx, eax
push dword [edi + 0x2f0]
push 0x2fff0000
push 0x2fff0000
call fcn.005163b0
push eax
call sub.SDL2.dll_SDL_CreateWindow
add esp, 0x18
mov dword [edi + 0x2d8], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x24]
call fcn.004f8230
mov eax, dword [edi + 0x2d8]
test eax, eax
je 0x51626c
push 0
push eax
call sub.SDL2.dll_SDL_SetWindowFullscreen
push dword [edi + 0x2f4]
push dword [edi + 0x2f0]
push dword [edi + 0x2d8]
call sub.SDL2.dll_SDL_SetWindowSize
add esp, 0x14
push dword [edi + 0x2d8]
call sub.SDL2.dll_SDL_GL_CreateContext
push eax
push dword [edi + 0x2d8]
mov dword [edi + 0x2dc], eax
call sub.SDL2.dll_SDL_GL_MakeCurrent
add esp, 0xc
call dword [sym.imp.glew32.dll__glewInit_0]
call fcn.004e47f0
test eax, eax
je 0x5161df
call fcn.0050e480
test eax, eax
je 0x5161df
push 0x809d
call dword [sym.imp.OPENGL32.dll_glEnable]
lea eax, [ebp - 0x34]
push eax
push dword [edi + 0x2d8]
mov word [ebp - 0x34], 2
mov byte [ebp - 0x32], 4
call sub.SDL2.dll_SDL_GetWindowWMInfo
add esp, 8
test eax, eax
je 0x51626c
mov eax, dword [ebp - 0x2c]
push 0
push 0
mov dword [edi + 0x2d4], eax
call sub.SDL2.dll_SDL_GL_MakeCurrent
mov esi, dword [sym.imp.USER32.dll_LoadIconW]
add esp, 8
push str.WIN_ICON
push dword [0x75b0cc]
call esi
test eax, eax
jne 0x516241
push 0x65
push dword [0x75b0cc]
call esi
test eax, eax
jne 0x516241
push 0x7f05
push eax
call esi
push eax
push 0
push 0x80
push dword [edi + 0x2d4]
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret