Function at 0x403590
Capabilities:
Extract resource via kernel32 functions
Get process heap flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
push ebx
sub esp, 0x6c
mov dword [ebp - 0x2c], edx
movzx edx, word [ecx + 4]
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x28], 0
test dx, dx
je 0x403b4c
mov eax, ecx
movzx ecx, dx
xor edx, edx
imul ecx, ecx, 0xe
add eax, 0xe
add ecx, eax
lea esi, [esi]
add edx, dword [eax]
add eax, 0xe
cmp eax, ecx
jne 0x4035c8
mov eax, edx
call sym._xmalloc
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x38]
movzx eax, word [eax + 4]
shl eax, 4
call sym._xmalloc
mov dword [ebp - 0x48], eax
lea eax, [ebp - 0x28]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov dword [esp], 0
call sym._CreateStreamOnHGlobal_12
sub esp, 0xc
test eax, eax
js 0x403a18
test esi, esi
je 0x4037b8
mov eax, dword [ebp - 0x38]
cmp word [eax + 4], 0
je 0x4038e0
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x40], 0
mov edx, esi
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x2c], 0
lea edi, [eax + 6]
mov esi, edi
lea esi, [esi]
nop
mov ecx, dword [edx + 8]
movzx edi, word [ecx + 2]
lea eax, [ecx + 8]
mov dword [ebp - 0x30], edi
test di, di
je 0x4036a0
mov ebx, dword [edx + 4]
mov dword [ebp - 0x34], edx
xor ecx, ecx
mov dword [ebp - 0x3c], ebx
add ebx, dword [edx]
mov edi, eax
add eax, 0xc
cmp ebx, eax
jb 0x403940
movzx edx, word [esi + 0xc]
or dx, 0x8000
cmp word [eax - 6], dx
je 0x403980
mov edi, dword [ebp - 0x30]
add ecx, 1
cmp ecx, edi
jne 0x40366f
mov edx, dword [ebp - 0x34]
lea esi, [esi]
mov eax, dword [ebp - 0x38]
add dword [ebp - 0x2c], 1
add esi, 0xe
mov edi, dword [ebp - 0x2c]
movzx eax, word [eax + 4]
cmp edi, eax
jl 0x403650
mov eax, dword [ebp - 0x44]
test eax, eax
je 0x4038e0
mov edi, dword [ebp - 0x44]
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x20], 0x10000
lea ecx, [ebp - 0x20]
lea ebx, [ebp - 0x24]
mov word [ebp - 0x1c], di
mov edx, dword [eax]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 6
mov dword [esp + 4], ecx
mov dword [esp], eax
call dword [edx + 0x10]
sub esp, 0x10
mov esi, eax
test eax, eax
js 0x403b3a
cmp dword [ebp - 0x24], 6
jne 0x403a88
mov ecx, dword [ebp - 0x48]
mov esi, edi
shl edi, 4
lea eax, [edi + 6]
mov dword [ebp - 0x2c], eax
mov eax, ecx
add ecx, edi
test esi, esi
jle 0x403747
mov edx, ecx
sub edx, eax
mov esi, edx
and esi, 0x10
je 0x403737
mov eax, dword [ebp - 0x48]
mov esi, dword [ebp - 0x2c]
add dword [eax + 0xc], esi
add eax, 0x10
cmp ecx, eax
je 0x403747
mov edx, dword [ebp - 0x2c]
add dword [eax + 0xc], edx
add dword [eax + 0x1c], edx
add eax, 0x20
cmp ecx, eax
jne 0x40373a
mov eax, dword [ebp - 0x28]
mov edx, dword [eax]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], edi
mov esi, dword [ebp - 0x48]
mov dword [esp], eax
mov dword [esp + 4], esi
call dword [edx + 0x10]
sub esp, 0x10
mov esi, eax
test eax, eax
js 0x403c2a
cmp dword [ebp - 0x24], edi
je 0x403b7c
test byte [0x40d014], 2
je 0x4038ed
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.error_0x_08lX_writing_icon_dir_entries_to_stream_n
mov dword [esp + 8], global___FUNCTION__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x403abd
mov edx, dword [ebp - 0x2c]
test edx, edx
je 0x4038e0
mov eax, dword [ebp - 0x38]
cmp word [eax + 4], 0
je 0x4038e0
mov dword [ebp - 0x40], 0
lea edi, [eax + 6]
xor esi, esi
mov dword [ebp - 0x44], 0
lea esi, [esi]
mov dword [esp + 8], 3
movzx eax, word [edi + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FindResourceW]
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x4038be
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LoadResource]
sub esp, 8
mov ecx, eax
test eax, eax
je 0x4038be
mov eax, dword [ebx + 4]
mov ebx, dword [edi + 8]
mov dword [ebp - 0x34], eax
mov dword [esp], ecx
mov dword [ebp - 0x30], ecx
call dword [sym.imp.kernel32.dll_LockResource]
mov ecx, dword [ebp - 0x30]
sub esp, 4
test eax, eax
je 0x4038b2
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x48]
cmp edx, ebx
cmovbe ebx, edx
mov edx, dword [ebp - 0x44]
add dword [ebp - 0x44], 1
shl edx, 4
add edx, ecx
movzx ecx, byte [edi]
mov byte [edx], cl
movzx ecx, byte [edi + 1]
mov byte [edx + 1], cl
movzx ecx, byte [edi + 2]
mov byte [edx + 2], cl
movzx ecx, byte [edi + 3]
mov byte [edx + 3], cl
movzx ecx, word [edi + 4]
mov word [edx + 4], cx
movzx ecx, word [edi + 6]
mov dword [edx + 8], ebx
mov word [edx + 6], cx
mov ecx, dword [ebp - 0x40]
mov dword [edx + 0xc], ecx
mov edx, dword [ebp - 0x4c]
mov dword [esp + 8], ebx
add edx, ecx
mov dword [esp + 4], eax
mov dword [esp], edx
call sym._memcpy
add dword [ebp - 0x40], ebx
mov ecx, dword [ebp - 0x30]
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_FreeResource]
sub esp, 4
mov eax, dword [ebp - 0x38]
add esi, 1
add edi, 0xe
movzx eax, word [eax + 4]
cmp esi, eax
jl 0x4037e8
mov eax, dword [ebp - 0x44]
test eax, eax
jne 0x4036c0
nop
test byte [0x40d014], 2
jne 0x403b53
mov eax, dword [ebp - 0x4c]
mov dword [esp + 4], 0
mov esi, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [esi + 0x30]
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x48]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [esi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
sub esp, 0xc
mov eax, dword [ebp - 0x28]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [ebp - 0x34]
test byte [0x40d014], 4
je 0x4036a0
mov dword [ebp - 0x30], edx
mov dword [esp + 0xc], str.file_too_small_for_icon_NE_NAMEINFO_n
mov dword [esp + 8], str.populate_module16_icons
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
mov edx, dword [ebp - 0x30]
jmp 0x4036a0
mov edx, dword [ebp - 0x34]
movzx eax, word [edi]
movzx ecx, word [edx + 0xc]
shl eax, cl
add eax, dword [esi + 8]
cmp dword [ebp - 0x3c], eax
jb 0x403bf4
mov ebx, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x48]
mov dword [ebp - 0x30], edx
mov eax, ebx
add ebx, 1
shl eax, 4
mov dword [ebp - 0x44], ebx
add eax, ecx
movzx ecx, byte [esi]
mov byte [eax], cl
movzx ecx, byte [esi + 1]
mov byte [eax + 1], cl
movzx ecx, byte [esi + 2]
mov byte [eax + 2], cl
movzx ecx, byte [esi + 3]
mov byte [eax + 3], cl
movzx ecx, word [esi + 4]
mov word [eax + 4], cx
movzx ecx, word [esi + 6]
mov word [eax + 6], cx
mov ecx, dword [esi + 8]
mov dword [eax + 8], ecx
mov ecx, dword [ebp - 0x40]
mov dword [eax + 0xc], ecx
mov eax, dword [ebp - 0x4c]
movzx ebx, word [edi]
add eax, ecx
movzx ecx, word [edx + 0xc]
shl ebx, cl
mov ecx, dword [esi + 8]
add ebx, dword [edx]
mov dword [esp], eax
mov dword [esp + 4], ebx
mov dword [esp + 8], ecx
call sym._memcpy
mov eax, dword [esi + 8]
mov edx, dword [ebp - 0x30]
add dword [ebp - 0x40], eax
jmp 0x4036a0
test byte [0x40d014], 2
jne 0x403b11
mov eax, dword [ebp - 0x4c]
mov dword [esp + 4], 0
mov esi, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [esi + 0x30]
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x48]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [esi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
sub esp, 0xc
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x403a7e
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [0x40d014], 2
je 0x4038ed
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.error_0x_08lX_writing_icon_stream_n
mov dword [esp + 8], global___FUNCTION__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
mov eax, dword [ebp - 0x4c]
mov dword [esp + 4], 0
mov edi, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [edi + 0x30]
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x48]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
sub esp, 0xc
test esi, esi
jns 0x403934
jmp 0x403a6c
mov dword [esp + 0xc], str.error_creating_icon_stream_n
mov dword [esp + 8], global___FUNCTION__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x403a25
test byte [0x40d014], 2
je 0x403a25
jmp 0x403a95
xor edx, edx
jmp 0x4035d1
mov dword [esp + 0xc], str.no_valid_icon_entries_n
mov dword [esp + 8], global___FUNCTION__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x4038ed
mov eax, dword [ebp - 0x28]
mov edx, dword [eax]
mov dword [esp + 0xc], ebx
mov ebx, dword [ebp - 0x40]
mov dword [esp + 8], ebx
mov esi, dword [ebp - 0x4c]
mov dword [esp], eax
mov dword [esp + 4], esi
call dword [edx + 0x10]
sub esp, 0x10
mov esi, eax
test eax, eax
js 0x403be5
cmp dword [ebp - 0x24], ebx
je 0x403c3c
test byte [0x40d014], 2
je 0x4038ed
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.error_0x_08lX_writing_icon_images_to_stream_n
mov dword [esp + 8], global___FUNCTION__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x403abd
test byte [0x40d014], 2
je 0x403a25
jmp 0x403bb8
test byte [0x40d014], 4
je 0x4036b5
mov dword [esp + 0xc], str.file_too_small_for_icon_contents_n
mov dword [esp + 8], str.populate_module16_icons
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x4036b5
test byte [0x40d014], 2
je 0x403a25
jmp 0x403784
mov eax, dword [ebp - 0x28]
mov edx, dword [eax]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov dword [esp], eax
call dword [edx + 0x14]
sub esp, 0x14
mov esi, eax
jmp 0x403abd