Function at 0x47215f
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
sub esp, 4
push 0xc
push 0
lea eax, [ebp - 0x28]
push eax
call sub.msvcrt.dll_memset
add esp, 0x10
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x24], eax
cmp dword [ebp + 0x10], 0
je 0x4721ac
sub esp, 8
lea eax, [ebp - 0x38]
push eax
push dword [ebp + 0x10]
call fcn.004216e3
add esp, 0x10
jmp 0x4721c4
cmp dword [ebp + 0x14], 0
je 0x4721c4
sub esp, 8
lea eax, [ebp - 0x38]
push eax
push dword [ebp + 0x14]
call fcn.004214a4
add esp, 0x10
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0xc]
jge 0x4723d2
mov edx, dword [ebp - 0xc]
mov eax, edx
add eax, eax
add eax, edx
lea edx, [eax*4]
mov eax, dword [ebp + 8]
cmp byte [edx + eax], 1
jne 0x4723af
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x28]
add eax, 8
push eax
mov edx, dword [ebp - 0xc]
mov eax, edx
add eax, eax
add eax, edx
shl eax, 2
add eax, dword [ebp + 8]
push eax
call fcn.00471fc0
add esp, 0xc
test eax, eax
je 0x4723af
mov edx, dword [ebp - 0xc]
mov eax, edx
add eax, eax
add eax, edx
lea ecx, [eax*4]
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x2c]
mov eax, dword [ecx + eax + 8]
sub eax, edx
mov dword [ebp - 0x48], eax
cmp dword [0x4fe0c0], 0
jne 0x472251
call fcn.004720fa
mov dword [0x4fe0c0], eax
mov eax, dword [0x4fe0c0]
cmp byte [eax], 0
jne 0x472279
sub esp, 0xc
push str.no_photo_viewer_set_n
call fcn.004a7e84
add esp, 4
push eax
call fcn.0049d7de
add esp, 0x10
jmp 0x4723b9
sub esp, 8
lea eax, [ebp - 0x28]
push eax
push dword [0x4fe0c0]
call fcn.0041e820
add esp, 0x10
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jne 0x47229c
jmp 0x4723b9
sub esp, 0xc
push 0
mov eax, 0
mov al, byte [ebp - 0x20]
push eax
call fcn.0047208e
add esp, 8
push eax
call sub.msvcrt.dll_strlen
add esp, 4
add eax, 0x12
push eax
call fcn.004a2e27
add esp, 0x10
mov dword [ebp - 0x40], eax
push 0
mov eax, 0
mov al, byte [ebp - 0x20]
push eax
call fcn.0047208e
add esp, 8
push eax
push dword [ebp - 0x34]
push str._08lX._s
push dword [ebp - 0x40]
call sub.msvcrt.dll_sprintf
add esp, 0x10
sub esp, 8
push 1
push 1
push dword [ebp - 0x40]
push dword [ebp - 0x3c]
push 0
lea eax, [ebp - 0x44]
push eax
call fcn.00472a52
add esp, 0x20
test eax, eax
je 0x472323
sub esp, 0xc
push dword [ebp - 0x40]
call fcn.004a2f78
add esp, 0x10
jmp 0x4723b9
sub esp, 0xc
push dword [ebp - 0x40]
call fcn.004a2f78
add esp, 0x10
mov eax, dword [ebp - 0x44]
push dword [eax + 0xc]
push 1
mov edx, dword [ebp - 0xc]
mov eax, edx
add eax, eax
add eax, edx
lea ecx, [eax*4]
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x48]
mov eax, dword [ecx + eax + 8]
sub eax, edx
push eax
mov edx, dword [ebp - 0xc]
mov eax, edx
add eax, eax
add eax, edx
lea ecx, [eax*4]
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x48]
add eax, dword [ecx + edx + 4]
push eax
call sub.msvcrt.dll_fwrite
add esp, 0x10
sub esp, 0xc
push dword [ebp - 0x44]
call fcn.00472c5f
add esp, 0x10
test eax, eax
je 0x47239b
sub esp, 0xc
push dword [ebp - 0x44]
call fcn.00472e3e
add esp, 0x10
jmp 0x4723b9
sub esp, 0xc
push dword [ebp - 0x44]
call fcn.00472e3e
add esp, 0x10
test eax, eax
je 0x4723af
jmp 0x4723b9
lea eax, [ebp - 0xc]
inc dword [eax]
jmp 0x4721cb
sub esp, 0xc
push str.unable_to_display_photo_ID__n
call fcn.004a7e84
add esp, 4
push eax
call fcn.0049d87b
add esp, 0x10
leave
ret