Function at 0x401315
Capabilities:
Capture screenshot

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
push ebx
push esi
push edi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
call fcn.004012c7
mov edi, dword [ebp + 0x14]
xor ebx, ebx
pop ecx
mov esi, eax
cmp edi, ebx
pop ecx
mov dword [ebp - 0xc], esi
je 0x40165b
cmp esi, ebx
je 0x40165b
cmp dword [esi + 0x10], ebx
je 0x40165b
mov eax, dword [edi + 0x18]
push eax
mov dword [ebp - 4], eax
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
cmp eax, ebx
mov dword [ebp - 8], eax
je 0x40165b
lea eax, [ebp - 0x38]
push eax
push 0x18
push dword [esi + 0x10]
call dword [sym.imp.GDI32.dll_GetObjectA]
cmp eax, 0x18
jne 0x40164e
push dword [esi + 0x10]
push dword [ebp - 8]
call dword [sym.imp.GDI32.dll_SelectObject]
cmp eax, ebx
mov dword [ebp - 0x20], eax
je 0x40164e
mov eax, dword [0x406bd4]
mov dword [ebp - 0x10], ebx
cmp eax, ebx
je 0x4013b8
push ebx
push eax
push dword [ebp - 4]
call dword [sym.imp.GDI32.dll_SelectPalette]
push dword [ebp - 4]
mov dword [ebp - 0x10], eax
call dword [sym.imp.GDI32.dll_RealizePalette]
mov ecx, dword [esi + 8]
mov dword [ebp + 0x10], ebx
mov eax, ecx
mov dword [ebp + 0xc], ebx
dec eax
dec eax
je 0x4013d7
dec eax
jne 0x4013e0
mov eax, dword [edi + 0x24]
sub eax, dword [ebp - 0x34]
cdq
sub eax, edx
sar eax, 1
jmp 0x4013dd
mov eax, dword [edi + 0x24]
sub eax, dword [ebp - 0x34]
mov dword [ebp + 0x10], eax
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x1c], eax
sub eax, 7
je 0x4013fb
dec eax
jne 0x401404
mov eax, dword [edi + 0x28]
sub eax, dword [ebp - 0x30]
cdq
sub eax, edx
sar eax, 1
jmp 0x401401
mov eax, dword [edi + 0x28]
sub eax, dword [ebp - 0x30]
mov dword [ebp + 0xc], eax
mov esi, dword [sym.imp.GDI32.dll_BitBlt]
cmp ecx, 4
mov edi, 0xcc0020
je 0x401431
cmp dword [ebp - 0x1c], 9
je 0x401431
push edi
push ebx
push ebx
push dword [ebp - 8]
push dword [ebp - 0x30]
push dword [ebp - 0x34]
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [ebp - 4]
call esi
mov ecx, dword [ebp - 0xc]
cmp dword [ecx + 8], 4
jne 0x4014a1
cmp dword [ecx + 0xc], 9
je 0x4014ab
cmp dword [ebp - 0x34], ebx
jle 0x4014a1
mov eax, dword [ebp + 0x14]
mov eax, dword [eax + 0x24]
cdq
idiv dword [ebp - 0x34]
cmp eax, ebx
jle 0x40147b
mov dword [ebp - 0x14], eax
push edi
push ebx
push ebx
push dword [ebp - 8]
push dword [ebp - 0x30]
push dword [ebp - 0x34]
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [ebp - 4]
call esi
mov eax, dword [ebp - 0x34]
add dword [ebp + 0x10], eax
dec dword [ebp - 0x14]
jne 0x401456
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov eax, dword [eax + 0x24]
cmp dword [ebp + 0x10], eax
jge 0x4014a1
sub eax, dword [ebp + 0x10]
push edi
push ebx
push ebx
push dword [ebp - 8]
push dword [ebp - 0x30]
push eax
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [ebp - 4]
call esi
mov ecx, dword [ebp - 0xc]
cmp dword [ecx + 0xc], 9
jne 0x401630
cmp dword [ecx + 8], 4
je 0x401512
cmp dword [ebp - 0x30], ebx
jle 0x401512
mov eax, dword [ebp + 0x14]
mov eax, dword [eax + 0x28]
cdq
idiv dword [ebp - 0x30]
cmp eax, ebx
jle 0x4014ec
mov dword [ebp - 0x14], eax
push edi
push ebx
push ebx
push dword [ebp - 8]
push dword [ebp - 0x30]
push dword [ebp - 0x34]
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [ebp - 4]
call esi
mov eax, dword [ebp - 0x30]
add dword [ebp + 0xc], eax
dec dword [ebp - 0x14]
jne 0x4014c7
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov eax, dword [eax + 0x28]
cmp dword [ebp + 0xc], eax
jge 0x401512
sub eax, dword [ebp + 0xc]
push edi
push ebx
push ebx
push dword [ebp - 8]
push eax
push dword [ebp - 0x34]
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [ebp - 4]
call esi
mov ecx, dword [ebp - 0xc]
cmp dword [ecx + 0xc], 9
jne 0x401630
cmp dword [ecx + 8], 4
jne 0x401630
cmp dword [ebp - 0x34], ebx
jle 0x401630
cmp dword [ebp - 0x30], ebx
jle 0x401630
mov ecx, dword [ebp + 0x14]
mov dword [ebp + 0xc], ebx
mov eax, dword [ecx + 0x24]
cdq
idiv dword [ebp - 0x34]
mov dword [ebp - 0x18], eax
mov eax, dword [ecx + 0x28]
cdq
idiv dword [ebp - 0x30]
mov edx, eax
cmp edx, ebx
mov dword [ebp - 0x1c], edx
jle 0x4015be
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0x18]
mov dword [ebp + 0x10], ebx
cmp eax, ebx
jle 0x40158a
mov dword [ebp - 0x14], eax
push edi
push ebx
push ebx
push dword [ebp - 8]
push dword [ebp - 0x30]
push dword [ebp - 0x34]
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [ebp - 4]
call esi
mov eax, dword [ebp - 0x34]
add dword [ebp + 0x10], eax
dec dword [ebp - 0x14]
jne 0x401568
mov eax, dword [ebp + 0x14]
mov eax, dword [eax + 0x24]
cmp dword [ebp + 0x10], eax
jge 0x4015ad
sub eax, dword [ebp + 0x10]
push edi
push ebx
push ebx
push dword [ebp - 8]
push dword [ebp - 0x30]
push eax
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [ebp - 4]
call esi
mov eax, dword [ebp - 0x30]
add dword [ebp + 0xc], eax
dec dword [ebp - 0xc]
jne 0x40155b
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ebp + 0x14]
mov eax, dword [ecx + 0x28]
cmp dword [ebp + 0xc], eax
jge 0x401630
sub eax, dword [ebp + 0xc]
cmp edx, ebx
mov dword [ebp - 0xc], eax
jle 0x401630
mov dword [ebp - 0x1c], edx
mov eax, dword [ebp - 0x18]
mov dword [ebp + 0x10], ebx
cmp eax, ebx
jle 0x401602
mov dword [ebp - 0x14], eax
push edi
push ebx
push ebx
push dword [ebp - 8]
push dword [ebp - 0xc]
push dword [ebp - 0x34]
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [ebp - 4]
call esi
mov eax, dword [ebp - 0x34]
add dword [ebp + 0x10], eax
dec dword [ebp - 0x14]
jne 0x4015e0
mov eax, dword [ebp + 0x14]
mov eax, dword [eax + 0x24]
cmp dword [ebp + 0x10], eax
jge 0x401625
sub eax, dword [ebp + 0x10]
push edi
push ebx
push ebx
push dword [ebp - 8]
push dword [ebp - 0xc]
push eax
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [ebp - 4]
call esi
mov eax, dword [ebp - 0x30]
add dword [ebp + 0xc], eax
dec dword [ebp - 0x1c]
jne 0x4015d3
cmp dword [ebp - 0x10], ebx
je 0x401642
push ebx
push dword [ebp - 0x10]
push dword [ebp - 4]
call dword [sym.imp.GDI32.dll_SelectPalette]
push dword [ebp - 0x20]
push dword [ebp - 8]
call dword [sym.imp.GDI32.dll_SelectObject]
push dword [ebp - 8]
call dword [sym.imp.GDI32.dll_DeleteDC]
mov al, 1
jmp 0x40165d
xor al, al
pop edi
pop esi
pop ebx
leave
ret