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

Disassembly:
push 0xffffffffffffffff
push 0x621e8f
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc8
push ebx
push ebp
push esi
mov esi, dword [esp + 0xe8]
mov ebp, ecx
push edi
lea ebx, [esi + 8]
mov eax, ebx
mov ecx, dword [eax]
mov dword [esp + 0x34], ecx
mov edx, dword [eax + 4]
mov dword [esp + 0x38], edx
mov ecx, dword [eax + 8]
mov dword [esp + 0x3c], ecx
mov edx, dword [eax + 0xc]
mov al, byte [esi + 0x28]
mov cl, al
mov dword [esp + 0x40], edx
and cl, 8
jne 0x541a14
test al, 2
jne 0x541a14
mov ecx, dword [esi + 4]
mov edx, dword [esi]
mov eax, dword [ebp]
push ecx
push edx
push 0x3e8
mov ecx, ebp
call dword [eax + 0x38]
mov ecx, dword [ebx + 4]
mov edx, dword [ebx + 8]
mov edi, eax
mov eax, dword [ebx]
mov dword [esp + 0x80], ecx
mov dword [esp + 0x7c], eax
mov eax, dword [ebx + 0xc]
mov ebx, dword [sym.imp.USER32.dll_InflateRect]
push 0xffffffffffffffff
lea ecx, [esp + 0x80]
push 0xffffffffffffffff
push ecx
mov dword [esp + 0x20], edi
mov dword [esp + 0x90], edx
mov dword [esp + 0x94], eax
call ebx
push edi
mov edi, dword [esp + 0xec]
lea edx, [esp + 0x80]
mov ecx, edi
push edx
call fcn.005ee0f0
mov eax, dword [edi + 8]
push 0xc
push eax
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
test byte [esi + 0x28], 4
je 0x541700
xor ecx, ecx
mov dword [esp + 0x18], vtable.CBrush.0
mov dword [esp + 0x1c], ecx
mov dword [esp + 0xe0], 1
mov dword [esp + 0x28], ecx
mov dword [esp + 0x24], vtable.CBitmap.0
cmp eax, 8
mov byte [esp + 0xe0], 2
jg 0x541451
push 0x6b095c
push 1
push 1
push 8
push 8
call dword [sym.imp.GDI32.dll_CreateBitmap]
push eax
lea ecx, [esp + 0x28]
call fcn.005e1342
jmp 0x541626
lea ecx, [esp + 0x44]
call fcn.005e073b
test edi, edi
mov byte [esp + 0xe0], 3
jne 0x54146a
xor eax, eax
jmp 0x54146d
mov eax, dword [edi + 4]
push eax
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
push eax
lea ecx, [esp + 0x48]
call fcn.005e07f2
mov ecx, dword [edi + 4]
push 8
push 8
push ecx
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
push eax
lea ecx, [esp + 0x28]
call fcn.005e1342
mov edx, dword [esp + 0x28]
lea eax, [esp + 0x24]
neg eax
sbb eax, eax
and eax, edx
mov edx, dword [esp + 0x48]
push eax
push edx
call fcn.005e0933
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x14]
push eax
push 8
push 8
push 0
push 0
lea ecx, [esp + 0x58]
call fcn.005ee11a
mov eax, dword [esi + 4]
mov ecx, dword [esi]
mov edx, dword [ebp]
push eax
push ecx
push 0xf
mov ecx, ebp
call dword [edx + 0x38]
mov ecx, dword [esi]
mov edx, dword [ebp]
mov ebx, eax
mov eax, dword [esi + 4]
push eax
push ecx
push 0x10
mov ecx, ebp
mov dword [esp + 0x1c], ebx
call dword [edx + 0x38]
mov edx, ebx
mov ecx, eax
shr edx, 0x10
shr eax, 0x10
and edx, 0xff
and eax, 0xff
lea edx, [eax + edx*2]
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add edx, eax
xor eax, eax
mov ah, dl
xor edx, edx
mov dl, bh
xor ebx, ebx
mov bl, ch
and edx, 0xff
and ebx, 0xff
mov dword [esp + 0x14], eax
mov eax, 0x55555556
lea edx, [ebx + edx*2]
mov ebx, dword [esp + 0x14]
imul edx
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, dword [esp + 0x10]
mov bl, dl
shl ebx, 8
and eax, 0xff
and ecx, 0xff
lea ecx, [ecx + eax*2]
mov eax, 0x55555556
imul ecx
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
and edx, 0xff
or ebx, edx
mov edx, dword [esp + 0x4c]
mov eax, ebx
push eax
push edx
call dword [sym.imp.GDI32.dll_GetNearestColor]
push eax
push 1
push 0
lea ecx, [esp + 0x38]
call fcn.005e13af
lea eax, [esp + 0x2c]
lea ecx, [esp + 0x44]
push eax
mov byte [esp + 0xe4], 4
call fcn.005e0986
mov dword [esp + 0x14], eax
xor ebx, ebx
push ebx
lea ecx, [esp + 0x68]
push 0
push ecx
lea ecx, [esp + 0x50]
call fcn.005e0dd6
push ebx
push 8
lea ecx, [esp + 0x4c]
call fcn.005e0e22
add ebx, 2
cmp ebx, 8
jl 0x5415ad
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x44]
push edx
call fcn.005e0986
mov eax, dword [esp + 0x20]
test eax, eax
je 0x5415eb
mov eax, dword [eax + 4]
push eax
mov eax, dword [esp + 0x4c]
push eax
call fcn.005e0933
mov dword [esp + 0x2c], vtable.CGdiObject.0
lea ecx, [esp + 0x2c]
mov byte [esp + 0xe0], 5
call fcn.005e1399
lea ecx, [esp + 0x44]
mov byte [esp + 0xe0], 2
call fcn.005e0870
mov ebx, dword [sym.imp.USER32.dll_InflateRect]
mov edx, dword [esp + 0x28]
lea eax, [esp + 0x24]
neg eax
sbb eax, eax
and eax, edx
push eax
call dword [sym.imp.GDI32.dll_CreatePatternBrush]
push eax
lea ecx, [esp + 0x1c]
call fcn.005e1342
push 0xfffffffffffffffe
lea ecx, [esp + 0x38]
push 0xfffffffffffffffb
push ecx
call ebx
mov edx, dword [esp + 0x34]
push 0
lea eax, [esp + 0x38]
add edx, 5
push 0xffffffffffffffff
push eax
mov dword [esp + 0x48], edx
call ebx
mov eax, dword [esi + 4]
mov ecx, dword [esi]
mov edx, dword [ebp]
mov ebx, dword [edi]
push eax
push ecx
push 0x7d1
mov ecx, ebp
call dword [edx + 0x38]
push eax
mov ecx, edi
call dword [ebx + 0x2c]
lea edx, [esp + 0x18]
mov ecx, edi
push edx
mov esi, eax
call fcn.005e0986
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x34]
mov ebx, eax
mov eax, dword [esp + 0x40]
sub ecx, ebp
sub eax, edx
push 0xa000c9
push eax
mov eax, dword [edi + 4]
push ecx
push edx
push ebp
push eax
call dword [sym.imp.GDI32.dll_PatBlt]
push ebx
mov ecx, edi
call fcn.005e0986
mov edx, dword [edi]
push esi
mov ecx, edi
call dword [edx + 0x2c]
mov esi, vtable.CGdiObject.0
mov dword [esp + 0x24], esi
lea ecx, [esp + 0x24]
mov byte [esp + 0xe0], 6
call fcn.005e1399
mov dword [esp + 0x18], esi
lea ecx, [esp + 0x18]
mov dword [esp + 0xe0], 7
call fcn.005e1399
jmp 0x541d6e
xor ecx, ecx
mov dword [esp + 0x2c], vtable.CBrush.0
mov dword [esp + 0x30], ecx
mov dword [esp + 0xe0], 8
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], vtable.CBitmap.0
cmp eax, 8
mov byte [esp + 0xe0], 9
jg 0x541754
push 0x6b096c
push 1
push 1
push 8
push 8
call dword [sym.imp.GDI32.dll_CreateBitmap]
push eax
lea ecx, [esp + 0x1c]
call fcn.005e1342
jmp 0x54192b
lea ecx, [esp + 0x54]
call fcn.005e073b
test edi, edi
mov byte [esp + 0xe0], 0xa
jne 0x54176d
xor eax, eax
jmp 0x541770
mov eax, dword [edi + 4]
push eax
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
push eax
lea ecx, [esp + 0x58]
call fcn.005e07f2
mov eax, dword [edi + 4]
push 8
push 8
push eax
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
push eax
lea ecx, [esp + 0x1c]
call fcn.005e1342
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x58]
lea eax, [esp + 0x18]
neg eax
sbb eax, eax
and eax, edx
push eax
push ecx
call fcn.005e0933
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x54]
push edx
push 8
push 8
push 0
push 0
mov dword [esp + 0x24], eax
call fcn.005ee11a
mov ecx, dword [esi + 4]
mov edx, dword [esi]
mov eax, dword [ebp]
push ecx
push edx
push 0xf
mov ecx, ebp
call dword [eax + 0x38]
mov ecx, dword [esi + 4]
mov edx, dword [esi]
mov ebx, eax
mov eax, dword [ebp]
push ecx
push edx
push 0x10
mov ecx, ebp
mov dword [esp + 0x20], ebx
call dword [eax + 0x38]
mov ecx, eax
mov eax, ebx
mov edx, ecx
shr eax, 0x10
shr edx, 0x10
and eax, 0xff
and edx, 0xff
lea edx, [edx + eax*2]
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add edx, eax
xor eax, eax
mov ah, dl
xor edx, edx
mov dl, bh
xor ebx, ebx
mov bl, ch
and edx, 0xff
and ebx, 0xff
mov dword [esp + 0x20], eax
mov eax, 0x55555556
lea edx, [ebx + edx*2]
mov ebx, dword [esp + 0x20]
imul edx
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, dword [esp + 0x14]
mov bl, dl
shl ebx, 8
and eax, 0xff
and ecx, 0xff
lea ecx, [ecx + eax*2]
mov eax, 0x55555556
imul ecx
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
and edx, 0xff
or ebx, edx
mov edx, dword [esp + 0x5c]
mov eax, ebx
push eax
push edx
call dword [sym.imp.GDI32.dll_GetNearestColor]
push eax
push 1
push 0
lea ecx, [esp + 0x70]
call fcn.005e13af
lea eax, [esp + 0x64]
lea ecx, [esp + 0x54]
push eax
mov byte [esp + 0xe4], 0xb
call fcn.005e0986
mov dword [esp + 0x20], eax
xor ebx, ebx
push 0
lea ecx, [esp + 0x48]
push ebx
push ecx
lea ecx, [esp + 0x60]
call fcn.005e0dd6
push 8
push ebx
lea ecx, [esp + 0x5c]
call fcn.005e0e22
add ebx, 2
cmp ebx, 8
jl 0x5418b2
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x54]
push edx
call fcn.005e0986
mov eax, dword [esp + 0x10]
test eax, eax
je 0x5418f0
mov eax, dword [eax + 4]
push eax
mov eax, dword [esp + 0x5c]
push eax
call fcn.005e0933
mov dword [esp + 0x64], vtable.CGdiObject.0
lea ecx, [esp + 0x64]
mov byte [esp + 0xe0], 0xc
call fcn.005e1399
lea ecx, [esp + 0x54]
mov byte [esp + 0xe0], 9
call fcn.005e0870
mov ebx, dword [sym.imp.USER32.dll_InflateRect]
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x18]
neg eax
sbb eax, eax
and eax, ecx
push eax
call dword [sym.imp.GDI32.dll_CreatePatternBrush]
push eax
lea ecx, [esp + 0x30]
call fcn.005e1342
push 0
lea ecx, [esp + 0x38]
push 1
push ecx
call dword [sym.imp.USER32.dll_OffsetRect]
push 0xfffffffffffffffb
lea edx, [esp + 0x38]
push 0xfffffffffffffffe
push edx
call ebx
mov eax, dword [esp + 0x38]
push 0xffffffffffffffff
lea ecx, [esp + 0x38]
add eax, 5
push 0
push ecx
mov dword [esp + 0x4c], eax
call ebx
mov eax, dword [esi + 4]
mov ecx, dword [esi]
mov edx, dword [ebp]
mov ebx, dword [edi]
push eax
push ecx
push 0x7d1
mov ecx, ebp
call dword [edx + 0x38]
push eax
mov ecx, edi
call dword [ebx + 0x2c]
lea edx, [esp + 0x2c]
mov ecx, edi
push edx
mov esi, eax
call fcn.005e0986
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x34]
mov ebx, eax
mov eax, dword [esp + 0x40]
sub ecx, ebp
sub eax, edx
push 0xa000c9
push eax
mov eax, dword [edi + 4]
push ecx
push edx
push ebp
push eax
call dword [sym.imp.GDI32.dll_PatBlt]
push ebx
mov ecx, edi
call fcn.005e0986
mov edx, dword [edi]
push esi
mov ecx, edi
call dword [edx + 0x2c]
mov esi, vtable.CGdiObject.0
mov dword [esp + 0x18], esi
lea ecx, [esp + 0x18]
mov byte [esp + 0xe0], 0xd
call fcn.005e1399
mov dword [esp + 0x2c], esi
lea ecx, [esp + 0x2c]
mov dword [esp + 0xe0], 0xe
call fcn.005e1399
jmp 0x541d6e
test cl, cl
je 0x541a2a
and al, 1
neg al
sbb eax, eax
and eax, 0xfffff83d
add eax, 0x7d0
jmp 0x541a2f
mov eax, 0x10
mov ecx, dword [esi + 4]
mov edx, dword [ebp]
push ecx
mov ecx, dword [esi]
push ecx
push eax
mov ecx, ebp
call dword [edx + 0x38]
mov cl, byte [esi + 0x30]
mov ebx, dword [esp + 0xe8]
test cl, 2
jne 0x541a5b
lea edx, [esp + 0x34]
push eax
push edx
mov ecx, ebx
call fcn.005ee0f0
mov al, byte [esi + 0x28]
test al, 8
je 0x541a8d
test byte [esi + 0x30], 2
jne 0x541a8d
test al, 3
jne 0x541a8d
mov ecx, dword [esi + 4]
mov edx, dword [esi]
mov eax, dword [ebp]
push ecx
push edx
push 0x10
mov ecx, ebp
call dword [eax + 0x38]
push eax
push eax
lea eax, [esp + 0x3c]
push eax
push ebx
call fcn.0053b770
add esp, 0x10
mov edi, dword [esi + 0x2c]
test edi, edi
je 0x541d6e
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
test ecx, ecx
mov dword [esp + 0x10], ecx
jle 0x541d6e
lea edi, [esi + 0x18]
push edi
mov dword [esp + 0x18], edi
call dword [sym.imp.USER32.dll_IsRectEmpty]
test eax, eax
jne 0x541d6e
mov ecx, dword [esi + 0x20]
mov eax, dword [edi]
cmp ecx, eax
jle 0x541d6e
mov edx, dword [esi + 0x24]
mov eax, dword [esi + 0x1c]
cmp edx, eax
jle 0x541d6e
mov al, byte [esi + 0x28]
test al, 1
jne 0x541af8
test al, 8
je 0x541af8
mov ecx, dword [esi + 4]
mov edx, dword [esi]
mov eax, dword [ebp]
push ecx
push edx
push 0x12
jmp 0x541b04
mov ecx, dword [esi + 4]
mov edx, dword [esi]
mov eax, dword [ebp]
push ecx
push edx
push 9
mov ecx, ebp
call dword [eax + 0x38]
mov edx, dword [ebx]
push eax
mov ecx, ebx
call dword [edx + 0x30]
push 1
mov ecx, ebx
mov dword [esp + 0x28], eax
call fcn.005e0a1d
mov dword [esp + 0x18], eax
mov al, byte [esi + 0x28]
test al, 4
jne 0x541b3d
test al, 8
je 0x541b35
add ebp, 0xe0
jmp 0x541b4f
add ebp, 0xf8
jmp 0x541b4f
test al, 8
je 0x541b49
add ebp, 0xf0
jmp 0x541b4f
add ebp, 0x108
mov eax, dword [ebx]
push ebp
mov ecx, ebx
call dword [eax + 0x28]
mov dword [esp + 0x2c], eax
mov al, byte [esi + 0x28]
test al, 4
jne 0x541c60
mov cl, byte [esi + 0x30]
push 0x6599f0
shr ecx, 1
and ecx, 2
mov edi, ecx
mov ecx, dword [esi]
call fcn.005dda74
test eax, eax
je 0x541c3f
mov ecx, dword [esi]
call fcn.005a3110
test eax, eax
je 0x541c3f
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xf4]
test al, al
je 0x541c3f
mov eax, dword [esi + 0x2c]
lea ecx, [esp + 0x10]
push eax
call fcn.005dd21e
mov eax, dword [esp + 0x14]
mov dword [esp + 0xe0], 0
mov esi, dword [eax + 8]
mov ecx, dword [eax]
sub esi, ecx
lea ecx, [esp + 0x10]
push ecx
push ebp
push ebx
call fcn.00538140
add esp, 0xc
cmp esi, eax
jge 0x541c06
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx - 8]
test eax, eax
je 0x541c0a
dec eax
push 1
push eax
lea ecx, [esp + 0x18]
call fcn.005d5128
lea edx, [esp + 0x10]
push edx
push ebp
push ebx
call fcn.00538140
add esp, 0xc
cmp esi, eax
jl 0x541bdb
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx - 8]
test eax, eax
jle 0x541c26
mov esi, dword [esp + 0x14]
mov edx, dword [ebx]
or edi, 0x124
push edi
push esi
push eax
push ecx
mov ecx, ebx
call dword [edx + 0x68]
lea ecx, [esp + 0x10]
mov dword [esp + 0xe0], 0xffffffff
call fcn.005dd1b0
jmp 0x541d4a
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov eax, dword [ebx]
or edi, 0x8024
push edi
push ecx
mov ecx, dword [esi + 0x2c]
push edx
push ecx
mov ecx, ebx
call dword [eax + 0x68]
jmp 0x541d4a
mov ecx, 0xf
xor eax, eax
lea edi, [esp + 0x9c]
lea edx, [esp + 0x9c]
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 4]
push edx
push 0x3c
push eax
call dword [sym.imp.GDI32.dll_GetObjectA]
mov ecx, dword [esp + 0x14]
push 0xfffffffffffffffe
push 0xfffffffffffffffe
mov ebp, dword [ecx + 0xc]
mov eax, dword [ecx + 4]
mov edi, dword [ecx + 8]
mov edx, dword [ecx]
sub ebp, eax
mov eax, dword [esp + 0xa4]
sub edi, edx
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ecx]
mov dword [esp + 0x28], eax
mov eax, dword [ecx + 8]
sub eax, edx
mov edx, dword [esp + 0x28]
mov ecx, dword [ecx]
sub eax, edx
cdq
sub eax, edx
lea edx, [esp + 0x74]
sar eax, 1
push edx
lea eax, [eax + ecx + 1]
mov ecx, dword [esi + 0x24]
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
add eax, edi
add ecx, ebp
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], ecx
call dword [sym.imp.USER32.dll_InflateRect]
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x10]
mov edx, dword [esi + 0xc]
push eax
mov eax, dword [esi + 8]
push ecx
push edx
lea ecx, [esp + 0x98]
push eax
push ecx
call dword [sym.imp.USER32.dll_SetRect]
lea edx, [esp + 0x8c]
mov ecx, ebx
push edx
call fcn.005e0d52
push 0xfffffffffffffffd
lea eax, [esp + 0x70]
push 0xfffffffffffffffe
push eax
call dword [sym.imp.USER32.dll_OffsetRect]
mov ecx, dword [esp + 0x10]
mov edx, dword [ebx]
lea eax, [esp + 0x6c]
push 0x920
push eax
mov eax, dword [esi + 0x2c]
push ecx
push eax
mov ecx, ebx
call dword [edx + 0x68]
push 0
mov ecx, ebx
call fcn.005e0d12
mov eax, dword [esp + 0x2c]
mov edx, dword [ebx]
push eax
mov ecx, ebx
call dword [edx + 0x28]
mov ecx, dword [esp + 0x18]
push ecx
mov ecx, ebx
call fcn.005e0a1d
mov eax, dword [esp + 0x24]
mov edx, dword [ebx]
push eax
mov ecx, ebx
call dword [edx + 0x30]
mov ecx, dword [esp + 0xd8]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xd4
ret 8