Function at 0x5142d0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [0x5f300c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
push edi
cmp byte [esi], 0
je 0x5142ef
call fcn.00514900
mov ecx, dword [esi + 0x17c]
push str.___ProcSet__PDF_Text__n_Font___F1_1_0_R_F2_2_0_R_F3_3_0_R_F4_4_0_R______n
call fcn.00513f20
mov ecx, dword [esi + 0x17c]
lea ebx, [esi + 0x80]
mov edx, eax
xor edi, edi
mov dword [ebp - 0x40], edx
mov eax, dword [ecx + 0x10]
mov ecx, dword [esi + 4]
mov dword [ebp - 0x44], eax
add eax, ecx
mov dword [ebp - 0x3c], eax
test ecx, ecx
jle 0x51435d
mov eax, dword [esi + 8]
push edx
add eax, edi
push eax
push dword [esi + 0x198]
push dword [esi + 0x194]
push dword [ebp - 0x3c]
push str.___Type_Page_Parent__d_0_R_n_MediaBox__0_0__ld__ld__n_Contents__d_0_R_n_Resources__d_0_R_n___n
push ebx
call fcn.004025c0
mov ecx, dword [esi + 0x17c]
add esp, 0x1c
push ebx
call fcn.00513f20
mov edx, dword [ebp - 0x40]
inc edi
cmp edi, dword [esi + 4]
jl 0x514324
push 0x14
lea ecx, [esi + 0x20]
push str.___Type_Pages_Kids__n
call fcn.0040af10
mov eax, dword [esi + 4]
xor edi, edi
test eax, eax
jle 0x51439a
mov eax, dword [ebp - 0x44]
add eax, edi
push eax
push str._d_0_R_n
push ebx
call fcn.004025c0
add esp, 0xc
lea ecx, [esi + 0x20]
push ebx
call fcn.00415b50
mov eax, dword [esi + 4]
inc edi
cmp edi, eax
jl 0x514375
push eax
push str.__Count__d_n___n
push ebx
call fcn.004025c0
add esp, 0xc
lea edi, [esi + 0x20]
mov ecx, edi
push ebx
call fcn.00415b50
cmp dword [edi + 0x14], 0x10
jb 0x5143bc
mov edi, dword [edi]
mov ecx, dword [esi + 0x17c]
push edi
call fcn.00513f20
push dword [ebp - 0x3c]
push str.___Type_Catalog_Pages__d_0_R____n
push ebx
call fcn.004025c0
mov ecx, dword [esi + 0x17c]
add esp, 0xc
push ebx
call fcn.00513f20
mov edi, dword [esi + 0x17c]
mov dword [ebp - 0x40], eax
xor eax, eax
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x24], eax
push dword [edi]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
add esp, 4
mov dword [ebp - 0x44], eax
push dword [edi]
push 7
push 1
push str.xref_n0
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push dword [edi + 0x10]
lea eax, [ebp - 0x38]
push 0x5dd794
push eax
call fcn.004025c0
lea ecx, [ebp - 0x38]
add esp, 0x1c
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x514444
push dword [edi]
sub ecx, edx
lea eax, [ebp - 0x38]
push ecx
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push dword [edi]
push 0x15
push 1
push str._n0000000000_65535_f__n
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov eax, dword [ebp - 0x3c]
add esp, 0x20
xor edi, edi
mov eax, dword [eax + 0x10]
dec eax
test eax, eax
jle 0x5144ca
mov ebx, dword [ebp - 0x3c]
mov eax, dword [ebx + 4]
push dword [eax + edi*4]
lea eax, [ebp - 0x24]
push str._010ld_00000_n__n
push eax
call fcn.004025c0
lea eax, [ebp - 0x24]
add esp, 0xc
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x5144a0
push dword [ebx]
sub eax, edx
push eax
lea eax, [ebp - 0x24]
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov eax, dword [ebx + 0x10]
inc edi
dec eax
add esp, 0x10
cmp edi, eax
jl 0x514480
lea ebx, [esi + 0x80]
push dword [ebp - 0x44]
mov eax, dword [esi + 0x17c]
push dword [ebp - 0x40]
push dword [eax + 0x10]
push str.trailer_n____Size__d__Root__d_0_R_n___nstartxref_n_ld_n____EOF_n
push ebx
call fcn.004025c0
mov ecx, ebx
add esp, 0x14
lea edx, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5144f0
mov eax, dword [esi + 0x17c]
sub ecx, edx
push dword [eax]
push ecx
push 1
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov ecx, dword [ebp - 4]
add esp, 0x10
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0059df64
mov esp, ebp
pop ebp
ret