Function at 0x405c80
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
xor esi, esi
push ebx
sub esp, 0x6c
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x10]
mov edi, dword [eax - 0xc]
test edi, edi
jne 0x406084
mov dword [esp], 7
call sym._GetSystemMetrics_4
sub esp, 4
mov edi, eax
mov dword [esp], 8
call sym._GetSystemMetrics_4
mov edx, dword [ebx + 0x10]
add esi, dword [ebx + 4]
lea esi, [esi + eax*2]
mov eax, dword [ebx]
sub esp, 4
cmp dword [edx - 0xc], 1
mov dword [esp + 0x2c], 0
mov dword [esp + 0x24], 0
lea ecx, [eax + edi*2]
mov edi, dword [0x49e100]
sbb eax, eax
mov dword [esp + 0x20], 0
and eax, 0x7f760000
mov dword [esp + 0x1c], esi
add eax, 0xca0000
mov dword [esp + 0x18], ecx
mov dword [esp + 0x28], edi
mov ecx, dword [ebx + 0xc]
mov dword [esp + 0x14], ecx
mov ecx, dword [ebx + 8]
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
mov dword [esp + 4], str.BGILibrary
mov dword [esp + 0x10], ecx
mov dword [esp], 0
call sym._CreateWindowExA_48
sub esp, 0x30
test eax, eax
mov dword [ebp - 0x40], eax
je 0x4060b3
mov esi, dword [ebp - 0x40]
mov dword [esp + 4], 0
mov dword [esp], esi
call sym._GetSystemMenu_8
sub esp, 8
mov edi, eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x800
mov dword [esp], eax
call sym._AppendMenuA_16
sub esp, 0x10
mov dword [esp], edi
mov dword [esp + 0xc], str.Save_image_as...
mov dword [esp + 8], 4
mov dword [esp + 4], 0
call sym._AppendMenuA_16
sub esp, 0x10
mov dword [esp], edi
mov dword [esp + 0xc], str.Print_2__wide...
mov dword [esp + 8], 1
mov dword [esp + 4], 0
call sym._AppendMenuA_16
sub esp, 0x10
mov dword [esp], edi
mov dword [esp + 0xc], str.Print_4.5__wide...
mov dword [esp + 8], 2
mov dword [esp + 4], 0
call sym._AppendMenuA_16
sub esp, 0x10
mov dword [esp], edi
mov dword [esp + 0xc], str.Print_7__wide...
mov dword [esp + 8], 3
mov dword [esp + 4], 0
call sym._AppendMenuA_16
sub esp, 0x10
mov dword [esp], edi
lea edi, [ebx + 0x2d4]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x800
call sym._AppendMenuA_16
mov dword [ebx + 0x98], esi
sub esp, 0x10
mov dword [esp + 8], ebx
mov dword [esp + 4], 0xffffffeb
mov dword [esp], esi
call sym._SetWindowLongA_12
mov edx, 0x2c
mov dword [ebx + 0xc0], 0
mov dword [ebx + 0xbc], 0
sub esp, 0xc
test edi, 1
jne 0x4060cb
test edi, 2
jne 0x4060df
mov ecx, edx
xor eax, eax
shr ecx, 2
test dl, 2
rep stosd dword es:[edi], eax
jne 0x406070
and edx, 1
jne 0x406064
lea eax, [ebx + 0x2c8]
mov esi, ebx
mov dword [ebp - 0x44], eax
xor eax, eax
mov word [ebx + 0x2d0], ax
mov eax, dword [ebp - 0x40]
mov dword [ebx + 0x2c8], 0
mov dword [ebx + 0x2cc], 0
mov byte [ebx + 0x2d2], 0
mov dword [esp], eax
call sym._GetDC_4
sub esp, 4
mov edi, eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sym._CreateMutexA_12
sub esp, 0xc
mov dword [ebx + 0x304], eax
mov dword [esp + 4], 0x1388
mov dword [esp], eax
call sym._WaitForSingleObject_8
lea eax, [ebx + 0x10]
mov dword [ebp - 0x3c], eax
sub esp, 8
mov dword [esp], edi
add esi, 4
call sym._CreateCompatibleDC_4
mov dword [esi + 0x98], eax
mov eax, dword [ebx + 4]
sub esp, 4
mov dword [esp + 8], eax
mov eax, dword [ebx]
mov dword [esp], edi
mov dword [esp + 4], eax
call sym._CreateCompatibleBitmap_12
sub esp, 0xc
mov dword [esp + 4], eax
mov eax, dword [esi + 0x98]
mov dword [esp], eax
call sym._SelectObject_8
mov dword [esi + 0xa8], eax
sub esp, 8
cmp esi, dword [ebp - 0x3c]
jne 0x405f12
mov eax, dword [ebx + 0x304]
lea esi, [ebp - 0x34]
mov dword [esp], eax
call sym._ReleaseMutex_4
sub esp, 4
mov dword [esp + 4], edi
mov edi, dword [ebp - 0x40]
mov dword [esp], edi
call sym._ReleaseDC_8
sub esp, 8
mov dword [esp + 4], 1
mov dword [esp], edi
call sym._ShowWindow_8
sub esp, 8
mov dword [esp], edi
call sym._UpdateWindow_4
mov eax, dword [ebx + 0xd4]
sub esp, 4
mov dword [esp], eax
call sym._SetEvent_4
sub esp, 4
jmp 0x405fcb
mov dword [esp], esi
call sym._TranslateMessage_4
sub esp, 4
mov dword [esp], esi
call sym._DispatchMessageA_4
sub esp, 4
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], esi
call sym._GetMessageA_16
sub esp, 0x10
test eax, eax
jne 0x405fb5
mov edi, dword [ebp - 0x44]
lea esi, [ebx + 0x110]
nop
lea esi, [esi]
sub edi, 0x28
mov ecx, edi
call method.std::_Deque_base_tagPOINTS__std::allocator_tagPOINTS___._Deque_base__
cmp esi, edi
jne 0x406000
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x40603e
mov edx, dword [ebx + 0x38]
mov esi, dword [ebx + 0x28]
lea edi, [edx + 4]
cmp edi, esi
jbe 0x406036
mov eax, dword [esi]
add esi, 4
mov dword [esp], eax
call sym.operator_delete_void_
cmp edi, esi
ja 0x406022
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call sym.operator_delete_void_
mov eax, dword [ebx + 0x10]
mov edx, 0xffffffff
lock xadd dword [eax - 4], edx
test edx, edx
jle 0x4060a0
mov dword [esp], ebx
call sym.operator_delete_void_
mov eax, dword [ebp - 0x2c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 4
mov byte [edi], 0
jmp 0x405e95
xor ecx, ecx
add edi, 2
mov word [edi - 2], cx
and edx, 1
je 0x405e95
jmp 0x406064
mov dword [esp], 4
call sym._GetSystemMetrics_4
sub esp, 4
mov esi, eax
jmp 0x405c9c
lea ecx, [eax - 0xc]
lea eax, [ebp - 0x35]
mov dword [esp], eax
call method.std::string::_Rep._M_destroy_std::allocator_char__const_
sub esp, 4
jmp 0x40604f
mov dword [esp], 0
call sym._showerrorbox
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret 4
mov byte [ebx + 0x2d4], 0
lea edi, [ebx + 0x2d5]
mov dl, 0x2b
jmp 0x405e6e
xor esi, esi
add edi, 2
mov word [edi - 2], si
sub edx, 2
jmp 0x405e7a