Function at 0x46d820
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5ac48d
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x6244f8]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x10], esi
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
push 0xe
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
test eax, eax
je 0x46d908
cmp dword [ebp + 0x18], 0
je 0x46d908
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
je 0x46d8d9
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ecx, eax
test ecx, ecx
je 0x46d8d9
movzx edi, word [ecx + 4]
sub edi, 1
js 0x46d8d9
mov edx, dword [ebp + 0x10]
lea eax, [edi*8]
sub eax, edi
lea esi, [ecx + 7]
mov ecx, dword [ebp + 0x14]
lea esi, [esi + eax*2]
movzx eax, byte [esi - 1]
cmp eax, edx
jne 0x46d8d1
movzx eax, byte [esi]
cmp eax, ecx
jne 0x46d8d1
movzx eax, word [esi + 0xb]
push 0
push ecx
mov ecx, dword [ebp - 0x10]
push edx
push eax
push ebx
call fcn.0046d820
test eax, eax
jne 0x46d8ef
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
sub esi, 0xe
sub edi, 1
jns 0x46d8a6
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
push 3
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [ebp + 0xc], eax
test eax, eax
je 0x46d8d9
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
je 0x46d8d9
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edi, eax
mov dword [ebp + 8], edi
test edi, edi
je 0x46d8d9
push dword [ebp + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
cmp word [edi + 0xe], 0x20
jne 0x46da53
lea ecx, [ebp - 0x20]
call fcn.0054579f
push 0
mov dword [ebp - 4], 0
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
push eax
lea ecx, [ebp - 0x20]
call fcn.005460a8
push 0x34
call fcn.00574fb6
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x46da46
mov esi, edi
mov dword [ebp + 0xc], 0
mov ecx, 0xa
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebx + 8]
mov ecx, dword [ebx + 4]
cdq
sub eax, edx
push 0
sar eax, 1
push 0
imul ecx, eax
mov dword [ebx + 8], eax
lea eax, [ebp + 0xc]
push eax
push 0
push ebx
push dword [ebp - 0x1c]
shl ecx, 2
mov dword [ebx + 0x14], ecx
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov edx, dword [ebp + 0xc]
mov esi, eax
test edx, edx
je 0x46da3d
test esi, esi
je 0x46da3d
mov eax, dword [ebp + 8]
mov ecx, dword [ebx + 0x14]
add eax, 0x28
test ecx, ecx
je 0x46da01
push ecx
test eax, eax
je 0x46d9e6
push eax
push edx
call fcn.00570860
add esp, 0xc
jmp 0x46da01
push 0
push edx
call fcn.00570de0
add esp, 0xc
call fcn.0057524b
mov dword [eax], 0x16
call fcn.00574b40
push esi
mov esi, dword [ebp - 0x10]
mov ecx, esi
call fcn.0046bae0
push ebx
call fcn.00574f9b
add esp, 4
lea ecx, [ebp - 0x20]
call fcn.005458b1
mov ecx, esi
call fcn.0046ff00
neg eax
sbb eax, eax
inc eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
push ebx
call fcn.00574f9b
add esp, 4
lea ecx, [ebp - 0x20]
call fcn.005458b1
jmp 0x46d8d9
push 0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push 0x30000
push 1
push eax
push edi
call dword [sym.imp.USER32.dll_CreateIconFromResourceEx]
push eax
mov ecx, esi
call fcn.0046bb20
mov ecx, esi
call fcn.0046ff00
neg eax
sbb eax, eax
inc eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14