Function at 0x5d7f80
Capabilities:
Encrypt data using rc4 ksa
Print debug messages

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x7970ee
mov eax, dword fs:[0]
push eax
sub esp, 0x150
push ebx
push esi
push edi
mov eax, dword [0x867e6c]
xor eax, esp
push eax
lea eax, [esp + 0x160]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [esp + 0x1c], ebx
lea eax, [ebx + 0xc38]
push eax
mov dword [esp + 0x1c], eax
call dword [sym.imp.ntdll.dll_RtlEnterCriticalSection]
xor edi, edi
mov dword [esp + 0x168], edi
mov esi, ebx
mov byte [ebx + 0xcf0], 0
call fcn.005d9a10
mov ecx, dword [ebx + 0xd98]
cmp ecx, edi
je 0x5d7ff6
mov eax, dword [ecx]
mov edx, dword [eax + 0x120]
push 1
call edx
push 0x13
mov esi, 0xf
push str.compat_D3DInterface
lea ecx, [esp + 0x34]
mov dword [ebx + 0xd98], edi
mov dword [ebx + 0xc5c], edi
mov dword [esp + 0x4c], esi
mov dword [esp + 0x48], edi
mov byte [esp + 0x38], 0
call fcn.004016e0
lea eax, [esp + 0x2c]
mov byte [esp + 0x168], 1
mov ecx, dword [0x88b148]
push eax
push ecx
xor edi, edi
call fcn.0046a510
mov byte [esp + 0x168], 0
cmp dword [esp + 0x44], 0x10
jb 0x5d805b
mov edx, dword [esp + 0x30]
push edx
call fcn.006441c7
add esp, 4
mov eax, dword [0x88b618]
mov dword [esp + 0x44], esi
mov dword [esp + 0x40], edi
mov byte [esp + 0x30], 0
push 0
test eax, eax
je 0x5d8116
push 0x828374
lea esi, [ebx + 0xc70]
push esi
push 0
call eax
mov edi, dword [esp + 0x1c]
push eax
mov ebx, str.DirectDrawCreateEx
call fcn.005d7860
test al, al
je 0x5d80c2
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 2
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [esi]
mov edx, dword [eax]
lea ecx, [edi + 0xc6c]
push ecx
push 0x828364
push eax
mov eax, dword [edx]
mov dword [esp + 0x20], ecx
call eax
push eax
mov ebx, str.QueryrInterface_IID_IDirectDraw
mov dword [esp + 0x24], eax
call fcn.005d7860
test al, al
je 0x5d812f
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 2
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lea eax, [ebx + 0xc6c]
push eax
push 0
mov dword [esp + 0x20], eax
call dword [0x88b614]
mov dword [esp + 0x20], eax
jmp 0x5d8131
mov ebx, edi
mov eax, dword [ebx + 0xc50]
mov edx, dword [ebp + 8]
mov esi, dword [sym.imp.user32.dll_GetSystemMetrics]
mov dword [ebx + 0xcf4], edx
mov ecx, dword [eax + 0xe8]
mov dword [ebx + 0xc90], ecx
mov edx, dword [eax + 0xec]
mov cl, byte [ebp + 0xc]
mov dword [ebx + 0xc94], edx
mov eax, dword [eax + 0xf0]
push 0
mov dword [ebx + 0xce0], eax
mov byte [ebx + 0xcf8], cl
call esi
push 1
mov dword [ebx + 0xca0], eax
call esi
mov edx, dword [ebx + 0xca0]
lea esi, [ebx + 0xca8]
push edx
mov dword [ebx + 0xca4], eax
push esi
mov ebx, eax
mov dword [esp + 0x34], esi
call fcn.004972f0
mov edi, dword [esp + 0x1c]
mov ecx, dword [edi + 0xc50]
mov edx, dword [ecx + 0x72c]
mov eax, dword [esi]
mov ebx, dword [esi + 4]
imul eax, edx
cdq
idiv ebx
mov edx, dword [ecx + 0x728]
cmp eax, edx
jl 0x5d81d5
mov eax, edx
imul eax, ebx
cdq
idiv dword [ecx + 0x72c]
cmp dword [esi], eax
jge 0x5d81e6
mov eax, dword [ecx + 0x728]
mov dword [esi], eax
mov edx, dword [ecx + 0x72c]
mov dword [esi + 4], edx
mov edx, dword [ecx + 0x734]
mov eax, dword [esi]
mov ebx, dword [esi + 4]
imul eax, edx
cdq
idiv ebx
mov edx, dword [ecx + 0x730]
cmp eax, edx
jg 0x5d8211
mov eax, edx
imul eax, ebx
cdq
idiv dword [ecx + 0x734]
cmp dword [esi], eax
jle 0x5d8222
mov eax, dword [ecx + 0x730]
mov dword [esi], eax
mov ecx, dword [ecx + 0x734]
mov dword [esi + 4], ecx
mov edx, dword [ebp + 8]
push edx
mov esi, edi
call fcn.005d7c30
test al, al
je 0x5d8250
mov eax, dword [edi + 0xc60]
cmp byte [eax + 0xba], 0
je 0x5d8250
mov ecx, dword [edi + 0xc50]
mov edx, dword [ecx]
mov eax, dword [edx + 0x150]
call eax
mov esi, dword [ebp + 8]
lea ecx, [esp + 0x4c]
push ecx
push esi
call dword [sym.imp.user32.dll_GetClientRect]
mov eax, dword [edi + 0xc50]
mov dword [edi + 0xcf4], esi
mov edx, dword [eax + 0xe8]
mov ecx, edx
mov dword [edi + 0xc90], edx
mov eax, dword [eax + 0xec]
lea esi, [edi + 0xc98]
push ecx
push esi
mov ebx, eax
mov dword [edi + 0xc94], eax
mov dword [esp + 0x50], esi
call fcn.004972f0
mov ebx, dword [sym.imp.user32.dll_GetSystemMetrics]
push 0
call ebx
push 1
mov dword [edi + 0xca0], eax
call ebx
mov edx, dword [edi + 0xca0]
mov ecx, dword [esp + 0x2c]
push edx
push ecx
mov ebx, eax
mov dword [edi + 0xca4], eax
call fcn.004972f0
mov ecx, dword [edi + 0xc50]
mov ebx, dword [esp + 0x2c]
mov edx, dword [ecx + 0x72c]
mov eax, dword [ebx]
mov ebx, dword [ebx + 4]
imul eax, edx
cdq
idiv ebx
mov edx, dword [ecx + 0x728]
cmp eax, edx
jl 0x5d8300
mov eax, edx
imul eax, ebx
cdq
idiv dword [ecx + 0x72c]
mov edx, dword [esp + 0x2c]
cmp dword [edx], eax
jge 0x5d8315
jmp 0x5d8304
mov edx, dword [esp + 0x2c]
mov eax, dword [ecx + 0x728]
mov dword [edx], eax
mov eax, dword [ecx + 0x72c]
mov dword [edx + 4], eax
mov eax, dword [edx]
imul eax, dword [ecx + 0x734]
mov ebx, dword [edx + 4]
cdq
idiv ebx
mov edx, dword [ecx + 0x730]
cmp eax, edx
jg 0x5d8344
mov eax, edx
imul eax, ebx
cdq
idiv dword [ecx + 0x734]
mov edx, dword [esp + 0x2c]
cmp dword [edx], eax
jle 0x5d8359
jmp 0x5d8348
mov edx, dword [esp + 0x2c]
mov eax, dword [ecx + 0x730]
mov dword [edx], eax
mov eax, dword [ecx + 0x734]
mov dword [edx + 4], eax
mov edx, dword [edi + 0xc94]
mov ebx, dword [esi]
mov eax, dword [edi + 0xc90]
mov dword [edi + 0xcb8], edx
mov dword [edi + 0xcbc], ebx
mov ebx, dword [esi + 4]
mov dword [edi + 0xcc0], ebx
lea edx, [edi + 0xcbc]
xor ebx, ebx
mov dword [edi + 0xcd0], ebx
mov dword [edi + 0xcd4], ebx
mov dword [edi + 0xcd8], eax
mov dword [edi + 0xcb4], eax
mov dword [esp + 0x28], edx
mov edx, dword [edi + 0xc94]
mov dword [edi + 0xcdc], edx
mov dword [ecx + 0x70c], ebx
mov dword [ecx + 0x710], ebx
mov dword [ecx + 0x714], eax
mov dword [ecx + 0x718], edx
mov eax, dword [edi + 0xc50]
mov ecx, dword [eax + 0xf0]
mov eax, dword [edi + 0xc9c]
mov dl, byte [ebp + 0xc]
push eax
mov eax, dword [edi + 0xc90]
mov dword [edi + 0xce0], ecx
mov ecx, dword [esi]
push ecx
mov byte [edi + 0xcf8], dl
mov edx, dword [edi + 0xc94]
push edx
push eax
push str.Application_requests__4lu_x__4lu___2d:_2d__n
mov byte [edi + 0xd44], bl
call fcn.00439b10
mov ecx, dword [esp + 0x34]
add esp, 0x14
push ecx
mov ebx, 0x8283b4
call fcn.005d7860
test al, al
je 0x5d8445
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 2
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp byte [ebp + 0xc], 0
je 0x5d86eb
mov eax, dword [edi + 0xc50]
mov ecx, dword [eax + 0x724]
mov edx, dword [eax + 0x720]
push ecx
push edx
push str.Hack_aspect_is_____________________2d:_2d__n
call fcn.00439b10
mov eax, dword [edi + 0xc50]
mov edx, dword [eax + 0x724]
mov ecx, dword [eax + 0x720]
lea ebx, [eax + 0x720]
mov dword [esp + 0x3c], edx
add eax, 0x728
add esp, 0xc
lea edx, [esp + 0x2c]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x20], eax
call fcn.005d73a0
test al, al
je 0x5d84b7
mov eax, dword [esp + 0x20]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], edx
mov eax, dword [edi + 0xc50]
add eax, 0x730
lea edx, [esp + 0x2c]
mov dword [esp + 0x20], eax
call fcn.005d73e0
test al, al
je 0x5d84e4
mov eax, dword [esp + 0x20]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], edx
mov eax, dword [edi + 0xc94]
imul eax, dword [esp + 0x2c]
mov ecx, dword [edi + 0xc50]
cdq
idiv dword [esp + 0x30]
cmp byte [ecx + 0x71c], 0
je 0x5d86bb
cmp eax, dword [edi + 0xc90]
je 0x5d86bb
mov byte [edi + 0xcb0], 1
mov eax, dword [ebx]
imul eax, dword [edi + 0xc94]
cdq
idiv dword [ebx + 4]
mov dword [edi + 0xcb4], eax
mov eax, dword [edi + 0xc94]
mov dword [edi + 0xcb8], eax
mov ecx, dword [ebx]
mov eax, dword [esp + 0x28]
mov dword [eax], ecx
mov edx, dword [ebx + 4]
mov dword [eax + 4], edx
mov eax, ebx
lea ecx, [esp + 0x2c]
call fcn.005d7370
test al, al
je 0x5d8635
mov ebx, dword [ebp + 8]
lea eax, [esp + 0xec]
push eax
push ebx
call dword [sym.imp.user32.dll_GetWindowInfo]
lea ecx, [esp + 0x2c]
push ecx
push ebx
call dword [sym.imp.user32.dll_GetClientRect]
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x20]
push ecx
push ebx
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], eax
call dword [sym.imp.user32.dll_ClientToScreen]
mov ebx, dword [edi + 0xcb4]
mov ecx, dword [esp + 0x20]
mov eax, ebx
sub eax, dword [edi + 0xc90]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [edi + 0xcb8]
sub eax, dword [edi + 0xc94]
add ebx, ecx
cdq
sub eax, edx
mov edx, eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x2c], ecx
mov ecx, dword [edi + 0xcb8]
sar edx, 1
sub eax, edx
add ecx, eax
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x114]
push eax
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x114]
push 0
push ecx
lea edx, [esp + 0x38]
push edx
mov dword [esp + 0x44], ebx
call dword [sym.imp.user32.dll_AdjustWindowRectEx]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x34]
sub ecx, eax
push 0
push ecx
mov ecx, dword [esp + 0x34]
sub edx, ecx
push edx
xor edx, edx
test eax, eax
setl dl
dec edx
and edx, eax
xor eax, eax
test ecx, ecx
setl al
push edx
dec eax
and eax, ecx
mov ecx, dword [ebp + 8]
push eax
push ecx
call dword [sym.imp.user32.dll_MoveWindow]
mov edx, dword [edi + 0xc50]
cmp byte [edx + 0x708], 0
je 0x5d8686
mov edx, dword [esp + 0x28]
mov ebx, dword [edx]
mov eax, dword [edi + 0xcb4]
mov ecx, dword [edi + 0xcb8]
mov edx, dword [edx + 4]
mov dword [esi], ebx
xor ebx, ebx
mov dword [edi + 0xc90], eax
mov dword [edi + 0xc94], ecx
mov dword [esi + 4], edx
mov dword [edi + 0xcd8], eax
mov dword [edi + 0xcdc], ecx
mov dword [edi + 0xcd0], ebx
mov dword [edi + 0xcd4], ebx
jmp 0x5d86bd
mov eax, dword [edi + 0xc94]
mov ecx, dword [edi + 0xc90]
mov dword [edi + 0xcdc], eax
mov eax, dword [edi + 0xcb4]
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
xor ebx, ebx
mov dword [edi + 0xcd8], ecx
mov dword [edi + 0xcd0], eax
mov dword [edi + 0xcd4], ebx
jmp 0x5d86bd
xor ebx, ebx
mov ecx, dword [edi + 0xcc0]
mov edx, dword [esp + 0x28]
mov eax, dword [edx]
mov edx, dword [edi + 0xcb4]
push ecx
mov ecx, dword [edi + 0xcb8]
push eax
push ecx
push edx
push str.Window_is_____________4lu_x__4lu___2d:_2d__n
call fcn.00439b10
add esp, 0x14
jmp 0x5d883e
mov eax, dword [edi + 0xcac]
mov ebx, dword [esp + 0x2c]
mov ecx, dword [ebx]
mov edx, dword [edi + 0xca4]
push eax
mov eax, dword [edi + 0xca0]
push ecx
push edx
push eax
push str.Desktop_is____________4lu_x__4lu___2d:_2d__n
call fcn.00439b10
add esp, 0x14
cmp byte [edi + 0xc64], 0
je 0x5d8813
mov eax, ebx
mov ecx, esi
call fcn.005d7370
test al, al
jne 0x5d874e
mov ecx, dword [edi + 0xcb4]
cmp ecx, dword [edi + 0xca0]
jne 0x5d874e
mov edx, dword [edi + 0xcb8]
cmp edx, dword [edi + 0xca4]
je 0x5d8813
mov eax, dword [esp + 0x2c]
mov edx, dword [eax]
mov eax, dword [esp + 0x28]
mov ecx, dword [edi + 0xca0]
mov ebx, dword [edi + 0xca4]
mov dword [eax], edx
mov edx, dword [esp + 0x2c]
mov edx, dword [edx + 4]
mov dword [eax + 4], edx
mov eax, dword [edi + 0xc50]
mov byte [edi + 0xcb0], 1
mov dword [edi + 0xcb4], ecx
mov dword [edi + 0xcb8], ebx
cmp byte [eax + 0x708], 0
je 0x5d87da
mov edx, dword [esp + 0x28]
mov eax, esi
call fcn.005d73e0
test al, al
mov eax, dword [esp + 0x28]
jne 0x5d87a7
mov eax, esi
mov ecx, dword [eax]
mov dword [esi], ecx
mov edx, dword [eax + 4]
mov eax, dword [edi + 0xc94]
imul eax, ecx
mov dword [esi + 4], edx
cdq
idiv dword [esi + 4]
mov dword [edi + 0xc90], eax
mov eax, dword [edi + 0xca0]
mov dword [edi + 0xcd8], eax
xor eax, eax
mov dword [edi + 0xcd4], eax
jmp 0x5d8807
mov eax, dword [edi + 0xc90]
imul eax, ebx
cdq
idiv dword [edi + 0xc94]
mov dword [edi + 0xcd4], 0
mov dword [edi + 0xcd8], eax
mov eax, ecx
sub eax, dword [edi + 0xcd8]
cdq
sub eax, edx
sar eax, 1
mov dword [edi + 0xcd0], eax
mov dword [edi + 0xcdc], ebx
mov eax, dword [edi + 0xcc0]
mov ecx, dword [esp + 0x28]
mov edx, dword [ecx]
mov ecx, dword [edi + 0xcb4]
push eax
mov eax, dword [edi + 0xcb8]
push edx
push eax
push ecx
push str.Display_is____________4lu_x__4lu___2d:_2d__n
call fcn.00439b10
add esp, 0x14
xor ebx, ebx
cmp byte [edi + 0xc64], 0
mov byte [edi + 0xc66], 0
mov byte [edi + 0xc67], 0
mov byte [edi + 0xc68], 0
je 0x5d8aa5
cmp byte [edi + 0xc65], 0
mov dword [edi + 0xd98], ebx
mov dword [edi + 0xc5c], ebx
je 0x5d88f3
mov dword [esp + 0x20], ebx
call fcn.005e0d60
push ebx
push ebx
lea ecx, [esp + 0x28]
mov dword [edi + 0xd98], eax
mov dword [edi + 0xc5c], eax
mov edx, dword [eax]
mov edx, dword [edx + 0x124]
push ecx
push edi
mov ecx, eax
call edx
test al, al
jne 0x5d88f3
mov ecx, dword [edi + 0xd98]
cmp ecx, ebx
je 0x5d88b8
mov eax, dword [ecx]
mov edx, dword [eax + 0x120]
push 1
call edx
mov eax, dword [esp + 0x20]
mov dword [edi + 0xd98], ebx
mov dword [edi + 0xc5c], ebx
cmp eax, ebx
je 0x5d88f3
mov esi, eax
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, esi
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp dword [edi + 0xd98], ebx
jne 0x5d8956
mov dword [esp + 0x20], ebx
call fcn.005dc860
push ebx
push ebx
lea ecx, [esp + 0x28]
mov dword [edi + 0xd98], eax
mov dword [edi + 0xc5c], eax
mov edx, dword [eax]
mov edx, dword [edx + 0x124]
push ecx
push edi
mov ecx, eax
call edx
test al, al
jne 0x5d8956
mov ecx, dword [edi + 0xd98]
cmp ecx, ebx
je 0x5d893e
mov eax, dword [ecx]
mov edx, dword [eax + 0x120]
push 1
call edx
mov eax, dword [esp + 0x20]
mov dword [edi + 0xd98], ebx
mov dword [edi + 0xc5c], ebx
cmp eax, ebx
jne 0x5d88cc
mov ecx, dword [edi + 0xd98]
cmp ecx, ebx
je 0x5d9597
cmp byte [ebp + 0xc], 0
jne 0x5d8a53
mov edx, dword [ecx]
mov edx, dword [edx + 0x6c]
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x24]
push eax
call edx
mov eax, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
cmp eax, dword [edi + 0xcb4]
jne 0x5d899b
cmp ebx, dword [edi + 0xcb8]
je 0x5d8a53
push eax
mov dword [edi + 0xcb4], eax
mov eax, dword [esp + 0x2c]
push eax
mov dword [edi + 0xcb8], ebx
call fcn.004972f0
mov ecx, dword [edi + 0xc50]
xor ebx, ebx
cmp byte [ecx + 0x708], bl
je 0x5d8a14
mov edx, dword [esp + 0x28]
mov eax, esi
call fcn.005d73e0
test al, al
mov eax, dword [esp + 0x28]
jne 0x5d89d7
mov eax, esi
mov edx, dword [eax]
mov dword [esi], edx
mov eax, dword [eax + 4]
mov dword [esi + 4], eax
mov eax, dword [edi + 0xc94]
imul eax, edx
cdq
idiv dword [esi + 4]
mov ecx, dword [edi + 0xcb4]
mov edx, dword [edi + 0xcb8]
mov dword [edi + 0xcd8], ecx
mov dword [edi + 0xcdc], edx
mov dword [edi + 0xcd0], ebx
mov dword [edi + 0xc90], eax
jmp 0x5d8a4d
mov ecx, dword [edi + 0xcb8]
mov eax, dword [edi + 0xc90]
imul eax, ecx
cdq
idiv dword [edi + 0xc94]
mov dword [edi + 0xcdc], ecx
mov dword [edi + 0xcd8], eax
mov eax, dword [edi + 0xcb4]
sub eax, dword [edi + 0xcd8]
cdq
sub eax, edx
sar eax, 1
mov dword [edi + 0xcd0], eax
mov dword [edi + 0xcd4], ebx
mov esi, dword [esp + 0x14]
mov eax, dword [esi]
test eax, eax
je 0x5d8a7e
mov edx, dword [edi + 0xcf4]
mov ecx, dword [eax]
push 8
push edx
push eax
mov eax, dword [ecx + 0x50]
call eax
mov eax, dword [esi]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov dword [esi], 0
mov eax, dword [edi + 0xc70]
test eax, eax
je 0x5d8a9a
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov dword [edi + 0xc70], 0
mov byte [edi + 0xcf0], 1
xor ebx, ebx
jmp 0x5d8aa9
mov esi, dword [esp + 0x14]
cmp byte [edi + 0xc68], 0
jne 0x5d8ff2
cmp byte [ebp + 0xc], 0
mov eax, dword [esi]
mov edx, dword [ebp + 8]
mov ecx, dword [eax]
je 0x5d8ce2
push 8
push edx
push eax
mov eax, dword [ecx + 0x50]
call eax
push 0x7c
lea ecx, [esp + 0x60]
push ebx
push ecx
call fcn.0064edd0
add esp, 0xc
cmp byte [edi + 0xc64], 0
mov eax, 1
mov dword [esp + 0x5c], 0x7c
mov dword [esp + 0x60], eax
mov dword [esp + 0xc4], 0x200
je 0x5d8b10
mov dword [esp + 0xc4], 0x2200
lea esi, [edi + 0xc74]
push esi
lea edx, [esp + 0x60]
mov dword [esp + 0x74], eax
push edx
mov eax, edi
call fcn.005d7940
cmp eax, 0x88760091
jne 0x5d8b56
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 6
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push eax
mov ebx, str.CreateSurface_Windowed_Primary
call fcn.005d7860
test al, al
je 0x5d8b8d
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 3
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0x10
call fcn.006442a0
mov edi, dword [esp + 0x20]
add esp, 4
test eax, eax
je 0x5d8ba8
mov ecx, edi
call fcn.0060b850
jmp 0x5d8baa
xor eax, eax
mov ecx, dword [esi]
mov dword [edi + 0xd58], eax
mov edx, dword [eax]
mov edx, dword [edx + 0x28]
push ecx
mov ecx, eax
call edx
push 0x7c
lea eax, [esp + 0x60]
push 0
push eax
call fcn.0064edd0
add esp, 0xc
cmp byte [edi + 0xc64], 0
mov dword [esp + 0x5c], 0x7c
mov dword [esp + 0x60], 7
mov dword [esp + 0xc4], 0x840
je 0x5d8bfc
mov dword [esp + 0xc4], 0x6040
mov ecx, dword [edi + 0xc90]
mov edx, dword [edi + 0xc94]
lea eax, [edi + 0xc7c]
mov dword [esp + 0x68], ecx
push eax
lea ecx, [esp + 0x60]
push ecx
mov eax, edi
mov dword [esp + 0x6c], edx
call fcn.005d7940
push eax
mov ebx, str.CreateSurface_Windowed_DrawSurface
call fcn.005d7860
test al, al
je 0x5d8c5a
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 3
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [esp + 0x14]
mov eax, dword [eax]
mov ecx, dword [eax]
push 0
lea edx, [esp + 0x30]
push edx
push 0
push eax
mov eax, dword [ecx + 0x10]
call eax
push eax
mov ebx, str.CreateClipper_Windowed
call fcn.005d7860
test al, al
je 0x5d8ca8
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 1
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [ebp + 8]
mov eax, dword [esp + 0x2c]
mov edx, dword [eax]
mov edx, dword [edx + 0x20]
push ecx
push 0
push eax
call edx
test eax, eax
jl 0x5d8ccd
mov esi, dword [esi]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esi]
mov edx, dword [eax + 0x70]
push ecx
push esi
call edx
mov eax, dword [esp + 0x2c]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov esi, dword [esp + 0x14]
jmp 0x5d8fbb
push 0x11
push edx
push eax
mov eax, dword [ecx + 0x50]
call eax
push eax
mov ebx, str.SetCooperativeLevel_FullScreen
call fcn.005d7860
test al, al
je 0x5d8d22
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 4
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edi, dword [esp + 0x1c]
mov ecx, dword [edi + 0xce0]
mov eax, dword [esi]
mov edx, dword [eax]
mov edx, dword [edx + 0x54]
push ecx
mov ecx, dword [edi + 0xcb8]
push ecx
mov ecx, dword [edi + 0xcb4]
push ecx
push eax
call edx
push eax
mov ebx, str.SetDisplayMode_FullScreen
call fcn.005d7860
test al, al
je 0x5d8d7c
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 5
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0x7c
lea ecx, [esp + 0x60]
push 0
push ecx
call fcn.0064edd0
add esp, 0xc
cmp byte [edi + 0xc64], 0
mov dword [esp + 0x5c], 0x7c
mov dword [esp + 0x60], 0x21
mov dword [esp + 0xc4], 0x218
mov dword [esp + 0x70], 1
je 0x5d8dc4
mov dword [esp + 0xc4], 0x2218
lea eax, [edi + 0xc74]
push eax
lea edx, [esp + 0x60]
push edx
mov eax, edi
call fcn.005d7940
push eax
mov ebx, str.CreateSurface_FullScreen_Primary
call fcn.005d7860
test al, al
je 0x5d8e0e
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 3
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [edi + 0xc74]
lea ecx, [edi + 0xc78]
push ecx
lea ecx, [esp + 0x24]
mov dword [esp + 0x24], 4
mov edx, dword [eax]
mov edx, dword [edx + 0x30]
push ecx
push eax
call edx
push eax
mov ebx, str.GetAttachedSurface
call fcn.005d7860
test al, al
jne 0x5d8de6
cmp byte [edi + 0xcb0], al
je 0x5d8e5f
mov ecx, dword [edi + 0xc74]
push ecx
call fcn.005d7ba0
mov edx, dword [edi + 0xc78]
push edx
call fcn.005d7ba0
push 0x7c
lea eax, [esp + 0x60]
push 0
push eax
call fcn.0064edd0
add esp, 0xc
cmp byte [edi + 0xc64], 0
mov dword [esp + 0x5c], 0x7c
mov dword [esp + 0x60], 7
mov dword [esp + 0xc4], 0x840
je 0x5d8e9f
mov dword [esp + 0xc4], 0x6040
mov ecx, dword [edi + 0xc90]
mov edx, dword [edi + 0xc94]
lea eax, [edi + 0xc7c]
mov dword [esp + 0x68], ecx
push eax
lea ecx, [esp + 0x60]
push ecx
mov eax, edi
mov dword [esp + 0x6c], edx
call fcn.005d7940
push eax
mov ebx, str.CreateSurface_FullScreen_DrawSurface
call fcn.005d7860
test al, al
jne 0x5d8c32
mov eax, dword [esi]
mov ecx, dword [eax]
push 0
lea edx, [esp + 0x18]
push edx
push 0
push eax
mov eax, dword [ecx + 0x10]
call eax
push eax
mov ebx, str.CreateClipper_FullScreen
call fcn.005d7860
test al, al
jne 0x5d8c80
mov ecx, dword [ebp + 8]
mov eax, dword [esp + 0x14]
mov edx, dword [eax]
mov edx, dword [edx + 0x20]
push ecx
push 0
push eax
call edx
test eax, eax
jl 0x5d8f28
mov eax, dword [edi + 0xc74]
mov edx, dword [esp + 0x14]
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x70]
call eax
push 0xe4
call fcn.006442a0
add esp, 4
mov dword [esp + 0x2c], eax
mov byte [esp + 0x168], 2
test eax, eax
je 0x5d8f4e
push edi
push eax
call fcn.0047ad80
jmp 0x5d8f50
xor eax, eax
mov byte [esp + 0x168], 0
mov ecx, dword [edi + 0xc78]
mov dword [edi + 0xd00], eax
mov edx, dword [eax]
mov edx, dword [edx + 0x88]
push ecx
mov ecx, eax
call edx
cmp byte [edi + 0xcb0], 0
je 0x5d8f92
mov eax, dword [edi + 0xc74]
push eax
call fcn.005d7ba0
mov ecx, dword [edi + 0xc78]
push ecx
call fcn.005d7ba0
mov eax, dword [esp + 0x14]
mov edx, dword [eax]
push eax
mov eax, dword [edx + 8]
call eax
mov ecx, dword [edi + 0xc50]
cmp byte [ecx + 0x3b0], 0
jne 0x5d8fb7
mov eax, dword [esi]
mov edx, dword [eax]
push eax
mov eax, dword [edx + 0x28]
call eax
mov edi, dword [esp + 0x1c]
mov eax, dword [esi]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x3c]
lea esi, [edi + 0xce4]
push esi
push eax
call edx
test eax, eax
jl 0x5d8fd9
cmp dword [esi], 0x3c
mov edi, dword [esp + 0x1c]
jae 0x5d8ff0
mov eax, dword [edi + 0xc50]
mov edi, dword [esp + 0x1c]
mov byte [eax + 0x6e2], 1
mov dword [esi], 0x3c
xor ebx, ebx
mov edx, dword [edi + 0xcf4]
lea ecx, [esp + 0xdc]
push ecx
push edx
call dword [sym.imp.user32.dll_GetClientRect]
movzx eax, byte [edi + 0xc66]
movzx ecx, byte [edi + 0xc67]
movzx edx, byte [edi + 0xcf8]
push eax
mov eax, dword [esp + 0x5c]
push ecx
mov ecx, dword [esp + 0x5c]
push edx
mov edx, dword [edi + 0xc94]
push eax
mov eax, dword [edi + 0xc90]
push ecx
mov ecx, dword [edi + 0xcf4]
push edx
push eax
push ecx
push str.mHWnd_08X_mW_d_mH_d_WW_d_WH_d_Window_d_D3D8_d_D3D9_d_r_n
lea esi, [esp + 0x50]
call fcn.00439900
add esp, 0x24
cmp dword [eax + 0x18], 0x10
jb 0x5d905a
mov eax, dword [eax + 4]
jmp 0x5d905d
add eax, 4
push eax
call dword [sym.imp.kernel32.dll_OutputDebugStringA]
lea ecx, [esp + 0x2c]
call fcn.004012f0
cmp byte [edi + 0xcf8], 0
jne 0x5d907f
cmp byte [edi + 0xc68], 0
je 0x5d90b0
mov edx, dword [esp + 0xe4]
cmp edx, dword [edi + 0xc90]
jne 0x5d909d
mov eax, dword [esp + 0xe8]
cmp eax, dword [edi + 0xc94]
je 0x5d90b0
mov eax, dword [esp + 0x58]
mov ecx, dword [esp + 0x54]
mov edx, dword [edi]
mov edx, dword [edx + 0x30]
push eax
push ecx
mov ecx, edi
call edx
mov eax, dword [edi + 0xce4]
cmp eax, 0x3c
jae 0x5d90d4
mov eax, dword [edi + 0xc50]
mov byte [eax + 0x6e2], 1
mov dword [edi + 0xce4], 0x3c
jmp 0x5d90f0
cmp eax, 0x64
jbe 0x5d90f0
mov ecx, dword [edi + 0xc50]
mov byte [ecx + 0x6e2], 1
mov dword [edi + 0xce4], 0x64
mov edx, dword [edi + 0xc9c]
mov eax, dword [esp + 0x48]
mov ecx, dword [eax]
mov eax, dword [edi + 0xc90]
push edx
mov edx, dword [edi + 0xc94]
push ecx
push edx
push eax
push str.Draw_buffer_is________4lu_x__4lu___2d:_2d__n
call fcn.00439b10
xor edx, edx
mov eax, 0x3e8
div dword [edi + 0xce4]
add esp, 0x14
push 0x7c
lea ecx, [esp + 0x60]
push ebx
push ecx
mov dword [edi + 0xce8], eax
call fcn.0064edd0
mov edx, dword [edi + 0xd28]
mov eax, dword [edi + 0xd2c]
add esp, 0xc
cmp byte [edi + 0xc68], 0
mov dword [esp + 0x5c], 0x7c
mov dword [esp + 0x60], 7
mov dword [esp + 0xc4], 0x840
mov dword [esp + 0x68], edx
mov dword [esp + 0x64], eax
jne 0x5d928e
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x60]
push edx
mov eax, edi
call fcn.005d7940
push eax
mov ebx, str.CreateSurface_OldCursorArea
call fcn.005d7860
test al, al
jne 0x5d8de6
push 0xe4
call fcn.006442a0
add esp, 4
mov dword [esp + 0x48], eax
mov edi, dword [esp + 0x1c]
mov byte [esp + 0x168], 3
test eax, eax
je 0x5d91c6
push edi
push eax
call fcn.0047ad80
jmp 0x5d91c8
xor eax, eax
mov byte [esp + 0x168], 0
mov ecx, dword [esp + 0x14]
mov dword [edi + 0xd50], eax
mov edx, dword [eax]
mov edx, dword [edx + 0x88]
push ecx
mov ecx, eax
call edx
mov ecx, dword [edi + 0xd50]
mov eax, dword [ecx]
mov edx, dword [eax + 0x44]
push 0
push 0
call edx
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x60]
mov dword [edi + 0xd48], eax
push edx
mov eax, edi
call fcn.005d7940
push eax
mov ebx, str.CreateSurface_NewCursorArea
call fcn.005d7860
test al, al
jne 0x5d8de6
push 0xe4
call fcn.006442a0
add esp, 4
mov dword [esp + 0x48], eax
mov byte [esp + 0x168], 4
test eax, eax
je 0x5d924c
push edi
push eax
call fcn.0047ad80
jmp 0x5d924e
xor eax, eax
mov byte [esp + 0x168], 0
mov ecx, dword [esp + 0x14]
mov dword [edi + 0xd54], eax
mov edx, dword [eax]
mov edx, dword [edx + 0x88]
push ecx
mov ecx, eax
call edx
mov ecx, dword [edi + 0xd54]
mov eax, dword [ecx]
mov edx, dword [eax + 0x44]
push 0
push 0
call edx
mov eax, dword [esp + 0x14]
mov dword [edi + 0xd4c], eax
mov edi, dword [esp + 0x1c]
xor ebx, ebx
mov esi, dword [edi + 0xc74]
cmp esi, ebx
je 0x5d9546
push 0x6c
lea ecx, [esp + 0xf0]
push 0
push ecx
call fcn.0064edd0
add esp, 0xc
lea eax, [esp + 0xec]
mov dword [esp + 0xec], 0x6c
mov dword [esp + 0xf0], 0x1006
mov edx, dword [esi]
mov ecx, dword [edx + 0x58]
push eax
push esi
call ecx
mov eax, dword [esp + 0x140]
cmp eax, 0x10
je 0x5d930f
cmp eax, 0x20
je 0x5d930f
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 6
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ebx, dword [esp + 0x144]
mov esi, dword [esp + 0x14c]
mov dword [edi + 4], eax
mov eax, dword [esp + 0x148]
mov dword [edi + 8], ebx
mov dword [edi + 0xc], eax
mov dword [edi + 0x10], esi
mov ecx, 0x20
mov edx, ebx
shr edx, cl
test dl, 1
je 0x5d9341
mov dword [edi + 0x20], ecx
mov edx, eax
shr edx, cl
test dl, 1
je 0x5d934d
mov dword [edi + 0x24], ecx
mov edx, esi
shr edx, cl
test dl, 1
je 0x5d9359
mov dword [edi + 0x28], ecx
sub ecx, 1
jns 0x5d9335
mov ecx, dword [edi + 0x28]
mov esi, dword [edi + 0x24]
mov edx, dword [edi + 0x20]
mov eax, 1
mov dword [esp + 0x14], ecx
mov dword [esp + 0x20], 0x20
jmp 0x5d9387
mov ebx, dword [esp + 0x144]
cmp edx, 0x20
jge 0x5d9397
mov ecx, edx
shr ebx, cl
test ebx, ebx
je 0x5d9397
mov dword [edi + 0x14], eax
cmp esi, 0x20
jge 0x5d93ae
mov ebx, dword [esp + 0x148]
mov ecx, esi
shr ebx, cl
test ebx, ebx
je 0x5d93ae
mov dword [edi + 0x18], eax
mov ecx, dword [esp + 0x14]
cmp ecx, 0x20
jge 0x5d93c7
mov ebx, dword [esp + 0x14c]
shr ebx, cl
test ebx, ebx
je 0x5d93c7
mov dword [edi + 0x1c], eax
mov ecx, 1
add dword [esp + 0x14], ecx
add edx, ecx
add esi, ecx
add eax, ecx
sub dword [esp + 0x20], ecx
jne 0x5d9380
mov eax, dword [edi + 0x2c]
push eax
call fcn.00644b73
mov eax, dword [edi + 0x30]
add esp, 4
push eax
call fcn.00644b73
mov eax, dword [edi + 0x34]
add esp, 4
push eax
call fcn.00644b73
mov ecx, dword [edi + 0x14]
mov esi, 1
shl esi, cl
mov ecx, dword [edi + 0x18]
mov ebx, 1
shl ebx, cl
mov ecx, dword [edi + 0x1c]
mov eax, 1
shl eax, cl
dec esi
xor ecx, ecx
add esp, 4
dec eax
mov dword [esp + 0x14], eax
lea eax, [esi + esi + 1]
mov dword [esp + 0x20], eax
mov edx, 4
dec ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0063265d
mov dword [edi + 0x2c], eax
xor ecx, ecx
add esp, 4
lea eax, [ebx + ebx + 1]
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0063265d
mov dword [edi + 0x30], eax
mov eax, dword [esp + 0x18]
xor ecx, ecx
lea eax, [eax + eax + 1]
add esp, 4
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0063265d
mov dword [edi + 0x34], eax
xor eax, eax
add esp, 4
cmp dword [esp + 0x20], eax
jle 0x5d94aa
cmp eax, esi
mov ecx, eax
jl 0x5d949d
mov ecx, esi
mov edx, dword [edi + 0x2c]
mov dword [edx + eax*4], ecx
inc eax
cmp eax, dword [esp + 0x20]
jl 0x5d9495
lea edx, [ebx + ebx + 1]
xor eax, eax
test edx, edx
jle 0x5d94c7
cmp eax, ebx
mov ecx, eax
jl 0x5d94bc
mov ecx, ebx
mov esi, dword [edi + 0x30]
mov dword [esi + eax*4], ecx
inc eax
cmp eax, edx
jl 0x5d94b4
mov esi, dword [esp + 0x14]
lea edx, [esi + esi + 1]
xor eax, eax
test edx, edx
jle 0x5d94e8
cmp eax, esi
mov ecx, eax
jl 0x5d94dd
mov ecx, esi
mov ebx, dword [edi + 0x34]
mov dword [ebx + eax*4], ecx
inc eax
cmp eax, edx
jl 0x5d94d5
xor ecx, ecx
lea esi, [edi + 0x438]
mov ebx, dword [edi + 8]
mov edx, ecx
imul edx, ebx
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, ebx
mov dword [esi - 0x400], edx
mov ebx, dword [edi + 0xc]
mov edx, ecx
imul edx, ebx
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, ebx
mov dword [esi], edx
mov ebx, dword [edi + 0x10]
mov edx, ecx
imul edx, ebx
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, ebx
mov dword [esi + 0x400], edx
inc ecx
add esi, 4
cmp ecx, 0x100
jl 0x5d94f0
cmp byte [edi + 0xc64], 0
je 0x5d95c8
cmp byte [edi + 0xc68], 0
jne 0x5d95bf
mov ecx, dword [edi + 0xd98]
mov eax, dword [ecx]
mov edx, dword [eax + 0x124]
push 0
push 0
push 0
push edi
call edx
test al, al
jne 0x5d95bf
push 0xf
add edi, 0xd5c
push str.3D_init_error:
mov ecx, edi
call fcn.004016e0
push 0xffffffffffffffff
push 0
push 0x87c4d0
mov ecx, edi
call fcn.00402720
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov eax, 7
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp byte [edi + 0xc64], 0
jne 0x5d9622
push 0xe4
call fcn.006442a0
add esp, 4
mov dword [esp + 0x48], eax
mov byte [esp + 0x168], 5
test eax, eax
je 0x5d95ee
push edi
push eax
call fcn.0047ad80
jmp 0x5d95f0
xor eax, eax
mov byte [esp + 0x168], 0
mov ecx, dword [edi + 0xc7c]
mov dword [edi + 0xcfc], eax
mov edx, dword [eax]
mov edx, dword [edx + 0x88]
push ecx
mov ecx, eax
call edx
mov ecx, dword [edi + 0xcfc]
mov eax, dword [ecx]
mov edx, dword [eax + 0x44]
push 0
push 0
call edx
inc dword [edi + 0xd24]
mov byte [edi + 0xcf0], 1
mov edi, dword [edi + 0xc50]
cmp dword [edi + 0x834], 0
je 0x5d9652
mov ecx, dword [edi + 0x834]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push 0
push str.DDInterfaceReady
call edx
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
xor eax, eax
mov ecx, dword [esp + 0x160]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8