Function at 0x405f10
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 0x406850
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 0x406190
test edi, edi
js 0x406070
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], 0x401230
mov dword [esp + 4], 0xe
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_EnumResourceNamesW]
sub esp, 0x10
test eax, eax
jne 0x405ff2
cmp dword [ebp - 0x33c], 0xffffffff
je 0x405ff2
test byte [section..data], 8
jne 0x406568
mov edi, dword [ebp - 0x344]
test edi, edi
je 0x4068f6
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 0x406055
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LockResource]
sub esp, 4
mov ecx, eax
test eax, eax
je 0x406044
mov edx, esi
xor eax, eax
xor edi, edi
call fcn.00403590
mov edx, dword [ebp - 0x348]
mov dword [edx], eax
test eax, eax
jne 0x406049
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 0x405ff8
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x34c], eax
mov eax, ebx
shr eax, 0x10
je 0x4066f0
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 0x4062fa
movzx eax, word [ebp - 0x214]
test ax, ax
je 0x40688b
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x4060f0
mov ecx, 0x224c
mov dword [ebp - 0x350], edi
mov edi, ebx
mov word [ebp - 0x340], cx
lea ecx, [ebp - 0x33e]
jmp 0x40615e
cmp ax, 9
je 0x4065b8
cmp ax, 0xa
jne 0x4065d6
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea ebx, [edx - 1]
test edx, edx
jle 0x4062c8
lea eax, [ebp - 0x21e]
cmp ecx, eax
ja 0x4062c8
movzx eax, word [edi]
mov edx, ebx
add edi, 2
cmp ax, 0xd
je 0x4065a0
jbe 0x406120
cmp ax, 0x22
je 0x406630
cmp ax, 0x5c
jne 0x4065c9
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x406140
mov edx, dword fs:[0x18]
cmp dword [edx + 0x34], 0xc1
je 0x4063a8
test byte [section..data], 4
jne 0x4061d0
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 0x406770
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov esi, eax
sub esp, 8
mov eax, str._invalid_
test esi, esi
jne 0x40636c
movzx edx, word [ebp - 0x214]
test dx, dx
je 0x4068ac
lea esi, [esi]
nop
mov ecx, esi
lea esi, [esi + 1]
cmp word [ebx + ecx*2 + 2], 0
jne 0x406220
mov esi, 0x224c
mov dword [ebp - 0x348], ebx
lea eax, [ebp - 0x33e]
lea edi, [ebp - 0x21e]
mov word [ebp - 0x340], si
jmp 0x40628e
cmp dx, 9
je 0x4066d8
cmp dx, 0xa
jne 0x406666
mov esi, 0x6e5c
add eax, 2
mov word [eax - 2], si
lea esi, [ecx - 1]
test ecx, ecx
jle 0x406340
cmp eax, edi
ja 0x406340
mov ebx, dword [ebp - 0x348]
mov ecx, esi
movzx edx, word [ebx]
add dword [ebp - 0x348], 2
cmp dx, 0xd
je 0x406648
jbe 0x406250
cmp dx, 0x22
je 0x4066c0
cmp dx, 0x5c
jne 0x406659
mov ebx, 0x5c5c
add eax, 2
mov word [eax - 2], bx
jmp 0x406270
mov byte [ecx], 0x22
mov edi, dword [ebp - 0x350]
test ebx, ebx
jle 0x4068a4
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 fcn.0040e1f0
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], 0x40f000
mov dword [esp], 3
call fcn.00401580
mov edi, dword [ebp - 0x344]
jmp 0x405ff8
mov byte [eax], 0x22
test esi, esi
jle 0x4068c5
mov ecx, 0x2e2e
mov byte [eax + 3], 0x2e
lea edx, [eax + 4]
mov word [eax + 1], cx
lea eax, [ebp - 0x340]
mov byte [edx], 0
mov dword [esp], eax
call fcn.0040e1f0
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], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x4061ad
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 0x406a13
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 0x4069ec
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 0x406a7a
cmp dword [ebp - 0x354], 0x40
jbe 0x40693b
mov eax, dword [ebp - 0x34c]
cmp word [eax], 0x5a4d
jne 0x40693b
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 0x406976
cmp word [eax], 0x454e
jne 0x406976
movzx ecx, word [eax + 0x24]
add ecx, eax
lea eax, [ecx + 2]
cmp ebx, eax
jb 0x406710
movzx ebx, word [ecx]
add ecx, 0xa
mov word [ebp - 0x35c], bx
xor ebx, ebx
cmp edx, ecx
jae 0x40654e
jmp 0x406710
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 0x406710
movzx ecx, word [eax]
test cx, cx
je 0x406790
cmp cx, 0x800e
jne 0x406530
mov esi, eax
jmp 0x406538
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], 0x40f000
mov dword [esp], 3
call fcn.00401580
jmp 0x405ff2
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x406140
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x406140
lea ebx, [eax - 0x20]
cmp bx, 0x5e
jbe 0x406760
mov ebx, eax
mov byte [ecx], 0x5c
add ecx, 5
shr bx, 0xc
movzx ebx, bx
movzx ebx, byte [ebx + str.0123456789abcdef]
mov byte [ecx - 4], bl
mov ebx, eax
shr bx, 8
and ebx, 0xf
movzx ebx, byte [ebx + str.0123456789abcdef]
mov byte [ecx - 3], bl
mov ebx, eax
and eax, 0xf
shr bx, 4
movzx eax, byte [eax + str.0123456789abcdef]
and ebx, 0xf
movzx ebx, byte [ebx + str.0123456789abcdef]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x406140
mov eax, 0x225c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x406140
mov ebx, 0x725c
add eax, 2
mov word [eax - 2], bx
jmp 0x406270
lea esi, [edx - 0x20]
cmp si, 0x5e
jbe 0x406840
mov esi, edx
mov byte [eax], 0x5c
add eax, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdef]
mov esi, edx
shr si, 8
and esi, 0xf
mov byte [eax - 4], bl
movzx ebx, byte [esi + str.0123456789abcdef]
mov esi, edx
and edx, 0xf
shr si, 4
movzx edx, byte [edx + str.0123456789abcdef]
and esi, 0xf
mov byte [eax - 3], bl
movzx ebx, byte [esi + str.0123456789abcdef]
mov byte [eax - 1], dl
mov byte [eax - 2], bl
jmp 0x406270
mov esi, 0x225c
add eax, 2
mov word [eax - 2], si
jmp 0x406270
mov edx, 0x745c
add eax, 2
mov word [eax - 2], dx
jmp 0x406270
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.00401470
jmp 0x4062fa
mov edi, 0x80004005
test byte [section..data], 4
jne 0x4068cd
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 0x406061
mov byte [ecx], al
add ecx, 1
jmp 0x406140
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.00401470
jmp 0x40636c
test esi, esi
je 0x406be8
test ebx, ebx
je 0x406bad
movzx eax, word [esi + 2]
cmp edi, eax
jge 0x406aea
lea eax, [edi + edi*2]
lea eax, [esi + eax*4 + 8]
lea ecx, [eax + 0xc]
cmp edx, ecx
jb 0x406aaf
movzx ecx, byte [ebp - 0x35c]
movzx eax, word [eax]
mov esi, dword [ebp - 0x34c]
shl eax, cl
lea ecx, [esi + eax]
movzx eax, word [ecx + 4]
imul eax, eax, 0xe
lea eax, [ecx + eax + 0x14]
cmp edx, eax
jb 0x4069b1
mov eax, dword [ebp - 0x34c]
xor edx, edx
mov dword [ebp - 0x338], ebx
mov dword [ebp - 0x340], eax
mov eax, dword [ebp - 0x354]
mov dword [ebp - 0x33c], eax
movzx eax, word [ebp - 0x35c]
mov word [ebp - 0x334], ax
lea eax, [ebp - 0x340]
call fcn.00403590
mov esi, dword [ebp - 0x348]
cmp eax, 1
sbb edi, edi
mov dword [esi], eax
and edi, 0x80004005
jmp 0x406722
mov byte [eax], dl
add eax, 1
jmp 0x406270
mov edi, 0x80070490
test byte [section..data], 4
je 0x406061
mov dword [esp + 0xc], str.SearchPath_failed_n
mov dword [esp + 8], str.open_module_icon
mov dword [esp + 4], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406061
mov eax, 0x224c
mov byte [ebp - 0x33e], 0x22
lea ecx, [ebp - 0x33e]
mov word [ebp - 0x340], ax
lea eax, [ecx + 1]
jmp 0x4062e9
mov edi, 0x224c
mov byte [ebp - 0x33e], 0x22
lea eax, [ebp - 0x33e]
mov word [ebp - 0x340], di
lea edx, [eax + 1]
jmp 0x40635b
mov dword [esp + 0xc], str.file_too_small_for_resource_table_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406722
test byte [section..data], 4
jne 0x406915
mov dword [esp], esi
mov edi, 0x80070490
call dword [sym.imp.kernel32.dll_FreeLibrary]
sub esp, 4
jmp 0x406061
mov dword [esp + 0xc], str.found_no_icon_n
mov dword [esp + 8], str.open_module_icon
mov dword [esp + 4], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x4068ff
mov edi, 0x80004005
test byte [section..data], 4
je 0x406722
mov dword [esp + 0xc], str.file_too_small_for_MZ_header_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406722
mov edi, 0x80004005
test byte [section..data], 4
je 0x406722
mov dword [esp + 0xc], str.file_too_small_for_NE_header_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406722
mov edi, 0x80004005
test byte [section..data], 4
je 0x406722
mov dword [esp + 0xc], str.file_too_small_for_GRPICONDIR_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406722
test byte [section..data], 4
jne 0x406b25
mov eax, dword [ebp - 0x350]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push eax
mov edi, 0x80004005
jmp 0x406061
test byte [section..data], 4
je 0x406a09
mov eax, ebx
mov esi, dword [edx + 0x34]
shr eax, 0x10
je 0x406b95
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
push edx
push edx
test eax, eax
jne 0x406c23
mov eax, ebx
call fcn.00401290
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], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406a09
test byte [section..data], 4
jne 0x406b65
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 0x406061
mov edi, 0x80004005
test byte [section..data], 4
je 0x406722
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], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406722
mov edi, 0x80004005
test byte [section..data], 4
je 0x406722
mov dword [esp + 0xc], str.icon_index_out_of_range_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406722
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], 0x40f000
mov dword [esp], 2
call fcn.00401580
mov eax, dword [ebp - 0x350]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push edi
jmp 0x406a09
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], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406a87
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.00401470
jmp 0x406a4c
mov edi, 0x80004005
test byte [section..data], 4
je 0x406722
mov dword [esp + 0xc], str.no_icon_resource_type_found_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406722
mov edi, 0x80004005
test byte [section..data], 4
je 0x406722
mov dword [esp + 0xc], str.no_group_icon_resource_type_found_n
mov dword [esp + 8], str.open_module16_icon
mov dword [esp + 4], 0x40f000
mov dword [esp], 2
call fcn.00401580
jmp 0x406722
mov eax, str._invalid_
jmp 0x406a4c