Function at 0x4ffa80
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x65aae5
mov eax, dword fs:[0]
push eax
sub esp, 0x1c0
push ebx
push esi
push edi
mov eax, dword [0x6af168]
xor eax, esp
push eax
lea eax, [esp + 0x1d0]
mov dword fs:[0], eax
mov edi, ecx
lea eax, [edi + 0x3c]
push eax
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esp + 0x1d8], 0
mov esi, edi
mov byte [edi + 0xcdc], 0
call fcn.005013d0
mov eax, dword [0x6b9d78]
test eax, eax
push 0
je 0x4ffb7f
push 0x67f934
lea esi, [edi + 0x5c]
push esi
push 0
call eax
push eax
mov ebx, str.DirectDrawCreateEx
call fcn.004ff620
test al, al
je 0x4ffb2e
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 2
mov ecx, dword [esp + 0x1d0]
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 + 0x58]
push ecx
push 0x67f924
push eax
mov eax, dword [edx]
mov dword [esp + 0x24], ecx
call eax
push eax
mov ebx, str.QueryrInterface_IID_IDirectDraw
mov dword [esp + 0x2c], eax
call fcn.004ff620
test al, al
je 0x4ffb93
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 2
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lea eax, [edi + 0x58]
push eax
push 0
mov dword [esp + 0x24], eax
call dword [0x6b9d74]
mov dword [esp + 0x28], eax
mov ebx, dword [ebp + 8]
push ebx
mov esi, edi
call fcn.004ff9b0
test al, al
je 0x4ffbbb
mov edx, dword [edi + 0x34]
cmp byte [edx + 0xba], 0
je 0x4ffbbb
mov ecx, dword [edi + 0x2c]
mov eax, dword [ecx]
mov edx, dword [eax + 0x168]
call edx
lea eax, [esp + 0x1bc]
push eax
push ebx
call dword [sym.imp.USER32.dll_GetClientRect]
mov eax, dword [edi + 0x2c]
mov dword [edi + 0xce0], ebx
mov ecx, dword [eax + 0xc0]
mov edx, ecx
mov dword [edi + 0x7c], ecx
mov eax, dword [eax + 0xc4]
push edx
lea esi, [edi + 0x84]
push esi
mov ebx, eax
mov dword [edi + 0x80], eax
call fcn.004f19b0
mov ebx, dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0
call ebx
push 1
mov dword [edi + 0x8c], eax
call ebx
mov edx, dword [edi + 0x8c]
lea ecx, [edi + 0x94]
push edx
push ecx
mov ebx, eax
mov dword [edi + 0x90], eax
call fcn.004f19b0
mov eax, dword [edi + 0x80]
mov edx, dword [esi]
mov ecx, dword [edi + 0x7c]
mov dword [edi + 0xa4], eax
mov eax, dword [esi + 4]
mov dword [edi + 0xac], eax
xor eax, eax
mov dword [edi + 0xa8], edx
mov edx, dword [edi + 0x80]
xor ebx, ebx
mov dword [edi + 0xb0], ebx
mov dword [edi + 0xb4], eax
mov eax, dword [edi + 0x2c]
mov dword [edi + 0xb8], ecx
mov dword [edi + 0xa0], ecx
add eax, 0x5dc
mov dword [edi + 0xbc], edx
mov dword [eax], ebx
mov dword [eax + 4], ebx
mov dword [eax + 8], ecx
mov dword [eax + 0xc], edx
mov ecx, dword [edi + 0x2c]
mov edx, dword [ecx + 0xc8]
mov ecx, dword [edi + 0x88]
mov al, byte [ebp + 0xc]
push ecx
mov ecx, dword [edi + 0x7c]
mov dword [edi + 0xc0], edx
mov edx, dword [esi]
push edx
mov byte [edi + 0xce4], al
mov eax, dword [edi + 0x80]
push eax
push ecx
push str.Application_requests__4lu_x__4lu___2d:_2d__n
mov byte [edi + 0xd20], bl
call fcn.004e5fa0
mov edx, dword [esp + 0x3c]
add esp, 0x14
push edx
mov ebx, 0x67f984
call fcn.004ff620
test al, al
jne 0x4ffb06
cmp byte [ebp + 0xc], al
je 0x5000e2
mov eax, dword [edi + 0x2c]
mov ecx, dword [eax + 0x5f4]
mov edx, dword [eax + 0x5f0]
push ecx
push edx
push str.Hack_aspect_is_____________________2d:_2d__n
call fcn.004e5fa0
mov eax, dword [edi + 0x2c]
add esp, 0xc
cmp byte [eax + 0x5ec], 0
je 0x4ffebe
lea ebx, [eax + 0x5f0]
mov eax, ebx
mov ecx, esi
call fcn.004ff170
test al, al
je 0x4ffebe
mov byte [edi + 0x9c], 1
mov eax, dword [ebx]
imul eax, dword [edi + 0x80]
cdq
idiv dword [ebx + 4]
mov dword [edi + 0xa0], eax
mov eax, dword [edi + 0x80]
mov dword [edi + 0xa4], eax
mov ecx, dword [ebx]
mov dword [edi + 0xa8], ecx
mov edx, dword [ebx + 4]
mov ebx, dword [ebp + 8]
lea eax, [esp + 0xcc]
push eax
push ebx
mov dword [edi + 0xac], edx
call dword [sym.imp.USER32.dll_GetWindowInfo]
lea ecx, [esp + 0x3c]
push ecx
push ebx
call dword [sym.imp.USER32.dll_GetClientRect]
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x40]
lea ecx, [esp + 0x34]
push ecx
push ebx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x40], eax
call dword [sym.imp.USER32.dll_ClientToScreen]
mov eax, dword [edi + 0xa0]
sub eax, dword [edi + 0x7c]
mov ecx, dword [esp + 0x34]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [edi + 0xa4]
sub eax, dword [edi + 0x80]
mov dword [esp + 0x3c], ecx
cdq
sub eax, edx
mov edx, eax
mov eax, dword [esp + 0x38]
sar edx, 1
sub eax, edx
mov edx, dword [edi + 0xa0]
add edx, ecx
mov ecx, dword [edi + 0xa4]
add ecx, eax
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0xf4]
push eax
mov dword [esp + 0x4c], ecx
mov ecx, dword [esp + 0xf4]
push 0
mov dword [esp + 0x4c], edx
push ecx
lea edx, [esp + 0x48]
push edx
call dword [sym.imp.USER32.dll_AdjustWindowRectEx]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x44]
sub ecx, eax
push 0
push ecx
mov ecx, dword [esp + 0x44]
sub edx, ecx
push edx
xor edx, edx
test eax, eax
setl dl
sub edx, 1
and edx, eax
xor eax, eax
test ecx, ecx
setl al
push edx
sub eax, 1
and eax, ecx
push eax
push ebx
call dword [sym.imp.USER32.dll_MoveWindow]
mov ecx, dword [edi + 0x2c]
cmp byte [ecx + 0x5d8], 0
je 0x4ffe8a
mov eax, dword [edi + 0xa0]
mov edx, dword [edi + 0xa8]
mov ecx, dword [edi + 0xa4]
mov dword [edi + 0x7c], eax
mov dword [esi], edx
mov edx, dword [edi + 0xac]
mov dword [edi + 0xb8], eax
xor eax, eax
mov dword [edi + 0x80], ecx
mov dword [esi + 4], edx
mov dword [edi + 0xbc], ecx
mov dword [edi + 0xb0], eax
mov dword [edi + 0xb4], eax
jmp 0x4ffec1
mov eax, dword [edi + 0x80]
mov ecx, dword [edi + 0x7c]
mov dword [edi + 0xbc], eax
mov eax, dword [edi + 0xa0]
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
mov dword [edi + 0xb8], ecx
mov dword [edi + 0xb0], eax
mov dword [edi + 0xb4], 0
jmp 0x4ffec1
mov ebx, dword [ebp + 8]
mov ecx, dword [edi + 0xac]
mov edx, dword [edi + 0xa8]
mov eax, dword [edi + 0xa4]
push ecx
mov ecx, dword [edi + 0xa0]
push edx
push eax
push ecx
push str.Window_is_____________4lu_x__4lu___2d:_2d__n
call fcn.004e5fa0
mov edx, dword [esp + 0x2c]
mov eax, dword [edx]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x50]
add esp, 0x14
push 8
push ebx
push eax
call edx
mov esi, 0x7c
push esi
lea eax, [esp + 0x50]
push 0
push eax
call fcn.0062a710
add esp, 0xc
cmp byte [edi + 0x38], 0
mov eax, 1
mov dword [esp + 0x4c], esi
mov dword [esp + 0x50], eax
mov dword [esp + 0xb4], 0x200
je 0x4fff39
mov dword [esp + 0xb4], 0x2200
mov dword [esp + 0x60], eax
lea eax, [edi + 0x60]
push eax
lea ecx, [esp + 0x50]
push ecx
mov ecx, edi
call fcn.004ff710
cmp eax, 0x88760091
jne 0x4fff7c
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 6
mov ecx, dword [esp + 0x1d0]
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.004ff620
test al, al
je 0x4fffb3
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 3
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push esi
lea ecx, [esp + 0x50]
push 0
push ecx
call fcn.0062a710
mov dword [esp + 0x58], esi
add esp, 0xc
cmp byte [edi + 0x38], 0
mov esi, 0x840
mov dword [esp + 0x50], 7
mov dword [esp + 0xb4], esi
je 0x4fffec
mov dword [esp + 0xb4], 0x6040
mov edx, dword [edi + 0x7c]
mov eax, dword [edi + 0x80]
lea ecx, [edi + 0x68]
mov dword [esp + 0x58], edx
push ecx
lea edx, [esp + 0x50]
push edx
mov ecx, edi
mov dword [esp + 0x5c], eax
call fcn.004ff710
push eax
mov ebx, str.CreateSurface_Windowed_DrawSurface
call fcn.004ff620
test al, al
jne 0x4fff8b
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx]
mov edx, dword [eax]
mov edx, dword [edx + 0x10]
push 0
lea ecx, [esp + 0x28]
push ecx
push 0
push eax
call edx
push eax
mov ebx, str.CreateClipper_Windowed
call fcn.004ff620
test al, al
je 0x50006e
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 1
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [ebp + 8]
mov eax, dword [esp + 0x24]
mov ecx, dword [eax]
push edx
push 0
push eax
mov eax, dword [ecx + 0x20]
call eax
test eax, eax
jl 0x500094
mov eax, dword [edi + 0x60]
mov edx, dword [esp + 0x24]
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x70]
call eax
mov eax, dword [esp + 0x24]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov ecx, dword [edi + 0xce0]
lea eax, [esp + 0x13c]
push eax
push ecx
call dword [sym.imp.USER32.dll_GetClientRect]
mov eax, dword [esp + 0x144]
cmp eax, dword [edi + 0x7c]
mov ecx, dword [esp + 0x148]
jne 0x5000d4
cmp ecx, dword [edi + 0x80]
je 0x500811
push ecx
push eax
mov eax, edi
call fcn.00500fb0
jmp 0x500811
mov edx, dword [edi + 0x98]
mov eax, dword [edi + 0x94]
mov ecx, dword [edi + 0x90]
push edx
mov edx, dword [edi + 0x8c]
push eax
push ecx
push edx
push str.Desktop_is____________4lu_x__4lu___2d:_2d__n
call fcn.004e5fa0
mov eax, dword [esp + 0x2c]
mov eax, dword [eax]
mov edx, dword [ebp + 8]
mov ecx, dword [eax]
add esp, 0x14
push 0x11
push edx
push eax
mov eax, dword [ecx + 0x50]
call eax
push eax
mov ebx, str.SetCooperativeLevel_FullScreen
call fcn.004ff620
test al, al
je 0x500156
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 4
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
xor ebx, ebx
cmp byte [edi + 0x38], bl
je 0x500569
lea eax, [edi + 0x94]
lea ecx, [edi + 0x84]
call fcn.004ff170
test al, al
jne 0x500196
mov edx, dword [edi + 0xa0]
cmp edx, dword [edi + 0x8c]
jg 0x500196
mov eax, dword [edi + 0xa4]
cmp eax, dword [edi + 0x90]
jle 0x500569
push 0x7c
lea ecx, [esp + 0x50]
push ebx
push ecx
mov byte [esp + 0x2f], bl
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x30], ebx
call fcn.0062a710
add esp, 0xc
lea edx, [esp + 0x30]
push edx
lea eax, [esp + 0x50]
push eax
mov ecx, edi
mov dword [esp + 0x54], 0x7c
mov dword [esp + 0x58], 7
mov dword [esp + 0xbc], 0x6040
mov dword [esp + 0x60], 0x14
mov dword [esp + 0x5c], 0xf
call fcn.004ff710
push eax
mov ebx, str.CreateSurface_FilterBltTest_Src
call fcn.004ff620
test al, al
jne 0x50045a
push 0x7c
lea ecx, [esp + 0x50]
push 0
push ecx
call fcn.0062a710
add esp, 0xc
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x50]
push eax
mov ecx, edi
mov dword [esp + 0x54], 0x7c
mov dword [esp + 0x58], 7
mov dword [esp + 0xbc], 0x6040
mov dword [esp + 0x60], 0xa0
mov dword [esp + 0x5c], 0x5a
call fcn.004ff710
push eax
mov ebx, str.CreateSurface_FilterBltTest_Dest
call fcn.004ff620
test al, al
jne 0x50045a
push 0x6c
lea ecx, [esp + 0x150]
push 0
push ecx
call fcn.0062a710
mov eax, dword [esp + 0x3c]
add esp, 0xc
push 0
push 0x21
lea ecx, [esp + 0x154]
push ecx
mov dword [esp + 0x158], 0x6c
mov edx, dword [eax]
mov edx, dword [edx + 0x64]
push 0
push eax
call edx
push eax
mov ebx, str.Lock_FilterBltTest_Src
call fcn.004ff620
test al, al
jne 0x50045a
mov esi, dword [esp + 0x1a0]
mov eax, dword [esp + 0x170]
shr esi, 3
cmp dword [esp + 0x154], 0
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], 0
jbe 0x50033c
mov eax, dword [esp + 0x158]
jmp 0x5002e0
xor ebx, ebx
test eax, eax
jbe 0x500316
mov edx, dword [esp + 0x2c]
mov ecx, ebx
and cl, 1
neg cl
push esi
sbb ecx, ecx
and ecx, 0xff
push ecx
push edx
call fcn.0062a710
mov eax, dword [esp + 0x164]
add dword [esp + 0x38], esi
add ebx, 1
add esp, 0xc
cmp ebx, eax
jb 0x5002e6
mov edx, dword [esp + 0x15c]
mov ecx, eax
imul ecx, esi
sub edx, ecx
mov ecx, dword [esp + 0x1c]
add dword [esp + 0x2c], edx
add ecx, 1
cmp ecx, dword [esp + 0x154]
mov dword [esp + 0x1c], ecx
jb 0x5002e0
mov eax, dword [esp + 0x30]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x80]
push 0
push eax
call edx
push 0x64
lea eax, [esp + 0xd0]
push 0
push eax
call fcn.0062a710
mov eax, dword [esp + 0x30]
add esp, 0xc
lea edx, [esp + 0xcc]
push edx
mov edx, dword [esp + 0x34]
push 0x1000000
push 0
push edx
mov dword [esp + 0xdc], 0x64
mov ecx, dword [eax]
push 0
push eax
mov eax, dword [ecx + 0x14]
call eax
push eax
mov ebx, str.Blt_FilterBltTest_Src__Dest
call fcn.004ff620
test al, al
jne 0x50045a
push 0x6c
lea ecx, [esp + 0x150]
push 0
push ecx
call fcn.0062a710
mov eax, dword [esp + 0x30]
add esp, 0xc
push 0
push 0x21
lea ecx, [esp + 0x154]
push ecx
mov dword [esp + 0x158], 0x6c
mov edx, dword [eax]
mov edx, dword [edx + 0x64]
push 0
push eax
call edx
push eax
mov ebx, str.Lock_FilterBltTest_Dest
call fcn.004ff620
test al, al
jne 0x50045a
mov ecx, dword [esp + 0x1a0]
mov eax, dword [esp + 0x170]
xor ebx, ebx
shr ecx, 3
cmp dword [esp + 0x154], ebx
jbe 0x500449
mov edx, dword [esp + 0x158]
imul edx, ecx
nop
xor esi, esi
test edx, edx
jbe 0x50042b
mov cl, byte [eax]
test cl, cl
je 0x500421
cmp cl, 0xff
jne 0x500444
add esi, 1
add eax, 1
cmp esi, edx
jb 0x500416
mov ecx, dword [esp + 0x15c]
sub ecx, edx
add ebx, 1
add eax, ecx
cmp ebx, dword [esp + 0x154]
jb 0x500410
jmp 0x500449
mov byte [esp + 0x23], 1
mov eax, dword [esp + 0x24]
mov edx, dword [eax]
push 0
push eax
mov eax, dword [edx + 0x80]
call eax
mov eax, dword [esp + 0x30]
test eax, eax
je 0x50046a
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [esp + 0x24]
test eax, eax
je 0x50047a
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
cmp byte [esp + 0x23], 0
je 0x500569
mov eax, dword [edi + 0x94]
mov ecx, dword [edi + 0x8c]
mov ebx, dword [edi + 0x90]
mov edx, dword [edi + 0x98]
lea esi, [edi + 0xa8]
mov dword [esi], eax
mov eax, dword [edi + 0x2c]
mov byte [edi + 0x9c], 1
mov dword [edi + 0xa0], ecx
mov dword [edi + 0xa4], ebx
mov dword [esi + 4], edx
cmp byte [eax + 0x5d8], 0
je 0x50052f
mov edx, dword [edi + 0x88]
mov eax, dword [esi]
mov ebx, dword [esi + 4]
imul eax, edx
lea ecx, [edi + 0x84]
cdq
idiv ebx
mov edx, dword [ecx]
cmp eax, edx
jg 0x5004f3
mov eax, edx
imul eax, ebx
cdq
idiv dword [ecx + 4]
cmp dword [esi], eax
jg 0x5004f3
mov esi, ecx
mov edx, dword [esi]
mov dword [ecx], edx
mov eax, dword [esi + 4]
mov dword [ecx + 4], eax
mov eax, edx
imul eax, dword [edi + 0x80]
cdq
idiv dword [ecx + 4]
mov dword [edi + 0x7c], eax
mov eax, dword [edi + 0x8c]
mov dword [edi + 0xb8], eax
mov eax, dword [edi + 0x90]
mov dword [edi + 0xbc], eax
xor eax, eax
mov dword [edi + 0xb4], eax
jmp 0x500563
mov eax, dword [edi + 0x7c]
imul eax, ebx
cdq
idiv dword [edi + 0x80]
cmp eax, ecx
mov edx, eax
jl 0x500544
mov edx, ecx
mov eax, ecx
sub eax, edx
mov dword [edi + 0xb8], edx
cdq
sub eax, edx
mov dword [edi + 0xbc], ebx
sar eax, 1
mov dword [edi + 0xb4], 0
mov dword [edi + 0xb0], eax
mov ecx, dword [edi + 0xac]
mov edx, dword [edi + 0xa8]
mov eax, dword [edi + 0xa4]
push ecx
mov ecx, dword [edi + 0xa0]
push edx
push eax
push ecx
push str.Display_is____________4lu_x__4lu___2d:_2d__n
call fcn.004e5fa0
mov edx, dword [esp + 0x2c]
mov eax, dword [edx]
mov edx, dword [edi + 0xc0]
mov ecx, dword [eax]
add esp, 0x14
push edx
mov edx, dword [edi + 0xa4]
push edx
mov edx, dword [edi + 0xa0]
push edx
push eax
mov eax, dword [ecx + 0x54]
call eax
push eax
mov ebx, str.SetDisplayMode_FullScreen
call fcn.004ff620
test al, al
je 0x5005ec
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 5
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0x7c
lea edx, [esp + 0x50]
push 0
push edx
call fcn.0062a710
add esp, 0xc
cmp byte [edi + 0x38], 0
mov dword [esp + 0x4c], 0x7c
mov dword [esp + 0x50], 0x21
mov dword [esp + 0xb4], 0x218
mov dword [esp + 0x60], 1
je 0x500631
mov dword [esp + 0xb4], 0x2218
lea eax, [edi + 0x60]
push eax
lea eax, [esp + 0x50]
push eax
mov ecx, edi
call fcn.004ff710
push eax
mov ebx, str.CreateSurface_FullScreen_Primary
call fcn.004ff620
test al, al
je 0x500678
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 3
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [edi + 0x60]
lea esi, [edi + 0x64]
push esi
lea ecx, [esp + 0x38]
mov dword [esp + 0x38], 4
mov edx, dword [eax]
mov edx, dword [edx + 0x30]
push ecx
push eax
call edx
push eax
mov ebx, str.GetAttachedSurface
call fcn.004ff620
test al, al
jne 0x4fff8b
push 0xec
call fcn.00624a6a
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
mov byte [esp + 0x1d8], 1
je 0x5006cc
push eax
call fcn.00509f50
jmp 0x5006ce
xor eax, eax
mov byte [esp + 0x1d8], 0
mov ecx, dword [esi]
mov dword [edi + 0xcec], eax
mov edx, dword [eax]
mov edx, dword [edx + 0xc4]
push ecx
mov ecx, eax
call edx
cmp byte [edi + 0x9c], 0
je 0x500705
mov eax, dword [edi + 0x60]
push eax
call fcn.004ff920
mov ecx, dword [esi]
push ecx
call fcn.004ff920
push 0x7c
lea edx, [esp + 0x50]
push 0
push edx
call fcn.0062a710
add esp, 0xc
cmp byte [edi + 0x38], 0
mov esi, 0x840
mov dword [esp + 0x4c], 0x7c
mov dword [esp + 0x50], 7
mov dword [esp + 0xb4], esi
je 0x500743
mov dword [esp + 0xb4], 0x6040
mov eax, dword [edi + 0x7c]
mov ecx, dword [edi + 0x80]
lea edx, [edi + 0x68]
mov dword [esp + 0x58], eax
push edx
lea eax, [esp + 0x50]
mov dword [esp + 0x58], ecx
push eax
mov ecx, edi
call fcn.004ff710
push eax
mov ebx, str.CreateSurface_FullScreen_DrawSurface
call fcn.004ff620
test al, al
jne 0x500650
mov edx, dword [esp + 0x18]
mov eax, dword [edx]
mov ecx, dword [eax]
push 0
lea edx, [esp + 0x2c]
push edx
push 0
push eax
mov eax, dword [ecx + 0x10]
call eax
push eax
mov ebx, str.CreateClipper_FullScreen
call fcn.004ff620
test al, al
je 0x5007c5
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 1
mov ecx, dword [esp + 0x1d0]
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 + 0x28]
mov edx, dword [eax]
mov edx, dword [edx + 0x20]
push ecx
push 0
push eax
call edx
test eax, eax
jl 0x5007eb
mov eax, dword [edi + 0x60]
mov edx, dword [esp + 0x28]
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x70]
call eax
mov eax, dword [esp + 0x28]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [edi + 0x2c]
cmp byte [eax + 0x369], 0
jne 0x500811
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx]
mov edx, dword [eax]
push eax
mov eax, dword [edx + 0x28]
call eax
mov ecx, dword [edi + 0x88]
mov edx, dword [edi + 0x84]
mov eax, dword [edi + 0x80]
push ecx
mov ecx, dword [edi + 0x7c]
push edx
push eax
push ecx
push str.Draw_buffer_is________4lu_x__4lu___2d:_2d__n
call fcn.004e5fa0
mov edx, dword [esp + 0x2c]
mov eax, dword [edx]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x3c]
add esp, 0x14
lea ebx, [edi + 0xc4]
push ebx
push eax
call edx
test eax, eax
jl 0x500855
cmp dword [ebx], 0x3c
jae 0x500868
mov eax, dword [edi + 0x2c]
mov cl, 1
mov byte [eax + 0x5b9], cl
mov dword [ebx], 0x3c
jmp 0x50086a
mov cl, 1
mov eax, dword [ebx]
cmp eax, 0x3c
jae 0x500882
mov edx, dword [edi + 0x2c]
mov byte [edx + 0x5b9], cl
mov dword [ebx], 0x3c
jmp 0x500896
cmp eax, 0x64
jbe 0x500896
mov eax, dword [edi + 0x2c]
mov byte [eax + 0x5b9], cl
mov dword [ebx], 0x64
xor edx, edx
mov eax, 0x3e8
div dword [ebx]
push 0x7c
lea ecx, [esp + 0x50]
push 0
push ecx
mov dword [edi + 0xc8], eax
call fcn.0062a710
mov edx, dword [edi + 0xd04]
mov eax, dword [edi + 0xd08]
add esp, 0xc
mov dword [esp + 0xb4], esi
lea esi, [edi + 0xd24]
push esi
lea ecx, [esp + 0x50]
push ecx
mov ecx, edi
mov dword [esp + 0x54], 0x7c
mov dword [esp + 0x58], 7
mov dword [esp + 0x60], edx
mov dword [esp + 0x5c], eax
call fcn.004ff710
push eax
mov ebx, str.CreateSurface_OldCursorArea
call fcn.004ff620
test al, al
je 0x50092b
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 3
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lea eax, [edi + 0xd28]
push eax
lea eax, [esp + 0x50]
push eax
mov ecx, edi
call fcn.004ff710
push eax
mov ebx, str.CreateSurface_NewCursorArea
call fcn.004ff620
test al, al
jne 0x500650
push 0xec
call fcn.00624a6a
add esp, 4
mov dword [esp + 0x34], eax
test eax, eax
mov byte [esp + 0x1d8], 2
je 0x500976
push eax
call fcn.00509f50
jmp 0x500978
xor eax, eax
mov byte [esp + 0x1d8], 0
mov ecx, dword [esi]
mov dword [edi + 0xd2c], eax
mov edx, dword [eax]
mov edx, dword [edx + 0xc4]
push ecx
mov ecx, eax
call edx
mov ecx, dword [edi + 0xd2c]
mov eax, dword [ecx]
mov edx, dword [eax + 0x80]
push 0
push 0
call edx
push 0xec
call fcn.00624a6a
add esp, 4
mov dword [esp + 0x34], eax
test eax, eax
mov byte [esp + 0x1d8], 3
je 0x5009ce
push eax
call fcn.00509f50
jmp 0x5009d0
xor eax, eax
mov byte [esp + 0x1d8], 0
mov ecx, dword [edi + 0xd28]
mov dword [edi + 0xd30], eax
mov edx, dword [eax]
mov edx, dword [edx + 0xc4]
push ecx
mov ecx, eax
call edx
mov ecx, dword [edi + 0xd30]
mov eax, dword [ecx]
mov edx, dword [eax + 0x80]
push 0
push 0
call edx
mov esi, dword [edi + 0x60]
test esi, esi
je 0x500f02
push 0x6c
lea eax, [esp + 0xd0]
push 0
push eax
call fcn.0062a710
add esp, 0xc
lea edx, [esp + 0xcc]
mov dword [esp + 0xcc], 0x6c
mov dword [esp + 0xd0], 0x1006
mov ecx, dword [esi]
mov eax, dword [ecx + 0x58]
push edx
push esi
call eax
mov eax, dword [esp + 0x120]
cmp eax, 0x10
je 0x500a83
cmp eax, 0x20
je 0x500a83
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 6
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ebx, dword [esp + 0x124]
mov esi, dword [esp + 0x12c]
mov dword [edi + 4], eax
mov eax, dword [esp + 0x128]
mov dword [edi + 8], ebx
mov dword [edi + 0xc], eax
mov dword [edi + 0x10], esi
mov ecx, 0x20
lea esp, [esp]
mov edx, ebx
shr edx, cl
test dl, 1
je 0x500abc
mov dword [edi + 0x20], ecx
mov edx, eax
shr edx, cl
test dl, 1
je 0x500ac8
mov dword [edi + 0x24], ecx
mov edx, esi
shr edx, cl
test dl, 1
je 0x500ad4
mov dword [edi + 0x28], ecx
sub ecx, 1
jns 0x500ab0
mov ecx, dword [edi + 0x28]
mov esi, dword [edi + 0x24]
mov edx, dword [edi + 0x20]
mov eax, 2
add ecx, eax
add esi, eax
mov dword [esp + 0x18], ecx
add edx, eax
mov dword [esp + 0x1c], 8
jmp 0x500b07
mov ebx, dword [esp + 0x124]
lea ecx, [edx - 2]
cmp ecx, 0x20
jge 0x500b1e
lea ecx, [edx - 2]
shr ebx, cl
test ebx, ebx
je 0x500b1e
lea ecx, [eax - 1]
mov dword [edi + 0x14], ecx
lea ecx, [esi - 2]
cmp ecx, 0x20
jge 0x500b3c
mov ebx, dword [esp + 0x128]
lea ecx, [esi - 2]
shr ebx, cl
test ebx, ebx
je 0x500b3c
lea ecx, [eax - 1]
mov dword [edi + 0x18], ecx
mov ecx, dword [esp + 0x18]
lea ebx, [ecx - 2]
cmp ebx, 0x20
jge 0x500b5e
mov ebx, dword [esp + 0x12c]
add ecx, 0xfffffffe
shr ebx, cl
test ebx, ebx
je 0x500b5e
lea ecx, [eax - 1]
mov dword [edi + 0x1c], ecx
lea ecx, [edx - 1]
cmp ecx, 0x20
jge 0x500b79
mov ebx, dword [esp + 0x124]
lea ecx, [edx - 1]
shr ebx, cl
test ebx, ebx
je 0x500b79
mov dword [edi + 0x14], eax
lea ecx, [esi - 1]
cmp ecx, 0x20
jge 0x500b94
mov ebx, dword [esp + 0x128]
lea ecx, [esi - 1]
shr ebx, cl
test ebx, ebx
je 0x500b94
mov dword [edi + 0x18], eax
mov ecx, dword [esp + 0x18]
lea ebx, [ecx - 1]
cmp ebx, 0x20
jge 0x500bb3
mov ebx, dword [esp + 0x12c]
add ecx, 0xffffffff
shr ebx, cl
test ebx, ebx
je 0x500bb3
mov dword [edi + 0x1c], eax
cmp edx, 0x20
jge 0x500bcd
mov ebx, dword [esp + 0x124]
mov ecx, edx
shr ebx, cl
test ebx, ebx
je 0x500bcd
lea ecx, [eax + 1]
mov dword [edi + 0x14], ecx
cmp esi, 0x20
jge 0x500be7
mov ebx, dword [esp + 0x128]
mov ecx, esi
shr ebx, cl
test ebx, ebx
je 0x500be7
lea ecx, [eax + 1]
mov dword [edi + 0x18], ecx
mov ecx, dword [esp + 0x18]
cmp ecx, 0x20
jge 0x500c03
mov ebx, dword [esp + 0x12c]
shr ebx, cl
test ebx, ebx
je 0x500c03
lea ecx, [eax + 1]
mov dword [edi + 0x1c], ecx
lea ecx, [edx + 1]
cmp ecx, 0x20
jge 0x500c1e
mov ebx, dword [esp + 0x124]
shr ebx, cl
test ebx, ebx
je 0x500c1e
lea ecx, [eax + 2]
mov dword [edi + 0x14], ecx
lea ecx, [esi + 1]
cmp ecx, 0x20
jge 0x500c39
mov ebx, dword [esp + 0x128]
shr ebx, cl
test ebx, ebx
je 0x500c39
lea ecx, [eax + 2]
mov dword [edi + 0x18], ecx
mov ecx, dword [esp + 0x18]
add ecx, 1
cmp ecx, 0x20
jge 0x500c58
mov ebx, dword [esp + 0x12c]
shr ebx, cl
test ebx, ebx
je 0x500c58
lea ecx, [eax + 2]
mov dword [edi + 0x1c], ecx
add dword [esp + 0x18], 4
add eax, 4
add edx, 4
add esi, 4
sub dword [esp + 0x1c], 1
jne 0x500b00
mov edx, dword [edi + 0xd0]
push edx
call fcn.0062506e
mov eax, dword [edi + 0xd4]
add esp, 4
push eax
call fcn.0062506e
mov ecx, dword [edi + 0xd8]
add esp, 4
push ecx
call fcn.0062506e
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
sub esi, 1
xor ecx, ecx
add esp, 4
sub eax, 1
mov dword [esp + 0x28], eax
lea eax, [esi + esi + 1]
mov dword [esp + 0x1c], eax
mov edx, 4
sub ebx, 1
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00613caa
mov dword [edi + 0xd0], 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.00613caa
mov dword [edi + 0xd4], eax
mov eax, dword [esp + 0x2c]
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.00613caa
mov dword [edi + 0xd8], eax
xor eax, eax
add esp, 4
cmp dword [esp + 0x1c], eax
jle 0x500d5c
cmp eax, esi
mov ecx, eax
jl 0x500d4a
mov ecx, esi
mov edx, dword [edi + 0xd0]
mov dword [edx + eax*4], ecx
add eax, 1
cmp eax, dword [esp + 0x1c]
jl 0x500d42
lea edx, [ebx + ebx + 1]
xor eax, eax
test edx, edx
jle 0x500d7e
cmp eax, ebx
mov ecx, eax
jl 0x500d6e
mov ecx, ebx
mov esi, dword [edi + 0xd4]
mov dword [esi + eax*4], ecx
add eax, 1
cmp eax, edx
jl 0x500d66
mov esi, dword [esp + 0x28]
lea edx, [esi + esi + 1]
xor eax, eax
test edx, edx
jle 0x500da8
lea esp, [esp]
cmp eax, esi
mov ecx, eax
jl 0x500d98
mov ecx, esi
mov ebx, dword [edi + 0xd8]
mov dword [ebx + eax*4], ecx
add eax, 1
cmp eax, edx
jl 0x500d90
mov ebx, 2
lea ecx, [edi + 0x4dc]
mov dword [esp + 0x1c], 0x40
jmp 0x500dc0
mov eax, dword [edi + 8]
mov edx, eax
lea esi, [ebx - 2]
imul edx, esi
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, dword [edi + 8]
mov eax, 0x80808081
mov dword [ecx - 0x400], edx
mov edx, dword [edi + 0xc]
imul edx, esi
mul edx
shr edx, 7
and edx, dword [edi + 0xc]
mov eax, 0x80808081
mov dword [ecx], edx
mov edx, dword [edi + 0x10]
imul edx, esi
mul edx
shr edx, 7
and edx, dword [edi + 0x10]
lea esi, [ebx - 1]
mov dword [ecx + 0x400], edx
mov eax, dword [edi + 8]
mov edx, eax
imul edx, esi
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, dword [edi + 8]
mov eax, 0x80808081
mov dword [ecx - 0x3fc], edx
mov edx, dword [edi + 0xc]
imul edx, esi
mul edx
shr edx, 7
and edx, dword [edi + 0xc]
mov eax, 0x80808081
mov dword [ecx + 4], edx
mov edx, dword [edi + 0x10]
imul edx, esi
mul edx
shr edx, 7
and edx, dword [edi + 0x10]
mov eax, 0x80808081
mov dword [ecx + 0x404], edx
mov esi, dword [edi + 8]
mov edx, ebx
imul edx, esi
mul edx
shr edx, 7
and edx, esi
mov dword [ecx - 0x3f8], edx
mov esi, dword [edi + 0xc]
mov edx, ebx
imul edx, esi
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, esi
mov dword [ecx + 8], edx
mov esi, dword [edi + 0x10]
mov edx, esi
imul edx, ebx
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, esi
mov dword [ecx + 0x408], edx
mov eax, dword [edi + 8]
mov edx, eax
lea esi, [ebx + 1]
imul edx, esi
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, dword [edi + 8]
mov dword [ecx - 0x3f4], edx
mov edx, dword [edi + 0xc]
imul edx, esi
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, dword [edi + 0xc]
mov eax, 0x80808081
mov dword [ecx + 0xc], edx
mov edx, dword [edi + 0x10]
imul edx, esi
mul edx
shr edx, 7
and edx, dword [edi + 0x10]
add ecx, 0x10
mov dword [ecx + 0x3fc], edx
add ebx, 4
sub dword [esp + 0x1c], 1
jne 0x500dc0
movzx eax, byte [edi + 0xcfc]
push eax
mov ecx, edi
call fcn.00501130
cmp byte [edi + 0x38], 0
je 0x500f71
mov eax, dword [edi + 0x30]
mov ebx, edi
call fcn.00503290
test al, al
jne 0x500f71
push 0xf
add edi, 0xd34
push str.3D_init_error:
mov ecx, edi
call fcn.00402300
push 0xffffffffffffffff
push 0
push 0x6b377c
mov ecx, edi
call fcn.00446020
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 7
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [esp + 0x14]
add dword [edi + 0xd00], 1
push edx
mov byte [edi + 0xcdc], 1
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8