Function at 0x6607bea1
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [ebp + 0x18]
push ebx
xor ebx, ebx
push esi
cmp eax, ebx
push edi
mov dword [ebp - 0x20], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x18], ebx
je 0x6607bec1
mov dword [eax], ebx
movzx eax, word [ebp + 0xc]
push 2
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
cmp esi, ebx
jne 0x6607bee0
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x14
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push esi
mov edi, eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov esi, eax
test esi, esi
mov dword [ebp - 0x1c], esi
je 0x6607c062
cmp dword [ebp + 0x14], 0
je 0x6607c0c8
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
mov dword [ebp - 0x18], 1
test ebx, ebx
je 0x6607c073
mov ecx, edi
mov edi, ebx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
test ebx, ebx
je 0x6607c073
cmp dword [ebx], 0x28
jne 0x6607c062
mov cx, word [ebx + 0xe]
cmp cx, 0x10
jae 0x6607c062
mov edi, dword [ebx + 0x20]
xor esi, esi
cmp edi, esi
jne 0x6607bf66
push 1
pop edi
shl edi, cl
push esi
call dword [sym.imp.USER32.dll_GetDC]
cmp dword [ebp + 0x18], esi
mov dword [ebp - 8], eax
je 0x6607bfa6
cmp dword [0x6610f5e8], esi
je 0x6607bfa6
lea eax, [edi*4 + 8]
push eax
push esi
push dword [0x6610e6c0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, esi
mov dword [ebp - 4], eax
je 0x6607c062
mov word [eax], 0x300
mov word [eax + 2], di
cmp edi, esi
jle 0x6607c01c
mov eax, dword [ebp - 4]
mov dword [ebp - 0x14], edi
add eax, 4
mov dword [ebp - 0x10], eax
lea eax, [ebx + 0x28]
cmp dword [ebp + 0x14], esi
mov dword [ebp - 0xc], esi
jle 0x6607bff0
mov esi, dword [ebp + 0x10]
mov edx, dword [esi]
xor ecx, ecx
mov cl, byte [esi + 1]
mov ch, byte [esi]
shr edx, 0x10
movzx edx, dl
shl ecx, 8
or ecx, edx
cmp dword [eax], ecx
je 0x6607c0cf
inc dword [ebp - 0xc]
add esi, 8
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp + 0x14]
jl 0x6607bfc4
xor esi, esi
cmp dword [ebp - 4], esi
je 0x6607c010
mov edx, dword [eax]
xor ecx, ecx
mov ch, byte [eax]
mov cl, byte [eax + 1]
shr edx, 0x10
movzx edx, dl
shl ecx, 8
or ecx, edx
mov edx, dword [ebp - 0x10]
xor esi, esi
mov dword [edx], ecx
add dword [ebp - 0x10], 4
add eax, 4
dec dword [ebp - 0x14]
jne 0x6607bfb9
cmp dword [ebp - 8], esi
je 0x6607c062
cmp dword [ebp - 4], esi
je 0x6607c04c
push dword [ebp - 4]
call dword [sym.imp.GDI32.dll_CreatePalette]
mov ecx, dword [ebp + 0x18]
cmp eax, esi
mov dword [ecx], eax
je 0x6607c04c
push esi
push eax
push dword [ebp - 8]
call dword [sym.imp.GDI32.dll_SelectPalette]
push dword [ebp - 8]
call dword [sym.imp.GDI32.dll_RealizePalette]
push esi
lea eax, [ebx + edi*4 + 0x28]
push ebx
push eax
push 4
push ebx
push dword [ebp - 8]
call dword [sym.imp.GDI32.dll_CreateDIBitmap]
mov dword [ebp - 0x20], eax
test ebx, ebx
je 0x6607c073
cmp dword [ebp - 0x18], 0
je 0x6607c073
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 0x1c], 0
je 0x6607c082
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_FreeResource]
cmp dword [ebp - 4], 0
je 0x6607c099
push dword [ebp - 4]
push 0
push dword [0x6610e6c0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [ebp - 8], 0
je 0x6607c0aa
push dword [ebp - 8]
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, dword [ebp - 0x20]
test eax, eax
jne 0x6607bed9
movzx eax, word [ebp + 0xc]
push eax
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_LoadBitmapA]
jmp 0x6607bed9
mov ebx, esi
jmp 0x6607bf39
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 0xc]
lea esi, [ecx + edx*8 + 4]
xor ecx, ecx
mov edx, dword [esi]
mov cl, byte [esi + 1]
mov ch, byte [esi]
shr edx, 0x10
movzx edx, dl
shl ecx, 8
or ecx, edx
mov dword [eax], ecx
jmp 0x6607bfee