Function at 0x405eb0
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
mov esi, eax
push ebx
sub esp, 0x6c
mov dword [ebp - 0x3c], ecx
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LoadLibraryExW]
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x406060
test edi, edi
js 0x405fb0
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x28]
mov dword [ebp - 0x24], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x4011d0
mov dword [esp + 4], 0xe
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_EnumResourceNamesW]
sub esp, 0x10
test eax, eax
jne 0x405f38
cmp dword [ebp - 0x24], 0xffffffff
je 0x405f38
test byte [section..data], 8
jne 0x4062a0
mov edi, dword [ebp - 0x2c]
test edi, edi
je 0x406433
mov dword [esp + 4], edi
mov edi, 0x80004005
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_LoadResource]
sub esp, 8
mov esi, eax
test eax, eax
je 0x405f95
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LockResource]
sub esp, 4
mov ecx, eax
test eax, eax
je 0x405f84
mov edx, ebx
xor eax, eax
xor edi, edi
call fcn.00402410
mov edx, dword [ebp - 0x3c]
mov dword [edx], eax
test eax, eax
jne 0x405f89
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
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 - 0x2c], eax
sub esp, 0xc
mov edi, eax
test byte [section..data], 8
je 0x405f3b
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x40], eax
test esi, esi
je 0x4063f0
mov eax, esi
shr eax, 0x10
je 0x4063d0
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x406024
mov eax, esi
call fcn.004012a0
mov esi, dword [ebp - 0x40]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], esi
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], 0x40e000
mov dword [esp], 3
call fcn.00401480
mov edi, dword [ebp - 0x2c]
jmp 0x405f3b
mov edx, dword fs:[0x18]
cmp dword [edx + 0x34], 0xc1
je 0x406110
test byte [section..data], 4
jne 0x4060a0
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 ebx, dword [edx + 0x34]
test esi, esi
je 0x406400
mov eax, esi
shr eax, 0x10
je 0x4062e0
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x4060dc
mov eax, esi
call fcn.004012a0
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], str.open_module_icon
mov dword [esp + 4], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x40607d
mov dword [ebp - 0x40], 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], esi
call dword [sym.imp.kernel32.dll_CreateFileW]
mov edx, dword [ebp - 0x40]
sub esp, 0x1c
cmp eax, 0xffffffff
mov dword [ebp - 0x44], eax
je 0x4064ee
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x40], 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 - 0x40]
sub esp, 0x18
test eax, eax
mov dword [ebp - 0x4c], eax
je 0x406505
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x50], edx
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x4c]
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 - 0x50]
sub esp, 0x14
test eax, eax
mov dword [ebp - 0x40], eax
je 0x40655c
cmp dword [ebp - 0x48], 0x40
jbe 0x406478
mov eax, dword [ebp - 0x40]
cmp word [eax], 0x5a4d
jne 0x406478
mov edx, dword [ebp - 0x40]
mov eax, dword [edx + 0x3c]
add eax, edx
add edx, dword [ebp - 0x48]
mov esi, edx
lea edx, [eax + 0x40]
cmp esi, edx
jb 0x4064b3
cmp word [eax], 0x454e
jne 0x4064b3
movzx ecx, word [eax + 0x24]
add ecx, eax
lea eax, [ecx + 2]
cmp esi, eax
jb 0x406300
movzx edx, word [ecx]
add ecx, 0xa
mov word [ebp - 0x50], dx
xor edx, edx
cmp esi, ecx
jae 0x406282
jmp 0x406300
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 esi, ecx
jb 0x406300
movzx ecx, word [eax]
test cx, cx
je 0x406348
cmp cx, 0x800e
jne 0x406268
mov ebx, eax
jmp 0x406270
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], 0x40e000
mov dword [esp], 3
call fcn.00401480
jmp 0x405f38
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call fcn.004019b0
jmp 0x4060dc
mov edi, 0x80004005
test byte [section..data], 4
jne 0x40640a
mov eax, dword [ebp - 0x44]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x4c]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x40]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
jmp 0x405fa1
test ebx, ebx
je 0x4066e2
test edx, edx
je 0x4066a7
movzx eax, word [ebx + 2]
cmp edi, eax
jge 0x4065c6
lea eax, [edi + edi*2]
lea eax, [ebx + eax*4 + 8]
lea ecx, [eax + 0xc]
cmp esi, ecx
jb 0x40658b
movzx ecx, byte [ebp - 0x50]
movzx eax, word [eax]
mov ebx, dword [ebp - 0x40]
shl eax, cl
lea ecx, [ebx + eax]
movzx eax, word [ecx + 4]
imul eax, eax, 0xe
lea eax, [ecx + eax + 0x14]
cmp esi, eax
jb 0x406521
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x20], edx
xor edx, edx
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x48]
mov dword [ebp - 0x24], eax
movzx eax, word [ebp - 0x50]
mov word [ebp - 0x1c], ax
lea eax, [ebp - 0x28]
call fcn.00402410
mov ebx, dword [ebp - 0x3c]
cmp eax, 1
sbb edi, edi
mov dword [ebx], eax
and edi, 0x80004005
jmp 0x406312
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call fcn.004019b0
jmp 0x406024
mov eax, str._null_
jmp 0x406024
mov eax, str._null_
jmp 0x4060dc
mov dword [esp + 0xc], str.file_too_small_for_resource_table_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x406312
test byte [section..data], 4
jne 0x406452
mov dword [esp], ebx
mov edi, 0x80070490
call dword [sym.imp.kernel32.dll_FreeLibrary]
sub esp, 4
jmp 0x405fa1
mov dword [esp + 0xc], str.found_no_icon_n
mov dword [esp + 8], str.open_module_icon
mov dword [esp + 4], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x40643c
mov edi, 0x80004005
test byte [section..data], 4
je 0x406312
mov dword [esp + 0xc], str.file_too_small_for_MZ_header_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x406312
mov edi, 0x80004005
test byte [section..data], 4
je 0x406312
mov dword [esp + 0xc], str.file_too_small_for_NE_header_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x406312
test byte [section..data], 4
jne 0x406601
mov edi, 0x80004005
jmp 0x405fa1
test byte [section..data], 4
jne 0x40666a
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push ecx
jmp 0x4064fb
mov edi, 0x80004005
test byte [section..data], 4
je 0x406312
mov dword [esp + 0xc], str.file_too_small_for_GRPICONDIR_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x406312
test byte [section..data], 4
jne 0x40671d
mov eax, dword [ebp - 0x44]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov edi, 0x80004005
mov dword [esp], eax
call ebx
push eax
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call ebx
push edx
jmp 0x405fa1
mov edi, 0x80004005
test byte [section..data], 4
je 0x406312
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], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x406312
mov edi, 0x80004005
test byte [section..data], 4
je 0x406312
mov dword [esp + 0xc], str.icon_index_out_of_range_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x406312
mov ebx, dword [edx + 0x34]
test esi, esi
je 0x40676f
mov eax, esi
shr eax, 0x10
je 0x40674d
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
push edi
push edi
test eax, eax
jne 0x406765
mov eax, esi
call fcn.004012a0
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], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x4064fb
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], 0x40e000
mov dword [esp], 2
call fcn.00401480
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push ebx
jmp 0x4064fb
mov edi, 0x80004005
test byte [section..data], 4
je 0x406312
mov dword [esp + 0xc], str.no_icon_resource_type_found_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x406312
mov edi, 0x80004005
test byte [section..data], 4
je 0x406312
mov dword [esp + 0xc], str.no_group_icon_resource_type_found_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x406312
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], 0x40e000
mov dword [esp], 2
call fcn.00401480
jmp 0x406569
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call fcn.004019b0
jmp 0x406639
mov eax, str._invalid_
jmp 0x406639
mov eax, str._null_
jmp 0x406639