Function at 0x402ef0
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push edi
lea edi, [esp + 8]
and esp, 0xfffffff8
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x58
mov dword [ebp - 0x30], eax
mov eax, ecx
mov dword [ebp - 0x28], ecx
movzx ecx, word [ecx + 4]
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x20], 0
test cx, cx
je 0x403432
imul ecx, ecx, 0xe
lea edx, [eax + 0xe]
xor eax, eax
add ecx, edx
lea esi, [esi]
add eax, dword [edx]
add edx, 0xe
cmp ecx, edx
jne 0x402f30
call dbg.xmalloc
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x28]
movzx eax, word [eax + 4]
shl eax, 4
call dbg.xmalloc
mov dword [esp + 4], 1
mov dword [ebp - 0x48], eax
lea eax, [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp], 0
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
sub esp, 0xc
test eax, eax
js 0x403290
mov ecx, dword [ebp - 0x30]
test ecx, ecx
je 0x4030f0
mov eax, dword [ebp - 0x28]
cmp word [eax + 4], 0
je 0x403214
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x24], 0
lea edi, [eax + 6]
nop
mov ecx, dword [ebp - 0x30]
mov eax, dword [ecx + 8]
movzx esi, word [eax + 2]
test esi, esi
je 0x403020
mov edx, dword [ecx]
mov ecx, dword [ecx + 4]
lea ebx, [eax + 0x14]
mov dword [ebp - 0x3c], edx
add edx, ecx
mov dword [ebp - 0x38], ecx
mov ecx, edx
cmp edx, ebx
jb 0x403253
movzx edx, word [edi + 0xc]
or dx, 0x8000
mov word [ebp - 0x2c], dx
cmp dx, word [eax + 0xe]
je 0x403410
xor eax, eax
mov dword [ebp - 0x34], edi
add eax, 1
cmp eax, esi
je 0x40301d
lea edx, [ebx + 0xc]
cmp edx, ecx
ja 0x403250
movzx edi, word [ebp - 0x2c]
cmp word [edx - 6], di
je 0x4032d3
add eax, 1
mov ebx, edx
cmp eax, esi
jne 0x402ffb
mov edi, dword [ebp - 0x34]
mov eax, dword [ebp - 0x28]
add dword [ebp - 0x24], 1
add edi, 0xe
mov esi, dword [ebp - 0x24]
movzx eax, word [eax + 4]
cmp esi, eax
jl 0x402fb0
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x403214
movzx eax, word [ebp - 0x40]
mov dword [ebp - 0x16], 0x10000
lea ecx, [ebp - 0x16]
lea ebx, [ebp - 0x1c]
mov word [ebp - 0x12], ax
mov eax, dword [ebp - 0x20]
mov edx, dword [eax]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 6
mov dword [esp + 4], ecx
mov dword [esp], eax
call dword [edx + 0x10]
sub esp, 0x10
mov edi, eax
test eax, eax
js 0x403420
cmp dword [ebp - 0x1c], 6
je 0x403355
test byte [0x40d000], 2
je 0x403221
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], str.error_0x_08lX_writing_icon_stream_n
mov dword [esp + 8], global___func__.7
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.18
mov eax, dword [ebp - 0x4c]
mov ebx, dword [sym.imp.ucrtbase.dll_free]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x20]
test edi, edi
js 0x4032b6
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov edx, dword [ebp - 0x24]
test edx, edx
je 0x403214
mov eax, dword [ebp - 0x28]
cmp word [eax + 4], 0
je 0x403214
mov dword [ebp - 0x44], 0
lea edi, [eax + 6]
xor esi, esi
mov dword [ebp - 0x40], 0
lea esi, [esi]
mov dword [esp + 8], 3
movzx eax, word [edi + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FindResourceW]
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x4031f4
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LoadResource]
sub esp, 8
mov ecx, eax
test eax, eax
je 0x4031f4
mov eax, dword [ebx + 4]
mov ebx, dword [edi + 8]
mov dword [ebp - 0x2c], ecx
mov dword [esp], ecx
mov dword [ebp - 0x30], eax
call dword [sym.imp.kernel32.dll_LockResource]
mov ecx, dword [ebp - 0x2c]
sub esp, 4
test eax, eax
je 0x4031e8
mov edx, dword [ebp - 0x30]
movzx ecx, byte [edi]
cmp edx, ebx
cmovbe ebx, edx
mov edx, dword [ebp - 0x40]
add dword [ebp - 0x40], 1
shl edx, 4
add edx, dword [ebp - 0x48]
mov byte [edx], cl
movzx ecx, byte [edi + 1]
mov dword [edx + 8], ebx
mov byte [edx + 1], cl
movzx ecx, byte [edi + 2]
mov byte [edx + 2], cl
movzx ecx, byte [edi + 3]
mov byte [edx + 3], cl
movzx ecx, word [edi + 4]
mov word [edx + 4], cx
movzx ecx, word [edi + 6]
mov word [edx + 6], cx
mov ecx, dword [ebp - 0x44]
mov dword [edx + 0xc], ecx
mov edx, dword [ebp - 0x4c]
mov dword [esp + 8], ebx
add edx, ecx
mov dword [esp + 4], eax
mov dword [esp], edx
call sym._memcpy
add dword [ebp - 0x44], ebx
mov ecx, dword [ebp - 0x2c]
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_FreeResource]
sub esp, 4
mov eax, dword [ebp - 0x28]
add esi, 1
add edi, 0xe
movzx eax, word [eax + 4]
cmp esi, eax
jl 0x403120
mov eax, dword [ebp - 0x40]
test eax, eax
jne 0x403044
test byte [0x40d000], 2
jne 0x403440
mov eax, dword [ebp - 0x4c]
mov ebx, dword [sym.imp.ucrtbase.dll_free]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x20]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov edi, dword [ebp - 0x34]
test byte [0x40d000], 4
je 0x403020
mov dword [esp + 0xc], str.file_too_small_for_icon_NE_NAMEINFO_n
mov dword [esp + 8], str.populate_module16_icons
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.18
jmp 0x403020
test byte [0x40d000], 2
jne 0x4033e4
mov eax, dword [ebp - 0x4c]
mov ebx, dword [sym.imp.ucrtbase.dll_free]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40323a
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
xor eax, eax
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov edi, dword [ebp - 0x34]
mov eax, dword [ebp - 0x30]
mov esi, dword [edi + 8]
movzx ecx, word [eax + 0xc]
movzx eax, word [ebx]
shl eax, cl
add eax, esi
cmp eax, dword [ebp - 0x38]
ja 0x4034e1
mov eax, dword [ebp - 0x40]
movzx edx, byte [edi]
add dword [ebp - 0x40], 1
shl eax, 4
add eax, dword [ebp - 0x48]
mov byte [eax], dl
movzx edx, byte [edi + 1]
mov dword [eax + 8], esi
mov byte [eax + 1], dl
movzx edx, byte [edi + 2]
mov byte [eax + 2], dl
movzx edx, byte [edi + 3]
mov byte [eax + 3], dl
movzx edx, word [edi + 4]
mov word [eax + 4], dx
movzx edx, word [edi + 6]
mov word [eax + 6], dx
mov edx, dword [ebp - 0x44]
mov dword [eax + 0xc], edx
mov eax, dword [ebp - 0x4c]
add eax, edx
movzx edx, word [ebx]
mov dword [esp + 8], esi
mov dword [esp], eax
shl edx, cl
add edx, dword [ebp - 0x3c]
mov dword [esp + 4], edx
call sym._memcpy
add dword [ebp - 0x44], esi
jmp 0x403020
mov esi, dword [ebp - 0x40]
mov edi, dword [ebp - 0x48]
shl esi, 4
mov eax, edi
lea ecx, [esi + 6]
lea edx, [esi + edi]
lea esi, [esi]
lea esi, [esi]
add dword [eax + 0xc], ecx
add eax, 0x10
cmp edx, eax
jne 0x403370
mov eax, dword [ebp - 0x20]
mov edi, dword [ebp - 0x48]
mov edx, dword [eax]
mov dword [esp + 4], edi
mov dword [esp + 0xc], ebx
mov dword [esp + 8], esi
mov dword [esp], eax
call dword [edx + 0x10]
sub esp, 0x10
mov edi, eax
test eax, eax
js 0x403517
cmp esi, dword [ebp - 0x1c]
je 0x403469
test byte [0x40d000], 2
je 0x403221
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], str.error_0x_08lX_writing_icon_dir_entries_to_stream_n
mov dword [esp + 8], global___func__.7
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.18
jmp 0x4030c0
mov dword [esp + 0xc], str.error_creating_icon_stream_n
mov dword [esp + 8], global___func__.7
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.18
jmp 0x40329d
lea ebx, [eax + 8]
jmp 0x4032d6
test byte [0x40d000], 2
je 0x40329d
jmp 0x403098
xor eax, eax
jmp 0x402f39
mov dword [esp + 0xc], str.no_valid_icon_entries_n
mov dword [esp + 8], global___func__.7
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.18
jmp 0x403221
mov eax, dword [ebp - 0x20]
mov edi, dword [ebp - 0x4c]
mov edx, dword [eax]
mov dword [esp + 0xc], ebx
mov ebx, dword [ebp - 0x44]
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [esp + 8], ebx
call dword [edx + 0x10]
sub esp, 0x10
mov edi, eax
test eax, eax
js 0x4034d2
cmp dword [ebp - 0x1c], ebx
je 0x403529
test byte [0x40d000], 2
je 0x403221
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], str.error_0x_08lX_writing_icon_images_to_stream_n
mov dword [esp + 8], global___func__.7
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.18
jmp 0x4030c0
test byte [0x40d000], 2
je 0x40329d
jmp 0x4034a5
test byte [0x40d000], 4
je 0x403039
mov dword [esp + 0xc], str.file_too_small_for_icon_contents_n
mov dword [esp + 8], str.populate_module16_icons
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.18
jmp 0x403039
test byte [0x40d000], 2
je 0x40329d
jmp 0x4033b7
mov eax, dword [ebp - 0x20]
mov edx, dword [eax]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov dword [esp], eax
call dword [edx + 0x14]
sub esp, 0x14
mov edi, eax
jmp 0x4030c0