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

Disassembly:
sub esp, 0x24
push ebx
push ebp
mov ebx, ecx
mov dword [esp + 8], 0
call fcn.00402650
mov ebp, dword [esp + 0x30]
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
mov dword [ebx + 0xb8], eax
jne 0x402851
pop ebp
pop ebx
add esp, 0x24
ret 8
mov ecx, dword [esp + 0x34]
push esi
push edi
mov dword [ebx + 0x74], ecx
mov ecx, 3
mov edi, 0x40a730
mov esi, eax
xor edx, edx
mov dword [ebx + 0xb4], eax
repe cmpsb byte [esi], byte es:[edi]
je 0x40296b
lea edx, [eax + 3]
mov ecx, 3
mov edi, 0x40a72c
mov esi, edx
xor ebp, ebp
repe cmpsb byte [esi], byte es:[edi]
jne 0x4028a1
mov esi, edx
mov ecx, 3
mov edi, 0x40a728
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x402967
mov esi, dword [esp + 0x38]
push esi
mov dword [ebx + 0xb8], 0
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
lea eax, [esp + 0x10]
push eax
push 0
push esi
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
jne 0x402a57
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x10]
lea esi, [ebx + 0xb0]
push esi
push 0x40b9fc
push eax
push ecx
push edx
call dword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
test eax, eax
mov eax, dword [esp + 0x10]
push eax
jne 0x402a52
mov edx, dword [eax]
call dword [edx + 8]
mov eax, dword [esi]
mov ecx, dword [eax]
lea edx, [esp + 0x38]
push edx
push eax
call dword [ecx + 0x18]
mov eax, dword [esi]
mov ecx, dword [eax]
lea edx, [esp + 0x14]
push edx
push eax
call dword [ecx + 0x1c]
mov eax, dword [ebx + 0x20]
push eax
call dword [sym.imp.USER32.dll_GetDC]
mov edi, dword [sym.imp.GDI32.dll_GetDeviceCaps]
push 0x9ec
mov esi, eax
push 0x58
push esi
call edi
mov ecx, dword [esp + 0x3c]
mov ebp, dword [sym.imp.KERNEL32.dll_MulDiv]
push eax
push ecx
call ebp
push 0x9ec
push 0x5a
push esi
mov dword [ebx + 0x64], eax
call edi
mov edx, dword [esp + 0x18]
push eax
push edx
call ebp
mov dword [ebx + 0x68], eax
mov eax, dword [ebx + 0x20]
push esi
push eax
call dword [sym.imp.USER32.dll_ReleaseDC]
jmp 0x402b5c
mov ebp, dword [esp + 0x38]
lea esi, [eax + 6]
mov dword [ebx + 0x80], 1
mov dword [ebx + 0xbc], esi
movzx ecx, byte [esi + 4]
mov edx, ecx
sar edx, 7
cmp edx, 1
jne 0x4029b6
and ecx, 7
inc ecx
shl edx, cl
lea ecx, [edx + edx*2]
mov dword [ebx + 0x7c], ecx
movzx ecx, byte [esi + 5]
lea edx, [eax + ecx*2]
lea eax, [ecx + edx + 0xd]
movzx edx, byte [eax]
xor ecx, ecx
mov ch, byte [eax + 2]
mov cl, byte [eax + 1]
shl ecx, 8
or ecx, edx
mov dword [ebx + 0x6c], ecx
movzx eax, word [esi]
mov edx, dword [ebx + 0x7c]
mov dword [ebx + 0x64], eax
movzx ecx, word [esi + 2]
mov dword [ebx + 0x68], ecx
add edx, 0xd
mov ecx, ebx
xor edi, edi
xor esi, esi
mov dword [ebx + 0x78], edx
call fcn.00401af0
test eax, eax
je 0x4029f0
jmp 0x4029e0
mov ecx, ebx
inc esi
call fcn.00401af0
test eax, eax
jne 0x4029e0
cmp esi, edi
jne 0x402a09
push ebp
mov dword [ebx + 0xb8], edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret 8
cmp esi, 1
jne 0x402a6d
push ebp
mov dword [ebx + 0xb8], edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
lea eax, [esp + 0x10]
push eax
push edi
push ebp
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
jne 0x402a57
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x10]
lea ecx, [ebx + 0xb0]
push ecx
push 0x40b9fc
push edi
push edx
push eax
call dword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
test eax, eax
mov eax, dword [esp + 0x10]
push eax
je 0x402a63
mov ecx, dword [eax]
call dword [ecx + 8]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret 8
mov edx, dword [eax]
call dword [edx + 8]
jmp 0x402b5c
mov eax, dword [ebx + 0x7c]
add eax, 0xd
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x28]
push edx
mov dword [ebx + 0x78], eax
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x38]
push ecx
lea edx, [esp + 0x24]
push edx
mov ecx, ebx
call fcn.00401860
mov esi, eax
cmp esi, edi
je 0x402b3c
mov edi, dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
mov ebp, dword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
lea esp, [esp]
lea eax, [esp + 0x3c]
push eax
push 1
push esi
mov dword [esp + 0x48], 0
call edi
test eax, eax
je 0x402acf
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x402b0c
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x3c]
lea ecx, [esp + 0x18]
push ecx
push 0x40b9fc
push 0
push edx
push eax
call ebp
test eax, eax
mov eax, dword [esp + 0x3c]
push eax
je 0x402af7
mov ecx, dword [eax]
call dword [ecx + 8]
jmp 0x402b0c
mov edx, dword [eax]
call dword [edx + 8]
lea eax, [esp + 0x18]
push eax
lea ecx, [ebx + 0xc0]
call fcn.004024e0
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x38]
push ecx
lea edx, [esp + 0x24]
push edx
mov ecx, ebx
call fcn.00401860
mov esi, eax
test esi, esi
jne 0x402ab0
mov ebp, dword [esp + 0x38]
xor edi, edi
push ebp
mov dword [ebx + 0xb8], edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
lea ecx, [ebx + 0xc0]
call fcn.004016e0
test al, al
jne 0x402a57
mov eax, dword [ebx + 0x68]
mov ecx, dword [ebx + 0x64]
push eax
push ecx
mov ecx, ebx
call fcn.00401570
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret 8