Function at 0x4048d0
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]
sub eax, 1
sub esp, 0x18
cmp eax, 0x103
ja 0x405228
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 0x404b60
test edi, edi
js 0x404a30
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], 0x4011c0
mov dword [esp + 4], 0xe
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_EnumResourceNamesW]
sub esp, 0x10
test eax, eax
jne 0x4049b2
cmp dword [ebp - 0x348], 0xffffffff
je 0x4049b2
test byte [section..data], 8
jne 0x404f40
mov edi, dword [ebp - 0x350]
test edi, edi
je 0x4052ce
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 0x404a15
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LockResource]
sub esp, 4
mov ecx, eax
test eax, eax
je 0x404a04
mov edx, esi
xor eax, eax
xor edi, edi
call fcn.00401ac0
mov edx, dword [ebp - 0x35c]
mov dword [edx], eax
test eax, eax
jne 0x404a09
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 0x4049b8
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x364], eax
mov eax, ebx
shr eax, 0x10
je 0x4050d0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x404ccc
cmp word [ebp - 0x220], 0
je 0x405263
lea esi, [esi]
nop
mov edx, eax
lea eax, [eax + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x404ab0
mov ecx, 0x224c
mov dword [ebp - 0x368], edi
mov word [ebp - 0x34c], cx
lea ecx, [ebp - 0x34a]
mov dword [ebp - 0x360], ebx
jmp 0x404b1b
cmp ax, 9
je 0x404f98
cmp ax, 0xa
jne 0x404fb6
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea eax, [edx - 1]
test edx, edx
jle 0x404c98
lea ebx, [ebp - 0x22a]
cmp ecx, ebx
ja 0x404c98
mov edx, eax
add dword [ebp - 0x360], 2
mov eax, dword [ebp - 0x360]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x404f80
jbe 0x404ae0
cmp ax, 0x22
je 0x405010
cmp ax, 0x5c
jne 0x404fa9
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x404b00
mov edx, dword fs:[0x18]
cmp dword [edx + 0x34], 0xc1
je 0x404d78
test byte [section..data], 4
jne 0x404ba0
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 0x405150
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x404d3e
cmp word [ebp - 0x220], 0
je 0x405284
lea esi, [esi]
nop
mov edx, eax
lea eax, [eax + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x404be8
mov esi, 0x224c
mov dword [ebp - 0x35c], ebx
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], si
lea esi, [ebp - 0x22a]
jmp 0x404c55
cmp ax, 9
je 0x4050b8
cmp ax, 0xa
jne 0x405046
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
nop
lea eax, [edx - 1]
test edx, edx
jle 0x404d10
cmp ecx, esi
ja 0x404d10
mov edx, eax
add dword [ebp - 0x35c], 2
mov eax, dword [ebp - 0x35c]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x405028
jbe 0x404c18
cmp ax, 0x22
je 0x4050a0
cmp ax, 0x5c
jne 0x405039
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x404c40
mov byte [ecx], 0x22
mov edi, dword [ebp - 0x368]
test eax, eax
jle 0x40527c
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 fcn.0040b160
mov edx, eax
mov eax, dword [ebp - 0x364]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], eax
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 fcn.004014e0
mov edi, dword [ebp - 0x350]
jmp 0x4049b8
mov byte [ecx], 0x22
test eax, eax
jle 0x40529d
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 fcn.0040b160
mov edx, eax
mov eax, dword [ebp - 0x360]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.LoadLibraryExW___s__failed__error__ld_n
mov dword [esp + 0x14], eax
mov dword [esp + 8], str.open_module_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call fcn.004014e0
jmp 0x404b7d
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 0x4053eb
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 0x4053c4
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 0x405452
cmp dword [ebp - 0x368], 0x40
jbe 0x405313
mov eax, dword [ebp - 0x360]
cmp word [eax], 0x5a4d
jne 0x405313
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 0x40534e
cmp word [eax], 0x454e
jne 0x40534e
movzx ecx, word [eax + 0x24]
add eax, ecx
mov dword [ebp - 0x370], eax
add eax, 2
cmp ebx, eax
jb 0x4050f0
mov ebx, dword [ebp - 0x370]
lea ecx, [ebx + 0xa]
xor ebx, ebx
cmp edx, ecx
jae 0x404f26
jmp 0x4050f0
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 0x4050f0
movzx ecx, word [eax]
test cx, cx
je 0x405170
cmp cx, 0x800e
jne 0x404f08
mov esi, eax
jmp 0x404f10
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 fcn.004014e0
jmp 0x4049b2
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x404b00
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x404b00
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x405140
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefxmalloc]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x404b00
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x404b00
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x404c40
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x405218
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefxmalloc]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x404c40
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x404c40
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x404c40
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.00401420
mov edx, eax
jmp 0x404ccc
mov edi, 0x80004005
test byte [section..data], 4
jne 0x4052a5
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 0x404a21
mov byte [ecx], al
add ecx, 1
jmp 0x404b00
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.00401420
mov edx, eax
jmp 0x404d3e
test esi, esi
je 0x4055c0
test ebx, ebx
je 0x405585
movzx eax, word [esi + 2]
cmp edi, eax
jge 0x4054c2
lea eax, [edi + edi*2]
lea eax, [esi + eax*4 + 8]
lea ecx, [eax + 0xc]
cmp edx, ecx
jb 0x405487
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 0x405389
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 fcn.00401ac0
mov esi, dword [ebp - 0x35c]
cmp eax, 1
sbb edi, edi
mov dword [esi], eax
and edi, 0x80004005
jmp 0x405102
mov byte [ecx], al
add ecx, 1
jmp 0x404c40
mov edi, 0x80070490
test byte [section..data], 4
je 0x404a21
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 fcn.004014e0
jmp 0x404a21
mov eax, 0x224c
mov byte [ebp - 0x34a], 0x22
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], ax
lea eax, [ecx + 1]
jmp 0x404cb9
mov edi, 0x224c
mov byte [ebp - 0x34a], 0x22
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], di
lea eax, [ecx + 1]
jmp 0x404d2b
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 fcn.004014e0
jmp 0x405102
test byte [section..data], 4
jne 0x4052ed
mov dword [esp], esi
mov edi, 0x80070490
call dword [sym.imp.kernel32.dll_FreeLibrary]
sub esp, 4
jmp 0x404a21
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 fcn.004014e0
jmp 0x4052d7
mov edi, 0x80004005
test byte [section..data], 4
je 0x405102
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 fcn.004014e0
jmp 0x405102
mov edi, 0x80004005
test byte [section..data], 4
je 0x405102
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 fcn.004014e0
jmp 0x405102
mov edi, 0x80004005
test byte [section..data], 4
je 0x405102
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 fcn.004014e0
jmp 0x405102
test byte [section..data], 4
jne 0x4054fd
mov eax, dword [ebp - 0x364]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push eax
mov edi, 0x80004005
jmp 0x404a21
test byte [section..data], 4
je 0x4053e1
mov eax, ebx
mov esi, dword [edx + 0x34]
shr eax, 0x10
je 0x40556d
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
push edx
push edx
test eax, eax
jne 0x4055fb
mov eax, ebx
call fcn.00401240
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 fcn.004014e0
jmp 0x4053e1
test byte [section..data], 4
jne 0x40553d
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 0x404a21
mov edi, 0x80004005
test byte [section..data], 4
je 0x405102
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 fcn.004014e0
jmp 0x405102
mov edi, 0x80004005
test byte [section..data], 4
je 0x405102
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 fcn.004014e0
jmp 0x405102
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 fcn.004014e0
mov eax, dword [ebp - 0x364]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
push eax
jmp 0x4053e1
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 fcn.004014e0
jmp 0x40545f
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.00401420
jmp 0x405424
mov edi, 0x80004005
test byte [section..data], 4
je 0x405102
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 fcn.004014e0
jmp 0x405102
mov edi, 0x80004005
test byte [section..data], 4
je 0x405102
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 fcn.004014e0
jmp 0x405102
mov eax, str._invalid_
jmp 0x405424