Function at 0x4ba290
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0xac
push ebx
mov ebx, dword [esp + 0xcc]
mov ecx, dword [ebx + 4]
push ebp
push esi
mov esi, dword [esp + 0xcc]
push edi
mov edi, dword [ebx + 8]
cmp ecx, edi
jle 0x4ba2c9
mov eax, edi
imul eax, dword [esp + 0xd4]
cdq
idiv ecx
mov dword [esp + 0x24], esi
mov dword [esp + 0x2c], eax
jmp 0x4ba2e5
mov eax, dword [esp + 0xd4]
mov dword [esp + 0x2c], eax
mov eax, ecx
imul eax, dword [esp + 0xd0]
cdq
idiv edi
mov dword [esp + 0x24], eax
cmp byte [0x58b0ae], 0
jne 0x4ba302
cmp dword [esp + 0x24], ecx
jl 0x4ba302
cmp dword [esp + 0x2c], edi
jl 0x4ba302
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], edi
cmp dword [ebx + 0x24], 0xffffffff
je 0x4ba31b
mov edi, dword [esp + 0xd4]
mov ebp, esi
mov dword [esp + 0x70], ebp
mov dword [esp + 0x68], edi
jmp 0x4ba32f
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x70], ecx
mov dword [esp + 0x68], edx
mov ebp, ecx
mov edi, edx
mov eax, ebp
cdq
sub eax, edx
mov ecx, eax
mov eax, esi
cdq
sub eax, edx
mov esi, eax
mov eax, dword [esp + 0x24]
cdq
sub eax, edx
sar eax, 1
sar ecx, 1
sar esi, 1
sub esi, ecx
add esi, dword [esp + 0xc8]
sub ecx, eax
mov eax, dword [esp + 0xcc]
sub eax, edi
add eax, dword [esp + 0xd4]
mov dword [esp + 0x80], esi
mov dword [esp + 0x78], eax
mov eax, edi
sub eax, dword [esp + 0x2c]
mov dword [esp + 0x90], ecx
mov dword [esp + 0x60], eax
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x4ba3be
cmp dword [ebx + 0x10], ebp
jne 0x4ba3b4
cmp dword [ebx + 0x14], edi
jne 0x4ba3b4
cmp dword [ebx + 0x20], 0
je 0x4ba3a4
mov ecx, dword [esp + 0xdc]
cmp dword [ebx + 0x18], ecx
jne 0x4ba3b4
mov edx, dword [esp + 0xe0]
cmp dword [ebx + 0x1c], edx
je 0x4baa5c
test eax, eax
je 0x4ba3be
push eax
call fcn.004a23a0
mov eax, edi
imul eax, ebp
add eax, eax
add eax, eax
push eax
call fcn.004a2340
mov edx, dword [esp + 0xc4]
mov ecx, dword [esp + 0xe0]
mov dword [ebx + 0xc], eax
mov eax, dword [esp + 0xdc]
push eax
push edx
mov dword [ebx + 0x10], ebp
mov dword [ebx + 0x14], edi
mov dword [ebx + 0x18], eax
mov dword [ebx + 0x1c], ecx
call dword [sym.imp.GDI32.dll_GetNearestColor]
movzx ecx, al
movzx edx, ah
shr eax, 0x10
movzx eax, al
xor esi, esi
cmp dword [ebx + 0x24], 0xffffffff
mov dword [esp + 0x14], ecx
mov dword [esp + 0x20], edx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x10], esi
mov dword [esp + 0x40], esi
je 0x4ba482
mov ecx, dword [esp + 0xc4]
push ecx
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
test eax, eax
mov dword [esp + 0x5c], eax
je 0x4ba482
lea edx, [esp + 0x88]
push edx
mov edx, dword [ebx + 0x24]
lea ecx, [esp + 0x88]
push ecx
push edi
push ebp
push eax
mov eax, dword [esp + 0xd4]
push edx
push eax
call fcn.004bb1a0
test eax, eax
je 0x4ba477
mov ecx, dword [esp + 0x84]
mov edx, dword [esp + 0x88]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x40], edx
mov esi, ecx
mov eax, dword [esp + 0x5c]
push eax
call dword [sym.imp.GDI32.dll_DeleteDC]
test edi, edi
mov ecx, dword [ebx + 0xc]
mov dword [esp + 0x8c], ecx
jle 0x4baa37
mov eax, dword [esp + 0x60]
neg eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], edi
test ebp, ebp
jle 0x4baa24
mov ecx, dword [esp + 0x90]
neg ecx
mov dword [esp + 0x60], ebp
mov ebp, dword [ebx + 4]
mov eax, ecx
imul eax, ebp
cdq
idiv dword [esp + 0x24]
add ecx, 1
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x7c], ebp
mov dword [esp + 0x30], eax
mov eax, ebp
imul eax, ecx
cdq
idiv dword [esp + 0x24]
mov ecx, dword [ebx + 8]
mov dword [esp + 0x54], ecx
mov dword [esp + 0x3c], eax
mov eax, ecx
imul eax, dword [esp + 0x58]
cdq
idiv dword [esp + 0x2c]
mov edi, eax
mov eax, ecx
mov ecx, dword [esp + 0x58]
add ecx, 1
imul eax, ecx
cdq
idiv dword [esp + 0x2c]
xor edx, edx
mov dword [esp + 0x50], edi
mov dword [esp + 0x38], edx
mov dword [esp + 0x44], edx
mov dword [esp + 0x4c], edx
mov dword [esp + 0x28], edx
mov dword [esp + 0x74], edx
mov dword [esp + 0x64], edi
cmp edi, eax
mov dword [esp + 0x48], eax
jge 0x4ba7a2
mov eax, dword [ebx]
mov edx, ebp
imul edx, edi
add edx, dword [esp + 0x30]
lea ecx, [eax + edx*4]
mov dword [esp + 0x18], ecx
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x3c]
cmp edx, eax
mov dword [esp + 0x34], edx
jge 0x4ba648
sub eax, edx
add dword [esp + 0x74], eax
lea ecx, [ecx]
test edx, edx
mov eax, dword [esp + 0x64]
jl 0x4ba603
test eax, eax
jl 0x4ba603
cmp edx, ebp
jge 0x4ba603
cmp eax, dword [esp + 0x54]
jge 0x4ba603
movzx eax, byte [ecx]
movzx edi, byte [ecx + 1]
sub eax, dword [esp + 0x1c]
sub edi, dword [esp + 0x20]
add ecx, 1
movzx ebp, byte [ecx + 1]
add ecx, 1
movzx ebx, byte [ecx + 1]
imul eax, ebx
imul edi, ebx
add ecx, 1
mov esi, eax
sub ebp, dword [esp + 0x14]
mov eax, 0x80808081
imul esi
imul ebp, ebx
add edx, esi
sar edx, 7
mov esi, edx
shr esi, 0x1f
add esi, edx
mov eax, 0x80808081
imul edi
add edx, edi
add esi, dword [esp + 0x1c]
sar edx, 7
mov edi, edx
shr edi, 0x1f
add edi, edx
add edi, dword [esp + 0x20]
mov eax, 0x80808081
imul ebp
add edx, ebp
mov ebp, dword [esp + 0x7c]
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
add ecx, 1
add eax, dword [esp + 0x14]
jmp 0x4ba614
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
add ecx, 4
xor ebx, ebx
mov edx, dword [esp + 0x34]
add dword [esp + 0x4c], esi
add dword [esp + 0x44], edi
add dword [esp + 0x38], eax
add dword [esp + 0x28], ebx
add edx, 1
cmp edx, dword [esp + 0x3c]
mov dword [esp + 0x34], edx
jl 0x4ba560
mov edi, dword [esp + 0x50]
mov ebx, dword [esp + 0xd8]
mov esi, dword [esp + 0x10]
mov edx, dword [esp + 0x64]
mov ecx, dword [esp + 0x18]
add edx, 1
lea eax, [ebp*4]
add ecx, eax
cmp edx, dword [esp + 0x48]
mov dword [esp + 0x64], edx
mov dword [esp + 0x18], ecx
jl 0x4ba543
mov ecx, dword [esp + 0x74]
test ecx, ecx
je 0x4ba7a0
mov eax, dword [esp + 0x4c]
cdq
idiv ecx
mov ebx, eax
mov eax, dword [esp + 0x44]
cdq
idiv ecx
mov dword [esp + 0x4c], ebx
mov ebp, eax
mov eax, dword [esp + 0x38]
cdq
idiv ecx
mov dword [esp + 0x44], ebp
mov edi, eax
mov eax, dword [esp + 0x28]
cdq
idiv ecx
test esi, esi
mov dword [esp + 0x38], edi
mov dword [esp + 0x28], eax
je 0x4ba793
movzx ebp, byte [esi]
movzx ebx, byte [esi + 1]
mov eax, dword [esp + 0x40]
add esi, 1
movzx ecx, byte [esi + 1]
add eax, 1
movzx edi, byte [eax + 1]
add esi, 1
add eax, 1
add eax, 1
mov dword [esp + 0x18], ecx
movzx ecx, byte [eax - 3]
add esi, 1
mov dword [esp + 0x40], eax
mov dword [esp + 0x10], esi
movzx esi, byte [eax - 2]
lea edx, [edi + esi]
add edx, ecx
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [esp + 0x18]
mov dword [esp + 0x48], eax
add edx, ebx
add edx, ebp
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [esp + 0x48]
sub eax, edx
add eax, 0xff
cmp eax, dword [esp + 0x28]
mov dword [esp + 0x50], ebx
jle 0x4ba733
mov dword [esp + 0x28], eax
sub ecx, ebp
imul ecx, dword [esp + 0x4c]
mov eax, 0x80808081
imul ecx
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
add ecx, ebp
mov ebp, dword [esp + 0x50]
sub esi, ebp
imul esi, dword [esp + 0x44]
mov eax, 0x80808081
imul esi
add edx, esi
mov esi, dword [esp + 0x18]
sar edx, 7
sub edi, esi
imul edi, dword [esp + 0x38]
mov eax, edx
shr eax, 0x1f
add eax, edx
add ebp, eax
mov eax, 0x80808081
imul edi
add edx, edi
mov ebx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
add ecx, esi
mov edi, ecx
mov ecx, ebx
mov ebx, dword [esp + 0x28]
mov esi, ebp
jmp 0x4ba960
xor edx, edx
mov eax, dword [esp + 0x30]
cmp eax, edx
jl 0x4ba844
cmp edi, edx
jl 0x4ba844
cmp eax, ebp
jge 0x4ba844
cmp edi, dword [esp + 0x54]
jge 0x4ba844
mov edx, dword [ebx]
imul ebp, edi
add ebp, eax
movzx ecx, byte [edx + ebp*4]
sub ecx, dword [esp + 0x1c]
lea eax, [edx + ebp*4]
movzx esi, byte [eax + 1]
sub esi, dword [esp + 0x20]
add eax, 1
movzx ebx, byte [eax + 2]
movzx edi, byte [eax + 1]
imul ecx, ebx
imul esi, ebx
add eax, 1
sub edi, dword [esp + 0x14]
mov eax, 0x80808081
imul ecx
imul edi, ebx
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov eax, 0x80808081
imul esi
add edx, esi
add ecx, dword [esp + 0x1c]
sar edx, 7
mov esi, edx
shr esi, 0x1f
add esi, edx
add esi, dword [esp + 0x20]
mov eax, 0x80808081
imul edi
add edx, edi
sar edx, 7
mov edi, edx
shr edi, 0x1f
add edi, edx
add edi, dword [esp + 0x14]
jmp 0x4ba852
mov ecx, dword [esp + 0x1c]
mov esi, dword [esp + 0x20]
mov edi, dword [esp + 0x14]
xor ebx, ebx
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4ba960
movzx edx, byte [eax]
movzx ebp, byte [eax + 1]
add eax, 1
add eax, 1
add eax, 1
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], edx
movzx edx, byte [eax - 1]
mov eax, dword [esp + 0x40]
add eax, 1
mov dword [esp + 0x34], edx
movzx edx, byte [eax - 1]
add eax, 1
mov dword [esp + 0x54], edx
movzx edx, byte [eax - 1]
add eax, 1
mov dword [esp + 0x3c], edx
movzx edx, byte [eax - 1]
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x7c], edx
add edx, eax
add edx, dword [esp + 0x54]
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [esp + 0x34]
mov dword [esp + 0x48], eax
add edx, ebp
add edx, dword [esp + 0x18]
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [esp + 0x48]
sub eax, edx
add eax, 0xff
cmp eax, ebx
mov dword [esp + 0x50], ebp
jle 0x4ba8f0
mov ebx, eax
mov ebp, dword [esp + 0x18]
mov eax, dword [esp + 0x54]
sub eax, ebp
imul eax, ecx
mov ecx, eax
mov eax, 0x80808081
imul ecx
mov eax, dword [esp + 0x3c]
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
add ecx, ebp
mov ebp, dword [esp + 0x50]
sub eax, ebp
imul eax, esi
mov esi, eax
mov eax, 0x80808081
imul esi
add edx, esi
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
add eax, ebp
mov ebp, dword [esp + 0x34]
mov esi, eax
mov eax, dword [esp + 0x7c]
sub eax, ebp
imul eax, edi
mov edi, eax
mov eax, 0x80808081
imul edi
add edx, edi
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
add eax, ebp
mov edi, eax
sub ecx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x8c]
imul ecx, dword [esp + 0xe0]
sub esi, dword [esp + 0x20]
mov eax, 0x80808081
imul ecx
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
add cl, byte [esp + 0x1c]
sub edi, dword [esp + 0x14]
mov byte [ebp], cl
mov ecx, dword [esp + 0xe0]
imul esi, ecx
imul edi, ecx
imul ebx, ecx
mov eax, 0x80808081
imul esi
add edx, esi
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
add al, byte [esp + 0x20]
add ebp, 1
mov byte [ebp], al
mov eax, 0x80808081
imul edi
add edx, edi
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
add al, byte [esp + 0x14]
add ebp, 1
mov esi, dword [esp + 0x10]
mov byte [ebp], al
mov eax, 0x80808081
imul ebx
add edx, ebx
mov ebx, dword [esp + 0xd8]
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ebp, 1
add ecx, edx
mov byte [ebp], cl
mov ecx, dword [esp + 0x6c]
add ebp, 1
sub dword [esp + 0x60], 1
mov dword [esp + 0x8c], ebp
jne 0x4ba4b7
mov ebp, dword [esp + 0x70]
mov edi, dword [esp + 0x68]
mov eax, 1
add dword [esp + 0x58], eax
sub dword [esp + 0x5c], eax
jne 0x4ba4a2
test esi, esi
je 0x4baa55
mov edx, dword [esp + 0x88]
push edx
call fcn.004a23a0
mov eax, dword [esp + 0x84]
push eax
call fcn.004a23a0
mov esi, dword [esp + 0x80]
mov ecx, dword [esp + 0xc4]
push 3
push ecx
call dword [sym.imp.GDI32.dll_SetStretchBltMode]
mov dword [esp + 0x6c], eax
xor eax, eax
mov dword [esp + 0xa0], eax
mov dword [esp + 0xa4], eax
mov dword [esp + 0x94], eax
mov dword [esp + 0x98], eax
mov dword [esp + 0x9c], eax
mov dword [esp + 0xa8], eax
mov dword [esp + 0xac], eax
mov dword [esp + 0xb0], eax
mov dword [esp + 0xb4], eax
mov dword [esp + 0xb8], eax
mov dword [esp + 0xa4], eax
mov eax, dword [esp + 0xc4]
mov edx, edi
neg edx
push eax
mov dword [esp + 0x98], 0x28
mov dword [esp + 0x9c], ebp
mov dword [esp + 0xa0], edx
mov word [esp + 0xa4], 1
mov word [esp + 0xa6], 0x20
call dword [0x581e80]
test al, 1
push 0xcc0020
push 0
je 0x4bab3c
mov edx, dword [ebx + 0xc]
mov ebx, dword [esp + 0xcc]
lea ecx, [esp + 0x9c]
push ecx
push edx
mov edx, dword [esp + 0x88]
push edi
mov eax, ebp
neg eax
push eax
push 0
lea ecx, [ebp - 1]
push ecx
push edi
push ebp
push edx
push esi
push ebx
call dword [sym.imp.GDI32.dll_StretchDIBits]
jmp 0x4bab6e
mov ecx, dword [ebx + 0xc]
mov edx, dword [esp + 0x80]
lea eax, [esp + 0x9c]
push eax
mov eax, dword [esp + 0xd0]
push ecx
push edi
push ebp
push 0
push 0
push edi
push ebp
push edx
push esi
push eax
call dword [sym.imp.GDI32.dll_StretchDIBits]
mov ebx, dword [esp + 0xc4]
mov ecx, dword [esp + 0x6c]
push ecx
push ebx
call dword [sym.imp.GDI32.dll_SetStretchBltMode]
mov edx, dword [esp + 0xdc]
push edx
push ebx
call fcn.004ab670
mov ecx, dword [esp + 0xd4]
mov edx, dword [esp + 0xd0]
mov ebx, eax
mov eax, dword [esp + 0x78]
push ebx
push edi
push ebp
push eax
mov eax, dword [esp + 0xdc]
push esi
push ecx
mov ecx, dword [esp + 0xe0]
push edx
mov edx, dword [esp + 0xe0]
push eax
push ecx
push edx
call fcn.004a8530
push ebx
call dword [sym.imp.GDI32.dll_DeleteObject]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xac
ret 0x24