Function at 0x413480
Capabilities:
Copy file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42eac0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x38
push ebx
push esi
mov esi, ecx
push edi
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x1c], esi
call sub.MFC42.DLL_CFile::CFile
lea ecx, [ebp - 0x44]
mov dword [ebp - 4], 0
call sub.MFC42.DLL_CFile::CFile
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.0042d028
mov edi, dword [ebp + 8]
mov ecx, dword [esi + 0x23f8]
mov byte [ebp - 4], 2
mov eax, dword [edi]
push eax
push ecx
call dword [sym.imp.MSVCRT.dll__mbsicmp]
add esp, 8
test eax, eax
jne 0x4134f3
push eax
push eax
push str.the_save_file_name_can_not_be_same_with_the_original_firmware_file_name_
jmp 0x4135fb
mov eax, dword [edi]
mov ecx, dword [esi + 0x23f8]
push 0
push eax
push ecx
mov byte [ebp - 4], 3
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x413519
push eax
push eax
push str.Copy_original_firmware_file_fail_
jmp 0x4135fb
mov eax, dword [edi]
push 0
push 0x12
push eax
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Open
test eax, eax
jne 0x41355c
push edi
lea eax, [ebp + 8]
push str.Can_not_open_output_firmware_file
push eax
call sub.MFC42.DLL_operator
mov eax, dword [eax]
push 0
push 0
push eax
mov byte [ebp - 4], 4
call sub.MFC42.DLL_AfxMessageBox
lea ecx, [ebp + 8]
mov byte [ebp - 4], 3
call sub.MFC42.DLL_CString::CString
jmp 0x413600
xor ecx, ecx
mov dword [ebp - 0x20], ecx
cmp ecx, dword [esi + 0x23ec]
jge 0x413972
lea eax, [ecx*8]
sub eax, ecx
lea ecx, [eax + eax*2]
shl ecx, 4
add esi, ecx
cmp dword [esi + 0xef0], 0x10ef0100
je 0x4137ef
mov al, byte [esi + 0xeec]
test al, al
je 0x413961
mov edx, dword [ebp - 0x20]
lea edi, [esi + 0xf34]
push edx
push ecx
mov ecx, esp
mov dword [ebp + 8], esp
push edi
call sub.MFC42.DLL_CString::CString_2
mov ecx, dword [ebp - 0x1c]
call fcn.00412f30
test al, al
jne 0x4135c8
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Close
jmp 0x413600
push 0
push 0
push edi
lea ecx, [ebp - 0x44]
call sub.MFC42.DLL_CFile::Open
test eax, eax
jne 0x41363c
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Close
push edi
lea eax, [ebp - 0x14]
push str.Open_chunk_file__s_fail_
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0xc
mov ecx, dword [ebp - 0x14]
push 0
push 0
push ecx
call sub.MFC42.DLL_AfxMessageBox
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call sub.MFC42.DLL_CString::CString
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 0
call fcn.0042d0a0
lea ecx, [ebp - 0x34]
mov dword [ebp - 4], 0xffffffff
call fcn.0042d0a0
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [esi + 0x1034]
push eax
mov dword [ebp + 8], eax
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x41366b
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Close
lea ecx, [ebp - 0x44]
call sub.MFC42.DLL_CFile::Close
push edi
jmp 0x413840
mov eax, dword [esi + 0xef0]
mov ecx, dword [ebp + 8]
cmp eax, 0x4fb0100
jne 0x413680
or eax, 0xffffffff
jmp 0x413682
xor eax, eax
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
lea ecx, [ebp - 0x44]
call sub.MFC42.DLL_CFile::GetLength
mov edi, eax
mov eax, dword [esi + 0xefc]
cmp eax, 0x4e435243
mov eax, dword [esi + 0xef0]
mov dword [ebp - 0x24], edi
jne 0x413728
cmp eax, 0xe3000010
push 0
jne 0x4136f1
mov eax, dword [esi + 0xf30]
lea ecx, [ebp - 0x34]
add eax, 0x80
push eax
call sub.MFC42.DLL_CFile::Seek
push 0
push 0x80
lea ecx, [ebp - 0x44]
call sub.MFC42.DLL_CFile::Seek
lea esi, [edi - 0x80]
lea ecx, [ebp - 0x44]
push esi
push ebx
call sub.MFC42.DLL_CFile::Read
push esi
jmp 0x4137c7
mov ecx, dword [esi + 0xf30]
add ecx, 0x80
push ecx
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Seek
push edi
push ebx
lea ecx, [ebp - 0x44]
call sub.MFC42.DLL_CFile::Read
mov al, 1
test al, al
je 0x413722
mov edx, dword [ebp + 8]
add edx, 0xffffff80
push edx
jmp 0x4137c7
push edi
jmp 0x4137c7
cmp eax, 0x1fe0101
jne 0x413739
mov eax, dword [ebp - 0x1c]
mov byte [eax + 0x2410], 1
mov ecx, dword [esi + 0xf30]
push 0
push ecx
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Seek
push 0x80
push ebx
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Read
lea edx, [ebx + 0x80]
push edi
push edx
lea ecx, [ebp - 0x44]
call sub.MFC42.DLL_CFile::Read
add edi, 0x70
lea eax, [ebx + 0x10]
push edi
push eax
push 0xffffffffffffffff
call fcn.00415030
lea ecx, [ebp - 0x18]
mov dword [esi + 0xefc], eax
push ecx
push eax
call fcn.00413110
mov edx, dword [ebp - 0x18]
lea eax, [ebp - 0x18]
push eax
push edi
mov dword [ebx + 0xc], edx
call fcn.00413110
mov ecx, dword [ebp - 0x18]
add esp, 0x1c
mov dword [ebx + 4], ecx
mov edx, dword [esi + 0xf30]
push 0
push edx
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Seek
mov al, 1
test al, al
je 0x4137bd
mov eax, dword [ebp + 8]
push eax
jmp 0x4137c7
mov ecx, dword [ebp - 0x24]
add ecx, 0x80
push ecx
push ebx
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Write
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Flush
push ebx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
lea ecx, [ebp - 0x44]
call sub.MFC42.DLL_CFile::Close
jmp 0x413961
mov edi, dword [esi + 0x1034]
mov dword [ebp + 8], edi
lea edx, [edi - 0x80]
cmp edx, 0x588
jae 0x413821
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Close
lea eax, [ebp - 0x14]
push str.the_size_of_Common_data_is_too_big__can_not_insert_to_FW__n
push eax
call sub.MFC42.DLL_CString::Format
add esp, 8
jmp 0x4135f3
push edi
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x41385e
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Close
add esi, 0xf34
push esi
lea edx, [ebp - 0x14]
push str.allocate_buffer_for_chunk_file__s_fail_
push edx
call sub.MFC42.DLL_CString::Format
mov eax, dword [ebp - 0x14]
add esp, 0xc
push 0
push 0
push eax
jmp 0x4135fb
mov ecx, edi
xor eax, eax
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
cmp dword [esi + 0xefc], 0x4e435243
jne 0x4138af
mov ecx, dword [ebp - 0x1c]
push ebx
call fcn.00413c60
mov eax, dword [esi + 0xf30]
push 0
add eax, 0x80
lea ecx, [ebp - 0x34]
push eax
call sub.MFC42.DLL_CFile::Seek
mov ecx, dword [esi + 0x1034]
sub ecx, 0x80
push ecx
jmp 0x413946
mov edx, dword [esi + 0xf30]
push 0
push edx
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Seek
push 0x80
push ebx
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Read
push ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push 0x43f8f8
call sub.MFC42.DLL_CString::CString_1
mov edi, dword [ebp - 0x1c]
mov ecx, edi
call fcn.00412830
lea eax, [ebx + 0x80]
mov ecx, edi
push eax
call fcn.00413c60
mov edi, dword [ebp + 8]
lea edx, [ebx + 0x10]
lea ecx, [edi - 0x10]
push ecx
push edx
push 0xffffffffffffffff
call fcn.00415030
lea ecx, [ebp - 0x18]
mov dword [esi + 0xefc], eax
push ecx
push eax
call fcn.00413110
mov edx, dword [ebp - 0x18]
lea eax, [ebp - 0x18]
lea ecx, [edi - 0x10]
push eax
push ecx
mov dword [ebx + 0xc], edx
call fcn.00413110
mov edx, dword [ebp - 0x18]
add esp, 0x1c
mov dword [ebx + 4], edx
mov eax, dword [esi + 0xf30]
push 0
push eax
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Seek
push edi
push ebx
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Write
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Flush
push ebx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov eax, dword [ebp - 0x20]
mov esi, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x20], eax
mov ecx, eax
jmp 0x413561
push 0
push 0x102
lea ecx, [ebp - 0x34]
add esi, 6
call sub.MFC42.DLL_CFile::Seek
push 6
push esi
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Write
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Flush
lea ecx, [ebp - 0x34]
call sub.MFC42.DLL_CFile::Close
lea ecx, [ebp - 0x14]
mov dword [ebp - 4], 1
call sub.MFC42.DLL_CString::CString
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 0
call fcn.0042d0a0
lea ecx, [ebp - 0x34]
mov dword [ebp - 4], 0xffffffff
call fcn.0042d0a0
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov al, 1
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 4