Function at 0x40c050
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x42c004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov dword [ebp - 0x30], eax
mov esi, ecx
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0xc]
push edi
mov dword [ebp - 0x34], eax
xor edi, edi
xor eax, eax
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], edi
test ecx, ecx
je 0x40c1f1
lea eax, [ebp - 0xc]
mov edx, str.ApImg4Ticket
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.0041c6a0
add esp, 8
test eax, eax
jne 0x40c0df
mov edx, dword [ebp - 0x2c]
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x1c]
mov ecx, esi
push eax
push dword [ebp - 0xc]
mov eax, dword [ebp - 0x14]
push eax
push ebx
mov dword [ebp - 0x24], eax
call fcn.0040d970
add esp, 0x14
mov ebx, dword [ebp - 0x1c]
mov edi, dword [ebp - 0x20]
jmp 0x40c21e
push esi
push dword [ebp - 0x18]
xorps xmm0, xmm0
mov dword [ebp - 0x14], edi
movlpd qword [ebp - 0x10], xmm0
mov dword [ebp - 0x24], edi
call dword [sym.imp.plist.dll_plist_dict_get_item]
add esp, 8
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40c1cb
push eax
call dword [sym.imp.plist.dll_plist_get_node_type]
add esp, 4
cmp eax, 5
jne 0x40c1cb
push str.Blob
push dword [ebp - 0x18]
call dword [sym.imp.plist.dll_plist_dict_get_item]
add esp, 8
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40c1ad
push eax
call dword [sym.imp.plist.dll_plist_get_node_type]
add esp, 4
cmp eax, 7
jne 0x40c1ad
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.plist.dll_plist_get_data_val]
mov ebx, dword [ebp - 0x14]
add esp, 0xc
mov dword [ebp - 0x24], ebx
test ebx, ebx
je 0x40c1ee
mov edx, dword [ebp - 0x2c]
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x28]
push ecx
push ebx
push eax
mov ecx, esi
call fcn.0040cce0
add esp, 0x14
test eax, eax
jns 0x40c0d4
push esi
push str.ERROR:_Unable_to_replace__s_IMG3_signature_n
call fcn.004035a0
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041c84a
mov esp, ebp
pop ebp
ret
push esi
push str.ERROR:_Unable_to_find_blob_in__s_entry_n
call fcn.004035a0
add esp, 8
push esi
push str.NOTE:_No_SHSH_blob_found_for_component__s_n
call fcn.00403610
add esp, 8
jmp 0x40c1f1
push esi
push str.tss_response_get_blob_by_entry
push str.DEBUG:__s:_No_entry__s_in_TSS_response_n
call fcn.00403610
add esp, 0xc
push esi
push str.NOTE:_No_SHSH_blob_found_for_component__s_n
call fcn.00403610
add esp, 8
jmp 0x40c1f1
mov ebx, dword [ebp - 0x28]
push esi
push str.Not_personalizing_component__s..._n
call fcn.00403550
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
add esp, 0xc
test ebx, ebx
je 0x40c21e
mov eax, dword [ebp - 0x28]
mov edi, eax
push eax
push dword [ebp - 0x2c]
push ebx
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
push dword [ebp - 0x24]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
cmp dword [0x42ca7c], 0
je 0x40c295
push esi
push str.Writing_data_to__s_n
call fcn.00403610
push 0x41ea64
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
add esp, 0x10
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x40c264
push esi
push str.write_file:_Unable_to_open_file__s_n
call fcn.004035a0
add esp, 8
jmp 0x40c295
push eax
push edi
push 1
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov eax, dword [ebp - 0x14]
add esp, 0x14
cmp eax, edi
je 0x40c295
push edi
push eax
push esi
push str.ERROR:_Unable_to_write_entire_file:__s:__d_of__d_n
call fcn.004035a0
add esp, 0x10
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 4]
xor ecx, ebp
mov dword [eax], ebx
mov eax, dword [ebp - 0x34]
mov dword [eax], edi
xor eax, eax
pop edi
pop esi
pop ebx
call fcn.0041c84a
mov esp, ebp
pop ebp
ret