Function at 0x401790
Capabilities:
Access peb ldr_data
Extract resource via kernel32 functions

Disassembly:
push 0xffffffffffffffff
push 0x402048
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x28
push esi
push edi
lea ecx, [esp + 8]
call sub.MFC42.DLL_CString::CString
xor edi, edi
mov dword [esp + 0x38], edi
call sub.MFC42.DLL_AfxGetModuleState
mov ecx, dword [esp + 0x40]
mov eax, dword [eax + 8]
and ecx, 0xffff
push 0x4040b8
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
cmp esi, edi
jne 0x401829
mov edx, dword [esp + 0x44]
lea ecx, [esp + 8]
mov eax, dword [edx]
push eax
push str.Cant_Find__s_resource__t_r_nThis_program_file_has_been_damaged__t
push ecx
call sub.MFC42.DLL_CString::Format
mov edx, dword [esp + 0x14]
add esp, 0xc
push edi
push edi
push edx
call sub.MFC42.DLL_AfxMessageBox
lea ecx, [esp + 8]
mov dword [esp + 0x38], 0xffffffff
call fcn.00401c5c
pop edi
xor eax, eax
pop esi
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
add esp, 0x34
ret 8
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 8]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
cmp eax, edi
mov dword [esp + 0x40], eax
jne 0x40188c
mov eax, dword [esp + 0x44]
lea edx, [esp + 8]
mov ecx, dword [eax]
push ecx
push str.Invalid__s_resource__t_r_nThis_program_file_has_been_damaged__t
push edx
call sub.MFC42.DLL_CString::Format
mov eax, dword [esp + 0x14]
add esp, 0xc
push edi
push edi
push eax
call sub.MFC42.DLL_AfxMessageBox
lea ecx, [esp + 8]
mov dword [esp + 0x38], 0xffffffff
call fcn.00401c5c
pop edi
xor eax, eax
pop esi
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
add esp, 0x34
ret 8
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 8]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
lea ecx, [esp + 0x1c]
mov esi, eax
call sub.MFC42.DLL_CException::CException
lea ecx, [esp + 0x2c]
mov byte [esp + 0x38], 1
call sub.MFC42.DLL_CString::CString
push edi
lea ecx, [esp + 0x30]
mov byte [esp + 0x3c], 2
mov dword [esp + 0x20], 0x4032b0
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], 0xffffffff
call fcn.00401c50
lea ecx, [esp + 0xc]
mov byte [esp + 0x38], 3
call sub.MFC42.DLL_CFile::CFile
mov edi, dword [esp + 0x44]
lea ecx, [esp + 0x1c]
push ecx
push 0x1011
mov eax, dword [edi]
lea ecx, [esp + 0x14]
push eax
mov byte [esp + 0x44], 4
call sub.MFC42.DLL_CFile::Open
test eax, eax
jne 0x401985
mov edx, dword [edi]
lea eax, [esp + 8]
push edx
push str.File__s_create_failure__t
push eax
call sub.MFC42.DLL_CString::Format
mov ecx, dword [esp + 0x14]
add esp, 0xc
push 0
push 0
push ecx
call sub.MFC42.DLL_AfxMessageBox
lea ecx, [esp + 0xc]
mov byte [esp + 0x38], 3
call fcn.00401c3e
mov dword [esp + 0x1c], 0x4032b0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x38], 5
call fcn.00401c5c
lea ecx, [esp + 8]
mov dword [esp + 0x1c], 0x40329c
mov dword [esp + 0x38], 0xffffffff
call fcn.00401c5c
pop edi
xor eax, eax
pop esi
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
add esp, 0x34
ret 8
mov edx, dword [esp + 0x40]
lea ecx, [esp + 0xc]
push edx
push esi
call sub.MFC42.DLL_CFile::Write
lea ecx, [esp + 0xc]
call sub.MFC42.DLL_CFile::Close
lea ecx, [esp + 0xc]
mov byte [esp + 0x38], 3
call fcn.00401c3e
mov dword [esp + 0x1c], 0x4032b0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x38], 6
call fcn.00401c5c
lea ecx, [esp + 8]
mov dword [esp + 0x1c], 0x40329c
mov dword [esp + 0x38], 0xffffffff
call fcn.00401c5c
mov ecx, dword [esp + 0x30]
pop edi
mov eax, 1
pop esi
mov dword fs:[0], ecx
add esp, 0x34
ret 8