Function at 0x408600
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 - 0x220]
sub esp, 0x38c
mov dword [ebp - 0x35c], 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 0x408f40
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 0x408880
test edi, edi
js 0x408760
lea eax, [ebp - 0x350]
mov dword [ebp - 0x348], edi
mov dword [ebp - 0x34c], eax
lea eax, [ebp - 0x34c]
mov dword [ebp - 0x350], 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 0x4086e0
cmp dword [ebp - 0x348], 0xffffffff
je 0x4086e0
test byte [section..data], 8
jne 0x408c60
mov edi, dword [ebp - 0x350]
test edi, edi
je 0x408fe6
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 0x408743
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LockResource]
sub esp, 4
mov ecx, eax
test eax, eax
je 0x408732
mov edx, esi
xor eax, eax
xor edi, edi
call sym._add_module_icons_to_stream
mov edx, dword [ebp - 0x35c]
mov dword [edx], eax
test eax, eax
jne 0x408737
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 - 0x350], eax
sub esp, 0xc
mov edi, eax
test byte [section..data], 8
je 0x4086e6
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x360], eax
mov eax, ebx
shr eax, 0x10
je 0x408df0
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 0x4089ea
movzx eax, word [ebp - 0x220]
test ax, ax
je 0x408f7b
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x4087e0
mov ecx, 0x224c
mov dword [ebp - 0x364], edi
mov edi, ebx
mov word [ebp - 0x34c], cx
lea ecx, [ebp - 0x34a]
jmp 0x40884e
cmp ax, 9
je 0x408cb8
cmp ax, 0xa
jne 0x408cd6
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea ebx, [edx - 1]
test edx, edx
jle 0x4089b8
lea eax, [ebp - 0x22a]
cmp ecx, eax
ja 0x4089b8
movzx eax, word [edi]
mov edx, ebx
add edi, 2
cmp ax, 0xd
je 0x408ca0
jbe 0x408810
cmp ax, 0x22
je 0x408d30
cmp ax, 0x5c
jne 0x408cc9
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x408830
mov edx, dword fs:[0x18]
cmp dword [edx + 0x34], 0xc1
je 0x408a98
test byte [section..data], 4
jne 0x4088c0
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 - 0x360], eax
mov eax, ebx
shr eax, 0x10
je 0x408e70
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 0x408a5c
movzx eax, word [ebp - 0x220]
test ax, ax
je 0x408f9c
lea esi, [esi]
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x408910
mov esi, 0x224c
mov dword [ebp - 0x35c], ebx
lea ecx, [ebp - 0x34a]
lea edi, [ebp - 0x22a]
mov word [ebp - 0x34c], si
jmp 0x40897e
cmp ax, 9
je 0x408dd8
cmp ax, 0xa
jne 0x408d66
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [edx - 1]
test edx, edx
jle 0x408a30
cmp ecx, edi
ja 0x408a30
mov eax, dword [ebp - 0x35c]
mov edx, esi
movzx eax, word [eax]
add dword [ebp - 0x35c], 2
cmp ax, 0xd
je 0x408d48
jbe 0x408940
cmp ax, 0x22
je 0x408dc0
cmp ax, 0x5c
jne 0x408d59
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x408960
mov byte [ecx], 0x22
mov edi, dword [ebp - 0x364]
test ebx, ebx
jle 0x408f94
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x34c]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov ebx, dword [ebp - 0x360]
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 - 0x350]
jmp 0x4086e6
mov byte [ecx], 0x22
test esi, esi
jle 0x408fb5
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x34c]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov esi, dword [ebp - 0x360]
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 0x40889d
mov dword [ebp - 0x360], 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 - 0x360]
sub esp, 0x1c
cmp eax, 0xffffffff
mov dword [ebp - 0x364], eax
je 0x409103
mov eax, dword [ebp - 0x364]
mov dword [ebp - 0x360], 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 - 0x360]
sub esp, 0x18
test eax, eax
mov dword [ebp - 0x36c], eax
je 0x4090dc
mov eax, dword [ebp - 0x364]
mov dword [ebp - 0x370], edx
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
mov dword [ebp - 0x368], eax
mov eax, dword [ebp - 0x36c]
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 - 0x370]
sub esp, 0x14
test eax, eax
mov dword [ebp - 0x360], eax
je 0x40916a
cmp dword [ebp - 0x368], 0x40
jbe 0x40902b
mov eax, dword [ebp - 0x360]
cmp word [eax], 0x5a4d
jne 0x40902b
mov ebx, dword [ebp - 0x360]
mov eax, dword [ebx + 0x3c]
add eax, ebx
add ebx, dword [ebp - 0x368]
lea ecx, [eax + 0x40]
mov edx, ebx
cmp ebx, ecx
jb 0x409066
cmp word [eax], 0x454e
jne 0x409066
movzx ecx, word [eax + 0x24]
add eax, ecx
mov dword [ebp - 0x370], eax
add eax, 2
cmp ebx, eax
jb 0x408e10
mov ebx, dword [ebp - 0x370]
lea ecx, [ebx + 0xa]
xor ebx, ebx
cmp edx, ecx
jae 0x408c46
jmp 0x408e10
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 0x408e10
movzx ecx, word [eax]
test cx, cx
je 0x408e90
cmp cx, 0x800e
jne 0x408c28
mov esi, eax
jmp 0x408c30
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 0x4086e0
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408830
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408830
lea ebx, [eax - 0x20]
cmp bx, 0x5e
jbe 0x408e60
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 0x408830
mov eax, 0x225c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408830
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408960
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x408f38
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 0x408960
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x408960
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x408960
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x4089ea
mov edi, 0x80004005
test byte [section..data], 4
jne 0x408fbd
mov eax, dword [ebp - 0x364]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x36c]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x360]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
jmp 0x40874f
mov byte [ecx], al
inc ecx
jmp 0x408830
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x408a5c
test esi, esi
je 0x4092d8
test ebx, ebx
je 0x40929d
movzx eax, word [esi + 2]
cmp edi, eax
jge 0x4091da
lea eax, [edi + edi*2]
lea eax, [esi + eax*4 + 8]
lea ecx, [eax + 0xc]
cmp edx, ecx
jb 0x40919f
mov esi, dword [ebp - 0x370]
movzx eax, word [eax]
mov edi, dword [ebp - 0x360]
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 0x4090a1
mov eax, dword [ebp - 0x360]
xor edx, edx
mov word [ebp - 0x340], si
mov dword [ebp - 0x344], ebx
mov dword [ebp - 0x34c], eax
mov eax, dword [ebp - 0x368]
mov dword [ebp - 0x348], eax
lea eax, [ebp - 0x34c]
call sym._add_module_icons_to_stream
mov esi, dword [ebp - 0x35c]
cmp eax, 1
sbb edi, edi
mov dword [esi], eax
and edi, 0x80004005
jmp 0x408e22
mov byte [ecx], al
inc ecx
jmp 0x408960
mov edi, 0x80070490
test byte [section..data], 4
je 0x40874f
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 0x40874f
mov eax, 0x224c
mov byte [ebp - 0x34a], 0x22
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], ax
lea eax, [ecx + 1]
jmp 0x4089d9
mov edi, 0x224c
mov byte [ebp - 0x34a], 0x22
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], di
lea eax, [ecx + 1]
jmp 0x408a4b
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 0x408e22
test byte [section..data], 4
jne 0x409005
mov dword [esp], esi
mov edi, 0x80070490
call dword [sym.imp.kernel32.dll_FreeLibrary]
sub esp, 4
jmp 0x40874f
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 0x408fef
mov edi, 0x80004005
test byte [section..data], 4
je 0x408e22
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 0x408e22
mov edi, 0x80004005
test byte [section..data], 4
je 0x408e22
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 0x408e22
mov edi, 0x80004005
test byte [section..data], 4
je 0x408e22
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 0x408e22
test byte [section..data], 4
jne 0x409215
mov eax, dword [ebp - 0x364]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push eax
mov edi, 0x80004005
jmp 0x40874f
test byte [section..data], 4
je 0x4090f9
mov eax, ebx
mov esi, dword [edx + 0x34]
shr eax, 0x10
je 0x409285
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
push edx
push edx
test eax, eax
jne 0x409313
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 0x4090f9
test byte [section..data], 4
jne 0x409255
mov eax, dword [ebp - 0x364]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov edi, 0x80004005
mov dword [esp], eax
call ebx
push eax
mov eax, dword [ebp - 0x36c]
mov dword [esp], eax
call ebx
push eax
jmp 0x40874f
mov edi, 0x80004005
test byte [section..data], 4
je 0x408e22
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 0x408e22
mov edi, 0x80004005
test byte [section..data], 4
je 0x408e22
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 0x408e22
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 - 0x364]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push eax
jmp 0x4090f9
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 0x409177
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x40913c
mov edi, 0x80004005
test byte [section..data], 4
je 0x408e22
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 0x408e22
mov edi, 0x80004005
test byte [section..data], 4
je 0x408e22
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 0x408e22
mov eax, str._invalid_
jmp 0x40913c