Function at 0x404e50
Capabilities:
Extract resource via kernel32 functions
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea edi, [iconData16.iconResources]
mov esi, edx
push ebx
sub esp, 0x26c
mov dword [ebp - 0x23c], ecx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0x104
mov dword [esp + 8], str..exe
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_SearchPathW]
sub eax, 1
sub esp, 0x18
cmp eax, 0x103
ja 0x405460
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_LoadLibraryExW]
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x405080
test esi, esi
js 0x404f98
lea eax, [ebp - 0x234]
mov dword [ebp - 0x22c], esi
mov dword [ebp - 0x230], eax
lea eax, [ebp - 0x230]
mov dword [ebp - 0x234], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], dbg.EnumResNameProc
mov dword [esp + 4], 0xe
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_EnumResourceNamesW]
sub esp, 0x10
test eax, eax
jne 0x404f32
cmp dword [ebp - 0x22c], 0xffffffff
je 0x404f32
test byte [0x40d014], 8
jne 0x4052e8
mov esi, dword [ebp - 0x234]
test esi, esi
je 0x4054c2
mov dword [esp + 4], esi
mov edi, 0x80004005
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_LoadResource]
sub esp, 8
mov esi, eax
test eax, eax
je 0x405061
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LockResource]
sub esp, 4
test eax, eax
je 0x405050
mov ecx, eax
mov edx, ebx
xor eax, eax
call dbg.add_module_icons_to_stream
mov edx, dword [ebp - 0x23c]
mov dword [edx], eax
test eax, eax
je 0x405050
xor edi, edi
jmp 0x405055
neg esi
mov dword [esp + 8], 0xe
movzx esi, si
mov dword [esp], eax
mov dword [esp + 4], esi
call dword [sym.imp.kernel32.dll_FindResourceW]
mov dword [ebp - 0x234], eax
sub esp, 0xc
mov esi, eax
test byte [0x40d014], 8
je 0x404f38
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x240], eax
mov eax, edi
shr eax, 0x10
je 0x405320
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x40500a
mov eax, edi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov edx, dword [ebp - 0x240]
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], edx
mov dword [esp + 0xc], str.FindResourceW___s__called__return__p__error__ld_n
mov dword [esp + 8], global___FUNCTION__.1
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
mov esi, dword [ebp - 0x234]
jmp 0x404f38
mov edi, 0x80004005
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_FreeResource]
sub esp, 4
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_FreeLibrary]
sub esp, 4
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword fs:[0x18]
cmp dword [edx + 0x34], 0xc1
je 0x405128
test byte [0x40d014], 4
jne 0x4050c0
mov eax, dword fs:[0x18]
mov edi, dword [eax + 0x34]
movzx eax, di
or eax, 0x80070000
test edi, edi
cmovg edi, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
mov eax, edi
pop edi
pop ebp
ret
mov eax, edi
mov ebx, dword [edx + 0x34]
shr eax, 0x10
je 0x405388
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x4050f4
mov eax, edi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.LoadLibraryExW___s__failed__error__ld_n
mov dword [esp + 8], global___FUNCTION__.1
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x40509d
mov dword [ebp - 0x240], edx
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x10000000
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_CreateFileW]
mov edx, dword [ebp - 0x240]
sub esp, 0x1c
cmp eax, 0xffffffff
mov dword [ebp - 0x244], eax
je 0x405574
mov dword [ebp - 0x240], edx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x8000002
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x244]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileMappingW]
mov edx, dword [ebp - 0x240]
sub esp, 0x18
test eax, eax
mov dword [ebp - 0x24c], eax
je 0x40554d
mov dword [ebp - 0x250], edx
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x244]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
sub esp, 8
mov dword [ebp - 0x248], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov eax, dword [ebp - 0x24c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MapViewOfFile]
mov edx, dword [ebp - 0x250]
sub esp, 0x14
test eax, eax
mov dword [ebp - 0x240], eax
je 0x4055db
cmp dword [ebp - 0x248], 0x40
jbe 0x4054ff
mov eax, dword [ebp - 0x240]
cmp word [eax], 0x5a4d
jne 0x4054ff
mov edx, dword [ebp - 0x240]
mov edi, dword [ebp - 0x248]
mov eax, dword [edx + 0x3c]
add edi, edx
add eax, edx
lea edx, [eax + 0x40]
cmp edi, edx
jb 0x405519
cmp word [eax], 0x454e
jne 0x405519
movzx ecx, word [eax + 0x24]
add ecx, eax
lea eax, [ecx + 2]
cmp edi, eax
jb 0x405338
movzx edx, word [ecx]
add ecx, 0xa
mov word [ebp - 0x250], dx
xor edx, edx
cmp edi, ecx
jae 0x4052ca
jmp 0x405338
cmp cx, 0x8003
cmove edx, eax
movzx ecx, word [eax + 2]
lea ecx, [ecx + ecx*2]
lea eax, [eax + ecx*4 + 8]
lea ecx, [eax + 8]
cmp edi, ecx
jb 0x405338
movzx ecx, word [eax]
test cx, cx
je 0x4053a0
cmp cx, 0x800e
jne 0x4052b0
mov ebx, eax
jmp 0x4052b8
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.EnumResourceNamesW_failed__error__ld_n
mov dword [esp + 8], global___FUNCTION__.1
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x404f32
mov dword [esp + 4], edi
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x40500a
test byte [0x40d014], 4
jne 0x405473
mov eax, dword [ebp - 0x244]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
call ebx
mov edi, 0x80004005
sub esp, 4
mov eax, dword [ebp - 0x24c]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x240]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
jmp 0x40506d
mov dword [esp + 4], edi
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x4050f4
test ebx, ebx
je 0x4056ce
test edx, edx
je 0x4056b4
movzx eax, word [ebx + 2]
cmp esi, eax
jge 0x405625
lea eax, [esi + esi*2]
lea eax, [ebx + eax*4 + 8]
lea ecx, [eax + 0xc]
cmp edi, ecx
jb 0x40560b
movzx ecx, byte [ebp - 0x250]
movzx eax, word [eax]
mov ebx, dword [ebp - 0x240]
shl eax, cl
lea ecx, [ebx + eax]
movzx eax, word [ecx + 4]
imul eax, eax, 0xe
lea eax, [ecx + eax + 0x14]
cmp edi, eax
jb 0x405533
mov eax, dword [ebp - 0x240]
mov dword [iconData16.fileBytes], edx
xor edx, edx
mov dword [ebp - 0x230], eax
mov eax, dword [ebp - 0x248]
mov dword [ebp - 0x22c], eax
movzx eax, word [ebp - 0x250]
mov word [iconData16.fileSize], ax
lea eax, [ebp - 0x230]
call dbg.add_module_icons_to_stream
mov ebx, dword [ebp - 0x23c]
test eax, eax
mov dword [ebx], eax
mov eax, dword [ebp - 0x244]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
je 0x405354
call ebx
xor edi, edi
sub esp, 4
jmp 0x40535e
test byte [0x40d014], 4
jne 0x40549c
mov edi, 0x80070490
jmp 0x40506d
mov dword [esp + 0xc], str.file_too_small_for_resource_table_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x405345
mov dword [esp + 0xc], str.SearchPath_failed_n
mov dword [esp + 8], global___FUNCTION__.1
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x405469
test byte [0x40d014], 4
jne 0x4054d9
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_FreeLibrary]
sub esp, 4
jmp 0x405469
mov dword [esp + 0xc], str.found_no_icon_n
mov dword [esp + 8], global___FUNCTION__.1
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x4054cb
test byte [0x40d014], 4
je 0x405345
mov dword [esp + 0xc], str.file_too_small_for_MZ_header_n
jmp 0x40547b
test byte [0x40d014], 4
je 0x405345
mov dword [esp + 0xc], str.file_too_small_for_NE_header_n
jmp 0x40547b
test byte [0x40d014], 4
je 0x405345
mov dword [esp + 0xc], str.file_too_small_for_GRPICONDIR_n
jmp 0x40547b
test byte [0x40d014], 4
jne 0x40563f
mov eax, dword [ebp - 0x244]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push ecx
mov edi, 0x80004005
jmp 0x40506d
test byte [0x40d014], 4
je 0x40556a
mov eax, edi
mov ebx, dword [edx + 0x34]
shr eax, 0x10
je 0x40569f
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
push esi
push esi
test eax, eax
jne 0x4056e8
mov eax, edi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.opening__s_failed_with_error__ld_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x40556a
test byte [0x40d014], 4
jne 0x40566f
mov eax, dword [ebp - 0x244]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
call ebx
push edx
mov eax, dword [ebp - 0x24c]
mov dword [esp], eax
call ebx
push eax
jmp 0x40556a
test byte [0x40d014], 4
je 0x405345
mov dword [esp + 0xc], str.file_too_small_for_icon_group_NE_NAMEINFO_n
jmp 0x40547b
test byte [0x40d014], 4
je 0x405345
mov dword [esp + 0xc], str.icon_index_out_of_range_n
jmp 0x40547b
mov eax, dword [edx + 0x34]
mov dword [esp + 0xc], str.CreateFileMapping_failed__error__ld_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x40555a
mov eax, dword [edx + 0x34]
mov dword [esp + 0xc], str.MapViewOfFile_failed__error__ld_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x4055e8
mov dword [esp + 4], edi
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x4055ad
test byte [0x40d014], 4
je 0x405345
mov dword [esp + 0xc], str.no_icon_resource_type_found_n
jmp 0x40547b
test byte [0x40d014], 4
je 0x405345
mov dword [esp + 0xc], str.no_group_icon_resource_type_found_n
jmp 0x40547b
mov eax, str._invalid_
jmp 0x4055ad