Function at 0x4084d0
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]
dec eax
sub esp, 0x18
cmp eax, 0x103
ja 0x408e10
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 0x408750
test edi, edi
js 0x408630
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], sym._EnumResNameProc_16
mov dword [esp + 4], 0xe
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_EnumResourceNamesW]
sub esp, 0x10
test eax, eax
jne 0x4085b0
cmp dword [ebp - 0x33c], 0xffffffff
je 0x4085b0
test byte [section..data], 8
jne 0x408b30
mov edi, dword [ebp - 0x344]
test edi, edi
je 0x408eb6
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 0x408613
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LockResource]
sub esp, 4
mov ecx, eax
test eax, eax
je 0x408602
mov edx, esi
xor eax, eax
xor edi, edi
call sym._add_module_icons_to_stream
mov edx, dword [ebp - 0x348]
mov dword [edx], eax
test eax, eax
jne 0x408607
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]
mov dword [ebp - 0x344], eax
sub esp, 0xc
mov edi, eax
test byte [section..data], 8
je 0x4085b6
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x34c], eax
mov eax, ebx
shr eax, 0x10
je 0x408cc0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x4088ba
movzx eax, word [ebp - 0x214]
test ax, ax
je 0x408e4b
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x4086b0
mov ecx, 0x224c
mov dword [ebp - 0x350], edi
mov edi, ebx
mov word [ebp - 0x340], cx
lea ecx, [ebp - 0x33e]
jmp 0x40871e
cmp ax, 9
je 0x408b88
cmp ax, 0xa
jne 0x408ba6
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea ebx, [edx - 1]
test edx, edx
jle 0x408888
lea eax, [ebp - 0x21e]
cmp ecx, eax
ja 0x408888
movzx eax, word [edi]
mov edx, ebx
add edi, 2
cmp ax, 0xd
je 0x408b70
jbe 0x4086e0
cmp ax, 0x22
je 0x408c00
cmp ax, 0x5c
jne 0x408b99
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x408700
mov edx, dword fs:[0x18]
cmp dword [edx + 0x34], 0xc1
je 0x408968
test byte [section..data], 4
jne 0x408790
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 - 0x34c], eax
mov eax, ebx
shr eax, 0x10
je 0x408d40
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x40892c
movzx eax, word [ebp - 0x214]
test ax, ax
je 0x408e6c
lea esi, cs:[esi]
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x4087e0
mov esi, 0x224c
mov dword [ebp - 0x348], ebx
lea ecx, [ebp - 0x33e]
lea edi, [ebp - 0x21e]
mov word [ebp - 0x340], si
jmp 0x40884e
cmp ax, 9
je 0x408ca8
cmp ax, 0xa
jne 0x408c36
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [edx - 1]
test edx, edx
jle 0x408900
cmp ecx, edi
ja 0x408900
mov eax, dword [ebp - 0x348]
mov edx, esi
movzx eax, word [eax]
add dword [ebp - 0x348], 2
cmp ax, 0xd
je 0x408c18
jbe 0x408810
cmp ax, 0x22
je 0x408c90
cmp ax, 0x5c
jne 0x408c29
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x408830
mov byte [ecx], 0x22
mov edi, dword [ebp - 0x350]
test ebx, ebx
jle 0x408e64
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 sym.___wine_dbg_strdup
mov ebx, dword [ebp - 0x34c]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0xc], str.FindResourceW___s__called__return__p__error__ld_n
mov dword [esp + 8], str.open_module_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
mov edi, dword [ebp - 0x344]
jmp 0x4085b6
mov byte [ecx], 0x22
test esi, esi
jle 0x408e85
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 sym.___wine_dbg_strdup
mov esi, dword [ebp - 0x34c]
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], str.open_module_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x40876d
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 0x408fd3
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 0x408fac
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 0x40903a
cmp dword [ebp - 0x354], 0x40
jbe 0x408efb
mov eax, dword [ebp - 0x34c]
cmp word [eax], 0x5a4d
jne 0x408efb
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 0x408f36
cmp word [eax], 0x454e
jne 0x408f36
movzx ecx, word [eax + 0x24]
add eax, ecx
mov dword [ebp - 0x35c], eax
add eax, 2
cmp ebx, eax
jb 0x408ce0
mov ebx, dword [ebp - 0x35c]
lea ecx, [ebx + 0xa]
xor ebx, ebx
cmp edx, ecx
jae 0x408b16
jmp 0x408ce0
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 0x408ce0
movzx ecx, word [eax]
test cx, cx
je 0x408d60
cmp cx, 0x800e
jne 0x408af8
mov esi, eax
jmp 0x408b00
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.EnumResourceNamesW_failed__error__ld_n
mov dword [esp + 8], str.open_module_icon
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4085b0
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408700
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408700
lea ebx, [eax - 0x20]
cmp bx, 0x5e
jbe 0x408d30
mov ebx, eax
mov byte [ecx], 0x5c
add ecx, 5
shr bx, 0xc
movzx ebx, bx
movzx ebx, byte [ebx + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [ecx - 4], bl
mov ebx, eax
shr bx, 8
and ebx, 0xf
movzx ebx, byte [ebx + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [ecx - 3], bl
mov ebx, eax
and eax, 0xf
shr bx, 4
movzx eax, byte [eax + str.0123456789abcdefGCC:__GNU__10.3.0]
and ebx, 0xf
movzx ebx, byte [ebx + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x408700
mov eax, 0x225c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408700
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408830
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x408e08
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefGCC:__GNU__10.3.0]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x408830
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x408830
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408830
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x4088ba
mov edi, 0x80004005
test byte [section..data], 4
jne 0x408e8d
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 0x40861f
mov byte [ecx], al
inc ecx
jmp 0x408700
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x40892c
test esi, esi
je 0x4091a8
test ebx, ebx
je 0x40916d
movzx eax, word [esi + 2]
cmp edi, eax
jge 0x4090aa
lea eax, [edi + edi*2]
lea eax, [esi + eax*4 + 8]
lea ecx, [eax + 0xc]
cmp edx, ecx
jb 0x40906f
mov esi, dword [ebp - 0x35c]
movzx eax, word [eax]
mov edi, dword [ebp - 0x34c]
movzx esi, word [esi]
mov ecx, esi
shl eax, cl
lea ecx, [edi + eax]
movzx eax, word [ecx + 4]
imul eax, eax, 0xe
lea eax, [ecx + eax + 0x14]
cmp edx, eax
jb 0x408f71
mov eax, dword [ebp - 0x34c]
xor edx, edx
mov word [ebp - 0x334], si
mov dword [ebp - 0x338], ebx
mov dword [ebp - 0x340], eax
mov eax, dword [ebp - 0x354]
mov dword [ebp - 0x33c], eax
lea eax, [ebp - 0x340]
call sym._add_module_icons_to_stream
mov esi, dword [ebp - 0x348]
cmp eax, 1
sbb edi, edi
mov dword [esi], eax
and edi, 0x80004005
jmp 0x408cf2
mov byte [ecx], al
inc ecx
jmp 0x408830
mov edi, 0x80070490
test byte [section..data], 4
je 0x40861f
mov dword [esp + 0xc], str.SearchPath_failed_n
mov dword [esp + 8], str.open_module_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x40861f
mov eax, 0x224c
mov byte [ebp - 0x33e], 0x22
lea ecx, [ebp - 0x33e]
mov word [ebp - 0x340], ax
lea eax, [ecx + 1]
jmp 0x4088a9
mov edi, 0x224c
mov byte [ebp - 0x33e], 0x22
lea ecx, [ebp - 0x33e]
mov word [ebp - 0x340], di
lea eax, [ecx + 1]
jmp 0x40891b
mov dword [esp + 0xc], str.file_too_small_for_resource_table_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408cf2
test byte [section..data], 4
jne 0x408ed5
mov dword [esp], esi
mov edi, 0x80070490
call dword [sym.imp.kernel32.dll_FreeLibrary]
sub esp, 4
jmp 0x40861f
mov dword [esp + 0xc], str.found_no_icon_n
mov dword [esp + 8], str.open_module_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408ebf
mov edi, 0x80004005
test byte [section..data], 4
je 0x408cf2
mov dword [esp + 0xc], str.file_too_small_for_MZ_header_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408cf2
mov edi, 0x80004005
test byte [section..data], 4
je 0x408cf2
mov dword [esp + 0xc], str.file_too_small_for_NE_header_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408cf2
mov edi, 0x80004005
test byte [section..data], 4
je 0x408cf2
mov dword [esp + 0xc], str.file_too_small_for_GRPICONDIR_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408cf2
test byte [section..data], 4
jne 0x4090e5
mov eax, dword [ebp - 0x350]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push eax
mov edi, 0x80004005
jmp 0x40861f
test byte [section..data], 4
je 0x408fc9
mov eax, ebx
mov esi, dword [edx + 0x34]
shr eax, 0x10
je 0x409155
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
push edx
push edx
test eax, eax
jne 0x4091e3
mov eax, ebx
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x14], esi
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], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408fc9
test byte [section..data], 4
jne 0x409125
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 eax
jmp 0x40861f
mov edi, 0x80004005
test byte [section..data], 4
je 0x408cf2
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], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408cf2
mov edi, 0x80004005
test byte [section..data], 4
je 0x408cf2
mov dword [esp + 0xc], str.icon_index_out_of_range_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408cf2
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], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
mov eax, dword [ebp - 0x350]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push eax
jmp 0x408fc9
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], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x409047
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x40900c
mov edi, 0x80004005
test byte [section..data], 4
je 0x408cf2
mov dword [esp + 0xc], str.no_icon_resource_type_found_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408cf2
mov edi, 0x80004005
test byte [section..data], 4
je 0x408cf2
mov dword [esp + 0xc], str.no_group_icon_resource_type_found_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x408cf2
mov eax, str._invalid_
jmp 0x40900c