Function at 0x40db5a
Capabilities:
Extract resource via kernel32 functions
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov esi, str.ToolBox_XmpSetup::SaveResAs
push esi
call fcn.00406c58
xor edi, edi
pop ecx
test eax, eax
jne 0x40dbb3
push 1
push dword [ebp + 0x10]
push str._lpSaveName
push dword [ebp + 0xc]
push str._XmpSetup_SaveResAs_lpType
push edi
push esi
call fcn.0040af0a
pop ecx
pop ecx
mov ecx, eax
call fcn.0040cf55
mov ecx, eax
call fcn.004014be
mov ecx, eax
call fcn.0040cf55
mov ecx, eax
call fcn.004014be
mov ecx, eax
call fcn.0040b982
cmp dword [ebp + 8], edi
je 0x40ddd3
cmp dword [ebp + 0xc], edi
je 0x40ddd3
cmp dword [ebp + 0x10], edi
je 0x40ddd3
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov ebx, eax
cmp ebx, edi
jne 0x40dbfe
push esi
call fcn.00406c58
pop ecx
test eax, eax
jne 0x40ddfc
push 1
push str._XmpSetup_can_not_find_the_resource
jmp 0x40dde5
push ebx
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp + 8], eax
cmp eax, edi
jne 0x40dc2a
push esi
call fcn.00406c58
pop ecx
test eax, eax
jne 0x40ddfc
push 1
push str._XmpSetup_can_not_get_the_resources_size
jmp 0x40dde5
push ebx
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 4], eax
cmp eax, edi
jne 0x40dc56
push esi
call fcn.00406c58
pop ecx
test eax, eax
jne 0x40ddfc
push 1
push str._XmpSetup_can_not_load_the_resource
jmp 0x40dde5
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x14], eax
cmp eax, edi
jne 0x40dc7f
push esi
call fcn.00406c58
pop ecx
test eax, eax
jne 0x40ddfc
push 1
push str._XmpSetup_can_not_lock_the_resource
jmp 0x40dde5
push edi
push 0x80
push 2
push edi
xor ebx, ebx
inc ebx
push ebx
push 0x40000000
push dword [ebp + 0x10]
mov dword [ebp - 8], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
jne 0x40dce9
push esi
call fcn.00406c58
pop ecx
test eax, eax
jne 0x40dcdb
push ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._XmpSetup_create_file_failed_last_error_
push edi
push esi
call fcn.0040af0a
pop ecx
pop ecx
mov ecx, eax
call fcn.0040cf55
mov ecx, eax
call fcn.00401342
mov ecx, eax
call fcn.0040b982
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x40ddfc
push edi
push edi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40dd12
push esi
call fcn.00406c58
pop ecx
test eax, eax
jne 0x40dcdb
push ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._XmpSetup_move_pointer_failed_last_error_
jmp 0x40dcbd
xor ebx, ebx
cmp dword [ebp + 8], edi
jbe 0x40dd89
mov ecx, dword [ebp + 8]
sub ecx, ebx
mov eax, 0xfa000
cmp ecx, eax
ja 0x40dd29
mov eax, ecx
push edi
lea ecx, [ebp - 0xc]
push ecx
push eax
mov eax, dword [ebp - 0x14]
add eax, ebx
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0xc], edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40dd4f
add ebx, dword [ebp - 0xc]
cmp ebx, dword [ebp + 8]
jb 0x40dd19
jmp 0x40dd89
push esi
call fcn.00406c58
pop ecx
test eax, eax
jne 0x40dd86
push 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._XmpSetup_save_resource_failed_lasterror
push edi
push esi
call fcn.0040af0a
pop ecx
pop ecx
mov ecx, eax
call fcn.0040cf55
mov ecx, eax
call fcn.00401342
mov ecx, eax
call fcn.0040b982
mov dword [ebp - 8], edi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FreeResource]
push esi
call fcn.00406c58
pop ecx
test eax, eax
jne 0x40ddce
push 1
push dword [ebp - 8]
push str._XmpSetup_save_resource_result
push edi
push esi
call fcn.0040af0a
pop ecx
pop ecx
mov ecx, eax
call fcn.0040cf55
mov ecx, eax
call fcn.004011cb
mov ecx, eax
call fcn.0040b982
mov eax, dword [ebp - 8]
jmp 0x40ddfe
push esi
call fcn.00406c58
pop ecx
test eax, eax
jne 0x40ddfc
push 1
push str._XmpSetup_bad_param
push edi
push esi
call fcn.0040af0a
pop ecx
pop ecx
mov ecx, eax
call fcn.0040cf55
mov ecx, eax
call fcn.0040b982
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret