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

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, edx
push esi
push ebx
lea ebx, [ebp - 0x214]
sub esp, 0x36c
mov dword [ebp - 0x348], ecx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], ebx
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 0x405900
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_LoadLibraryExW]
sub esp, 0xc
mov esi, eax
test eax, eax
je 0x4051f0
test edi, edi
js 0x4050f0
lea eax, [ebp - 0x344]
mov dword [ebp - 0x33c], edi
mov dword [ebp - 0x340], eax
lea eax, [ebp - 0x340]
mov dword [ebp - 0x344], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], dbg.EnumResNameProc
mov dword [esp + 4], 0xe
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_EnumResourceNamesW]
sub esp, 0x10
test eax, eax
jne 0x405072
cmp dword [ebp - 0x33c], 0xffffffff
je 0x405072
test byte [0x40d000], 8
jne 0x405590
mov edi, dword [ebp - 0x344]
test edi, edi
je 0x405948
mov dword [esp + 4], edi
mov edi, 0x80004005
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_LoadResource]
sub esp, 8
mov ebx, eax
test eax, eax
je 0x4050d5
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LockResource]
sub esp, 4
test eax, eax
je 0x4050c4
mov ecx, eax
mov edx, esi
xor eax, eax
xor edi, edi
call dbg.add_module_icons_to_stream
mov edx, dword [ebp - 0x348]
mov dword [edx], eax
test eax, eax
jne 0x4050c9
mov edi, 0x80004005
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_FreeResource]
sub esp, 4
mov dword [esp], esi
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
neg edi
mov dword [esp + 8], 0xe
movzx edi, di
mov dword [esp], eax
mov dword [esp + 4], edi
call dword [sym.imp.kernel32.dll_FindResourceW]
sub esp, 0xc
mov edi, eax
mov dword [ebp - 0x344], eax
test byte [0x40d000], 8
je 0x405078
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x34c], eax
mov eax, ebx
shr eax, 0x10
je 0x4057c0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x405315
cmp word [ebp - 0x214], 0
je 0x40517a
lea esi, [esi]
add edx, 1
cmp word [ebx + edx*2], 0
jne 0x405170
mov eax, 0x224c
mov dword [ebp - 0x350], edi
lea ecx, [ebp - 0x33e]
mov word [ebp - 0x340], ax
lea edi, [edx - 1]
test edx, edx
jle 0x4052e1
lea eax, [ebp - 0x21e]
cmp ecx, eax
ja 0x4052e1
add ebx, 2
movzx eax, word [ebx - 2]
cmp ax, 0xd
je 0x405700
ja 0x405620
cmp ax, 9
je 0x4056e3
cmp ax, 0xa
jne 0x405683
mov eax, 0x6e5c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x405192
mov edx, dword fs:[0x18]
cmp dword [edx + 0x34], 0xc1
je 0x4053c2
test byte [0x40d000], 4
jne 0x405230
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, dword [edx + 0x34]
mov dword [ebp - 0x348], eax
mov eax, ebx
shr eax, 0x10
je 0x405830
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x40538b
cmp word [ebp - 0x214], 0
je 0x40527b
add edx, 1
cmp word [ebx + edx*2], 0
jne 0x405271
mov eax, 0x224c
lea ecx, [ebp - 0x33e]
lea edi, [ebp - 0x21e]
mov word [ebp - 0x340], ax
lea esi, [edx - 1]
test edx, edx
jle 0x405360
cmp ecx, edi
ja 0x405360
add ebx, 2
movzx eax, word [ebx - 2]
cmp ax, 0xd
je 0x405713
ja 0x405640
cmp ax, 9
je 0x4057a3
cmp ax, 0xa
jne 0x405743
mov eax, 0x6e5c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x405293
mov eax, edi
mov byte [ecx], 0x22
mov edi, dword [ebp - 0x350]
test eax, eax
jle 0x405940
mov ebx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], bx
mov byte [eax], 0
lea eax, [ebp - 0x340]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov edx, dword [ebp - 0x34c]
mov dword [esp + 0x14], edi
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___func__.2
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.18
mov edi, dword [ebp - 0x344]
jmp 0x405078
mov byte [ecx], 0x22
lea eax, [ecx + 1]
test esi, esi
jle 0x40537a
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x340]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov esi, dword [ebp - 0x348]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.LoadLibraryExW___s__failed__error__ld_n
mov dword [esp + 0x14], esi
mov dword [esp + 8], global___func__.2
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.18
jmp 0x40520d
mov dword [ebp - 0x34c], 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], ebx
call dword [sym.imp.kernel32.dll_CreateFileW]
mov edx, dword [ebp - 0x34c]
sub esp, 0x1c
cmp eax, 0xffffffff
mov dword [ebp - 0x350], eax
je 0x405a03
mov eax, dword [ebp - 0x350]
mov dword [ebp - 0x34c], 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 dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileMappingW]
mov edx, dword [ebp - 0x34c]
sub esp, 0x18
test eax, eax
mov dword [ebp - 0x358], eax
je 0x405a1a
mov eax, dword [ebp - 0x350]
mov dword [ebp - 0x35c], edx
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
mov dword [ebp - 0x354], eax
mov eax, dword [ebp - 0x358]
sub esp, 8
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MapViewOfFile]
mov edx, dword [ebp - 0x35c]
sub esp, 0x14
test eax, eax
mov dword [ebp - 0x34c], eax
je 0x405a74
cmp dword [ebp - 0x354], 0x40
jbe 0x40598d
mov eax, dword [ebp - 0x34c]
cmp word [eax], 0x5a4d
jne 0x40598d
mov ebx, dword [ebp - 0x34c]
mov eax, dword [ebx + 0x3c]
add eax, ebx
add ebx, dword [ebp - 0x354]
lea ecx, [eax + 0x40]
mov edx, ebx
cmp ebx, ecx
jb 0x4059c8
cmp word [eax], 0x454e
jne 0x4059c8
movzx ecx, word [eax + 0x24]
add eax, ecx
mov dword [ebp - 0x35c], eax
add eax, 2
cmp ebx, eax
jb 0x4057e0
mov ebx, dword [ebp - 0x35c]
lea ecx, [ebx + 0xa]
cmp edx, ecx
jb 0x4057e0
movzx ecx, word [ebx + 2]
test cx, cx
je 0x4055c6
xor ebx, ebx
jmp 0x40557f
cmp cx, 0x8003
cmove ebx, eax
movzx ecx, word [eax + 2]
lea ecx, [ecx + ecx*2]
lea eax, [eax + ecx*4 + 8]
lea ecx, [eax + 8]
cmp edx, ecx
jb 0x4057e0
movzx ecx, word [eax]
test cx, cx
je 0x405850
cmp cx, 0x800e
jne 0x405555
mov esi, eax
jmp 0x40555d
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___func__.2
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.18
jmp 0x405072
mov edi, 0x80004005
test byte [0x40d000], 4
jne 0x405c05
lea esi, [esi]
nop
mov eax, dword [ebp - 0x350]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x358]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x34c]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
jmp 0x4050e1
cmp ax, 0x22
je 0x405670
cmp ax, 0x5c
jne 0x405683
mov eax, 0x5c5c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x405192
cmp ax, 0x22
je 0x405730
cmp ax, 0x5c
jne 0x405743
mov eax, 0x5c5c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x405293
mov eax, 0x225c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x405192
lea edx, [eax - 0x20]
cmp dx, 0x5e
jbe 0x405820
mov edx, eax
mov byte [ecx], 0x5c
add ecx, 5
shr dx, 0xc
movzx edx, dx
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 4], dl
mov edx, eax
shr dx, 8
and edx, 0xf
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 3], dl
mov edx, eax
and eax, 0xf
shr dx, 4
movzx eax, byte [eax + str.0123456789abcdef]
and edx, 0xf
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 1], al
mov byte [ecx - 2], dl
mov edx, edi
jmp 0x405192
mov eax, 0x745c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x405192
mov eax, 0x725c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x405192
mov eax, 0x725c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x405293
mov eax, 0x225c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x405293
lea edx, [eax - 0x20]
cmp dx, 0x5e
jbe 0x4058f1
mov edx, eax
mov byte [ecx], 0x5c
add ecx, 5
shr dx, 0xc
movzx edx, dx
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 4], dl
mov edx, eax
shr dx, 8
and edx, 0xf
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 3], dl
mov edx, eax
and eax, 0xf
shr dx, 4
movzx eax, byte [eax + str.0123456789abcdef]
and edx, 0xf
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 1], al
mov byte [ecx - 2], dl
mov edx, esi
jmp 0x405293
mov eax, 0x745c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x405293
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.16
jmp 0x405315
mov edi, 0x80004005
test byte [0x40d000], 4
je 0x4055e0
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.18
jmp 0x4055e0
mov byte [ecx], al
mov edx, edi
add ecx, 1
jmp 0x405192
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.16
jmp 0x40538b
test esi, esi
je 0x4055c6
test ebx, ebx
je 0x405b9a
movzx eax, word [esi + 2]
cmp edi, eax
jge 0x405aa9
lea eax, [edi + edi*2]
lea eax, [esi + eax*4 + 8]
lea ecx, [eax + 0xc]
cmp edx, ecx
jb 0x405ae4
mov esi, dword [ebp - 0x35c]
movzx eax, word [eax]
movzx ecx, word [esi]
shl eax, cl
add eax, dword [ebp - 0x34c]
movzx esi, word [eax + 4]
imul esi, esi, 0xe
lea esi, [eax + esi + 0x14]
cmp edx, esi
jb 0x405a39
mov esi, dword [ebp - 0x34c]
mov word [iconData16.fileSize], cx
xor edx, edx
mov ecx, eax
lea eax, [ebp - 0x340]
mov dword [iconData16.fileBytes], ebx
mov dword [ebp - 0x340], esi
mov esi, dword [ebp - 0x354]
mov dword [ebp - 0x33c], esi
call dbg.add_module_icons_to_stream
mov esi, dword [ebp - 0x348]
cmp eax, 1
sbb edi, edi
mov dword [esi], eax
and edi, 0x80004005
jmp 0x4055e0
mov byte [ecx], al
mov edx, esi
add ecx, 1
jmp 0x405293
mov edi, 0x80070490
test byte [0x40d000], 4
je 0x4050e1
mov dword [esp + 0xc], str.SearchPath_failed_n
mov dword [esp + 8], global___func__.2
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.18
jmp 0x4050e1
lea eax, [ecx + 1]
jmp 0x405304
test byte [0x40d000], 4
jne 0x405967
mov dword [esp], esi
mov edi, 0x80070490
call dword [sym.imp.kernel32.dll_FreeLibrary]
sub esp, 4
jmp 0x4050e1
mov dword [esp + 0xc], str.found_no_icon_n
mov dword [esp + 8], global___func__.2
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.18
jmp 0x405951
mov edi, 0x80004005
test byte [0x40d000], 4
je 0x4055e0
mov dword [esp + 0xc], str.file_too_small_for_MZ_header_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.18
jmp 0x4055e0
mov edi, 0x80004005
test byte [0x40d000], 4
je 0x4055e0
mov dword [esp + 0xc], str.file_too_small_for_NE_header_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.18
jmp 0x4055e0
test byte [0x40d000], 4
jne 0x405b5f
mov edi, 0x80004005
jmp 0x4050e1
test byte [0x40d000], 4
jne 0x405b1f
mov eax, dword [ebp - 0x350]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push ecx
jmp 0x405a10
mov edi, 0x80004005
test byte [0x40d000], 4
je 0x4055e0
mov dword [esp + 0xc], str.file_too_small_for_GRPICONDIR_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.18
jmp 0x4055e0
test byte [0x40d000], 4
jne 0x405bd5
mov eax, dword [ebp - 0x350]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov edi, 0x80004005
mov dword [esp], eax
call ebx
push eax
mov eax, dword [ebp - 0x358]
mov dword [esp], eax
call ebx
push edx
jmp 0x4050e1
mov edi, 0x80004005
test byte [0x40d000], 4
je 0x4055e0
mov dword [esp + 0xc], str.icon_index_out_of_range_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.18
jmp 0x4055e0
mov edi, 0x80004005
test byte [0x40d000], 4
je 0x4055e0
mov dword [esp + 0xc], str.file_too_small_for_icon_group_NE_NAMEINFO_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.18
jmp 0x4055e0
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.18
mov eax, dword [ebp - 0x350]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push edx
jmp 0x405a10
mov esi, dword [edx + 0x34]
mov eax, ebx
call sym._wine_dbgstr_wn.constprop.15
mov dword [esp + 0xc], str.opening__s_failed_with_error__ld_n
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.18
jmp 0x405a10
mov edi, 0x80004005
test byte [0x40d000], 4
je 0x4055e0
mov dword [esp + 0xc], str.no_icon_resource_type_found_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.18
jmp 0x4055e0
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.18
jmp 0x405a81
mov dword [esp + 0xc], str.no_group_icon_resource_type_found_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.18
jmp 0x4055e0