Function at 0x401000
Capabilities:
Execute command
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x9c
nop
mov eax, 0
mov dword [ebp - 4], eax
mov eax, 0
mov dword [ebp - 0x88], eax
mov eax, 0
mov dword [ebp - 0x8c], eax
mov eax, str._npackdatahack.exe_is_a_win32_linux_replacement_of_Sonys_packdata.exe_n
push eax
call sub.msvcrt.dll_printf
add esp, 4
mov eax, str.Usage:_packdatahack.exe_projectName__no_extensions__n___projectName_is_the_name_use_to_find_.TMD_and_.TIM_n
push eax
call sub.msvcrt.dll_printf
add esp, 4
mov eax, dword [ebp + 8]
cmp eax, 2
jge 0x40105a
mov eax, 1
jmp 0x401415
mov eax, dword [ebp + 0xc]
add eax, 4
mov ecx, dword [eax]
push ecx
mov eax, str.Running:_packdatahack.exe__s_n_n
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, dword [ebp + 0xc]
add eax, 4
mov ecx, dword [eax]
push ecx
mov eax, str._s.tmd
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_sprintf
add esp, 0xc
mov eax, 0x4020d7
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_fopen
add esp, 8
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp eax, 0
je 0x4010b8
jmp 0x4010d7
lea eax, [ebp - 0x82]
push eax
mov eax, str.ERROR:_Could_not_find_input_file__s__nCheck_filename__n
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, 1
jmp 0x401415
mov eax, 2
push eax
mov eax, 0
push eax
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fseek
add esp, 0xc
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_ftell
add esp, 4
mov dword [ebp - 0x88], eax
mov eax, dword [ebp - 0x88]
push eax
mov eax, str.size_of_TMD:__d__n
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fclose
add esp, 4
mov eax, dword [ebp + 0xc]
add eax, 4
mov ecx, dword [eax]
push ecx
mov eax, str._s0.tim
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_sprintf
add esp, 0xc
lea eax, [ebp - 0x82]
push eax
mov eax, str.Checking_for_a_TIM_file:__s_n
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, 0x402149
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_fopen
add esp, 8
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp eax, 0
je 0x4011b8
lea eax, [ebp - 0x82]
push eax
mov eax, str.Tim_0_has_been_found___s_n
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, str.Reminder:_The_PlayStation_viewer_can_only_use_1_single_texture_TIM_file._n
push eax
call sub.msvcrt.dll_printf
add esp, 4
mov eax, 1
mov dword [ebp - 0x8c], eax
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fclose
add esp, 4
jmp 0x4011c6
mov eax, 0x4021b0
push eax
call sub.msvcrt.dll_printf
add esp, 4
mov eax, dword [ebp + 0xc]
add eax, 4
mov ecx, dword [eax]
push ecx
mov eax, str._s.tmp
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_sprintf
add esp, 0xc
mov eax, 0x402203
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_fopen
add esp, 8
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
push eax
mov eax, 1
push eax
mov eax, 4
push eax
lea eax, [ebp - 0x88]
push eax
call sub.msvcrt.dll_fwrite
add esp, 0x10
mov eax, dword [ebp - 4]
push eax
mov eax, 1
push eax
mov eax, 4
push eax
lea eax, [ebp - 0x8c]
push eax
call sub.msvcrt.dll_fwrite
add esp, 0x10
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fflush
add esp, 4
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fclose
add esp, 4
mov eax, dword [ebp - 0x8c]
cmp eax, 0
je 0x4012b7
mov eax, dword [ebp + 0xc]
add eax, 4
mov ecx, dword [ebp + 0xc]
add ecx, 4
mov edx, dword [ebp + 0xc]
add edx, 4
mov dword [ebp - 0x90], eax
mov eax, dword [ebp + 0xc]
add eax, 4
mov dword [ebp - 0x94], ecx
mov ecx, dword [eax]
push ecx
mov eax, dword [edx]
push eax
mov eax, dword [ebp - 0x94]
mov eax, dword [eax]
push eax
mov eax, dword [ebp - 0x90]
mov eax, dword [eax]
push eax
mov eax, str.C:MarbleCLAYPluginPSXcat.exe__s.tmp__s.tmd__s0.tim____s.pck
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_sprintf
add esp, 0x18
jmp 0x4012f3
mov eax, dword [ebp + 0xc]
add eax, 4
mov ecx, dword [ebp + 0xc]
add ecx, 4
mov edx, dword [ebp + 0xc]
add edx, 4
mov dword [ebp - 0x98], eax
mov eax, dword [edx]
push eax
mov eax, dword [ecx]
push eax
mov eax, dword [ebp - 0x98]
mov eax, dword [eax]
push eax
mov eax, str.C:MarbleCLAYPluginPSXcat.exe__s.tmp__s.tmd____s.pck
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_sprintf
add esp, 0x14
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_system
add esp, 4
mov eax, dword [ebp + 0xc]
add eax, 4
mov ecx, dword [eax]
push ecx
mov eax, str._s.pck
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_sprintf
add esp, 0xc
lea eax, [ebp - 0x82]
push eax
mov eax, str.Checking_if_pack_file_was_created_okay:__s_n
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, 0x4022b1
push eax
lea eax, [ebp - 0x82]
push eax
call sub.msvcrt.dll_fopen
add esp, 8
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp eax, 0
je 0x4013f9
lea eax, [ebp - 0x82]
push eax
mov eax, str.Pack_file_was_created_okay___s_n
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, 2
push eax
mov eax, 0
push eax
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fseek
add esp, 0xc
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_ftell
add esp, 4
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fclose
add esp, 4
mov eax, dword [ebp - 0x9c]
cmp eax, 0
jne 0x4013d7
lea eax, [ebp - 0x82]
push eax
mov eax, str.Pack_file__s_has_size_of_zero____n_ERROR___n
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, 1
jmp 0x401415
mov eax, dword [ebp - 0x9c]
mov ecx, 0x400
cdq
idiv ecx
push eax
mov eax, str.Pack_file_good__dKb_n
push eax
call sub.msvcrt.dll_printf
add esp, 8
jmp 0x401407
mov eax, str.The_TIM_file_was_not_found__this_is_fine_if_you_didnt_use_a_texture_file._n
push eax
call sub.msvcrt.dll_printf
add esp, 4
mov eax, str.packdatahack.exe_finished_correctly__n
push eax
call sub.msvcrt.dll_printf
add esp, 4
leave
ret