Function at 0x47a160
Capabilities:
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
push edi
mov edi, eax
push esi
push ebx
mov ebx, ecx
sub esp, 0x5c
cmp dword [esp + 0x70], 1
mov eax, dword [esp + 0x74]
mov dword [esp + 0x2c], edx
sbb esi, esi
mov dword [esp + 0x40], 0
mov dword [esp + 0x30], eax
and esi, 0x15
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
test ecx, ecx
jne 0x47a3a0
lea eax, [esp + 0x40]
mov dword [esp], 0
mov dword [esp + 8], eax
movzx eax, si
shl eax, 5
add eax, 0x258
mov dword [esp + 4], eax
call fcn.00427280
mov ecx, eax
mov eax, edx
mov ebp, edx
or eax, ecx
jne 0x47a6a0
mov eax, dword [esp + 0x40]
lea edx, [eax + 0x258]
test si, si
jne 0x47a1ea
movzx esi, word [esp + 0x30]
mov edx, dword [esp + 0x70]
mov ecx, dword [edi]
mov dword [eax + 0x238], edx
xor ebp, ebp
mov dword [eax + 0x240], edx
mov edx, dword [esp + 0x80]
mov dword [eax], ecx
mov ecx, dword [esp + 0x2c]
mov dword [eax + 0x254], edx
mov edx, dword [esp + 0x7c]
mov dword [eax + 4], ecx
mov word [eax + 0x23e], bp
mov dword [eax + 8], edi
mov dword [eax + 0xc], 1
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0
mov dword [eax + 0x18], 0
mov byte [eax + 0x21c], 0
mov byte [eax + 0x235], 0
mov word [eax + 0x23c], si
mov word [eax + 0x244], si
mov dword [eax + 0x24c], ebx
mov dword [eax + 0x250], 0
mov dword [eax + 0x248], edx
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
mov dword [esp], edi
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x48]
mov dword [esp + 0x48], 0x478060
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], edx
call fcn.00479170
mov ecx, eax
mov eax, edx
mov ebp, edx
or eax, ecx
je 0x47a302
mov eax, dword [esp + 0x7c]
test eax, eax
je 0x47a4c1
mov ebx, dword [esp + 0x40]
mov eax, dword [ebx + 0x238]
cmp dword [ebx + 0x240], eax
je 0x47a2de
add ebx, 0x238
mov dword [esp], eax
mov dword [esp + 4], ebx
mov dword [esp + 0x2c], ecx
call fcn.0041d440
mov ebx, dword [esp + 0x40]
mov ecx, dword [esp + 0x2c]
lea eax, [esp + 0x40]
mov dword [esp], ebx
mov dword [esp + 4], eax
mov dword [esp + 0x2c], ecx
call fcn.0041d440
mov ecx, dword [esp + 0x2c]
add esp, 0x5c
mov edx, ebp
pop ebx
pop esi
mov eax, ecx
pop edi
pop ebp
ret
mov ebx, dword [esp + 0x40]
mov eax, dword [ebx + 0x250]
test eax, eax
jne 0x47a330
mov eax, dword [edi + 0x1c]
mov edx, dword [edi + 0x18]
test eax, eax
js 0x47a330
mov edi, dword [ebx + 0x24c]
mov esi, edi
shl esi, 5
xor esi, edx
or eax, esi
je 0x47a770
nop
mov esi, dword [esp + 0x70]
mov eax, dword [ebx + 0x238]
test esi, esi
je 0x47a381
cmp dword [esp + 0x70], eax
je 0x47a381
mov edi, dword [esp + 0x30]
cmp word [ebx + 0x23e], di
mov dword [esp + 0x2c], ecx
mov esi, edi
cmovbe si, word [ebx + 0x23e]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x70]
movzx esi, si
shl esi, 5
mov dword [esp], eax
mov dword [esp + 8], esi
call sub.msvcrt.dll_memcpy
mov eax, dword [ebx + 0x238]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x78]
test edx, edx
je 0x47a2b8
movzx esi, word [ebx + 0x23e]
mov edi, dword [esp + 0x78]
mov word [edi], si
jmp 0x47a2b8
lea eax, [esp + 0x44]
mov dword [esp + 4], 0x2c0
mov dword [esp + 8], eax
mov dword [esp], 0
call fcn.00427280
mov ecx, eax
mov eax, edx
mov ebp, edx
or eax, ecx
jne 0x47a553
lea eax, [ebx - 1]
mov dword [esp + 8], 0x2c0
mov edx, eax
mov dword [esp + 0x34], eax
lea eax, [esp + 0x48]
mov dword [esp + 0x14], eax
mov eax, edx
xor edx, edx
shld edx, eax, 5
shl eax, 5
mov dword [esp], edi
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x44]
mov dword [esp + 0x10], edx
mov dword [esp + 4], eax
call fcn.00472a30
mov ecx, eax
mov eax, edx
mov ebp, edx
or eax, ecx
jne 0x47a715
mov eax, dword [esp + 0x48]
test eax, eax
je 0x47a4a0
cmp eax, 0x3f
jbe 0x47a4a0
mov ebx, 1
mov ebp, 7
mov word [esp + 0x3a], si
mov esi, ebx
mov ebx, ebp
jmp 0x47a460
test al, 2
je 0x47a450
test byte [ebp], 0x40
jne 0x47a495
lea esi, [esi]
mov eax, dword [esp + 0x48]
add esi, 1
mov ebx, ecx
shr eax, 5
cmp esi, eax
jae 0x47a495
mov ebp, esi
shl ebp, 5
add ebp, dword [esp + 0x44]
mov dword [esp], ebp
call fcn.004738d0
mov ecx, eax
cmp eax, 7
ja 0x47a450
mov eax, 1
shl eax, cl
test al, 0xe4
jne 0x47a495
test al, 0x18
je 0x47a440
cmp esi, 1
je 0x47a683
cmp ebx, 1
je 0x47a450
mov ebx, esi
movzx esi, word [esp + 0x3a]
add ebx, dword [esp + 0x34]
mov eax, dword [esp + 0x44]
test eax, eax
je 0x47a1a1
lea edx, [esp + 0x44]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0041d440
jmp 0x47a1a1
mov dword [esp + 4], edx
mov dword [esp], ecx
mov dword [esp + 0x2c], ecx
call fcn.0041d490
mov ebx, dword [fcn.004a1b90]
mov dword [esp], 2
mov esi, eax
call ebx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x10], esi
mov dword [esp + 8], 0x5496cd
mov dword [esp + 0xc], ecx
mov dword [esp + 4], str.__s__fat_dir_list_raw_exited_with_error:__lu___s_
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call ebx
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x5496ca
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call ebx
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov ebx, dword [esp + 0x40]
mov ecx, dword [esp + 0x2c]
mov eax, dword [ebx + 0x238]
jmp 0x47a2b8
mov dword [esp], ecx
mov dword [esp + 4], edx
mov dword [esp + 0x2c], ecx
call fcn.0041d490
mov dword [esp], 2
mov esi, dword [fcn.004a1b90]
mov edi, eax
call esi
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x10], edi
mov dword [esp + 8], 0x5496cd
mov dword [esp + 0xc], ecx
mov dword [esp + 4], str.__s__Error_while_allocating_temporary_buffer:__lu___s_
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call esi
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x5496ca
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call esi
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x2c]
test eax, eax
je 0x47a5f6
lea edi, [esp + 0x44]
mov dword [esp], eax
mov dword [esp + 4], edi
mov dword [esp + 0x2c], ecx
call fcn.0041d440
mov ecx, dword [esp + 0x2c]
mov dword [esp], ecx
mov dword [esp + 4], ebp
mov dword [esp + 0x2c], ecx
call fcn.0041d490
mov dword [esp], 2
mov edi, eax
call esi
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], ecx
mov dword [esp + 8], 0x5496cd
mov dword [esp + 4], str.__s__Failed_to_find_a_valid_index_for_target_index__lu:__lu___s_
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call esi
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x5496ca
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call esi
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov ecx, dword [esp + 0x2c]
add esp, 0x5c
mov edx, ebp
pop ebx
pop esi
mov eax, ecx
pop edi
pop ebp
ret
sub ebp, 0x20
mov dword [esp + 0x3c], ecx
mov dword [esp], ebp
call fcn.004738d0
mov ecx, dword [esp + 0x3c]
mov ebx, eax
jmp 0x47a490
mov dword [esp + 0x2c], ecx
mov ebx, dword [fcn.004a1b90]
mov dword [esp], 2
call ebx
mov dword [esp + 8], 0x5496cd
mov dword [esp + 4], str.__s__Failed_to_allocate_space_for_temporary_filename.
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call ebx
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x5496ca
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call ebx
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov ecx, dword [esp + 0x2c]
add esp, 0x5c
mov edx, ebp
pop ebx
pop esi
mov eax, ecx
pop edi
pop ebp
ret
mov dword [esp], ecx
mov dword [esp + 4], edx
mov dword [esp + 0x2c], ecx
call fcn.0041d490
mov dword [esp], 2
mov esi, dword [fcn.004a1b90]
mov edi, eax
call esi
mov dword [esp + 0x18], edi
mov ecx, dword [esp + 0x2c]
mov edi, dword [esp + 0x34]
mov dword [esp + 0xc], 0x2c0
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], edi
mov dword [esp + 8], 0x5496cd
mov dword [esp + 4], str.__s__Error_while_reading__Iu_bytes_at_dirent_index__lu:__lu___s_
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x47a598
mov dword [ebx + 0x250], 1
add edi, 1
mov dword [ebx + 0x24c], edi
jmp 0x47a330