Function at 0x4122b0
Capabilities:
Delete file
Move file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xbc
mov dword [ebp - 0x94], ecx
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x70], 0
mov dword [esp + 4], 0x2a
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strchr
test eax, eax
je 0x4128fa
lea eax, [ebp - 0x60]
lea edi, [ebp - 0x40]
mov dword [ebp - 0xa8], eax
lea eax, [ebp - 0x58]
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0x60], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x48], edi
mov word [ebp - 0x40], 0x6170
mov byte [ebp - 0x3e], 0x6b
mov dword [ebp - 0x44], 3
mov byte [ebp - 0x3d], 0
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov dword [ebp - 0x30], eax
cmp eax, 0xf
ja 0x41291a
cmp eax, 1
jne 0x41275f
mov edx, dword [ebp + 8]
mov cl, byte [edx]
mov byte [ebp - 0x58], cl
lea ecx, [ebp - 0x30]
mov edx, dword [ebp - 0xa4]
mov dword [ebp - 0xa0], ecx
lea ebx, [ebp - 0x48]
mov dword [ebp - 0x5c], eax
mov byte [edx + eax], 0
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0xa8]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xa0]
mov dword [esp], eax
call fcn.0041fe00
mov eax, dword [ebp - 0x30]
mov dword [ebp + 8], eax
lea eax, [ebp - 0x28]
cmp dword [ebp + 8], eax
je 0x4123a2
mov eax, dword [ebp - 0x28]
inc eax
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00480000
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0xa4]
cmp edx, eax
je 0x4123bf
mov eax, dword [ebp - 0x58]
mov dword [esp], edx
inc eax
mov dword [esp + 4], eax
call fcn.00480000
mov edx, dword [ebp - 0x48]
cmp edx, edi
je 0x4123d6
mov eax, dword [ebp - 0x40]
mov dword [esp], edx
inc eax
mov dword [esp + 4], eax
call fcn.00480000
mov dword [esp + 4], 0x488888
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
je 0x412962
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_remove
test eax, eax
je 0x412425
mov dword [esp + 8], str.Could_not_delete__s
mov dword [esp + 4], str.Merge
mov eax, dword [0x4b61c0]
mov dword [esp], eax
call fcn.00425600
lea eax, [ebp - 0x60]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0xa8], eax
lea eax, [ebp - 0x58]
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0x60], eax
test ebx, ebx
je 0x412986
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov dword [ebp - 0x30], eax
cmp eax, 0xf
ja 0x4128b8
cmp eax, 1
jne 0x4128a5
mov edx, dword [ebp + 8]
mov cl, byte [edx]
mov byte [ebp - 0x58], cl
mov edx, dword [ebp - 0xa4]
mov dword [ebp - 0x5c], eax
mov byte [edx + eax], 0
mov edx, dword [ebp - 0x5c]
mov eax, 0x3fffffff
sub eax, edx
cmp eax, 3
jbe 0x412992
mov dword [esp + 4], 4
mov dword [esp], str..tmp
lea eax, [ebp - 0x78]
mov ecx, dword [ebp - 0xa8]
mov dword [ebp - 0x9c], eax
call fcn.0047e1c0
push edi
push edi
mov dword [esp + 4], 0x488888
mov eax, dword [ebp - 0x60]
mov dword [esp], eax
lea eax, [ebp - 0x78]
mov dword [ebp - 0x9c], eax
call sub.msvcrt.dll_fopen
mov dword [ebp - 0x98], eax
mov esi, eax
mov eax, dword [ebp - 0x60]
mov dword [esp], str.writing_to_temporary_file__s_n
mov dword [esp + 4], eax
lea eax, [ebp - 0x78]
mov dword [ebp - 0x9c], eax
call fcn.004719d0
mov dword [esp + 4], str.Simutrans_object_file_nCompiled_with_SimObjects_0.1.3exp_n
mov dword [esp], esi
call fcn.00471a00
lea eax, [ebp - 0x30]
mov dword [ebp - 0x30], 0x3eb
mov dword [esp + 0xc], esi
mov dword [esp + 8], 4
mov dword [esp + 4], 1
mov dword [ebp - 0xa0], eax
mov dword [esp], eax
lea eax, [ebp - 0x78]
mov dword [ebp - 0x9c], eax
call sub.msvcrt.dll_fwrite
lea eax, [ebp - 0x78]
mov dword [esp], esi
mov dword [ebp - 0x9c], eax
call sub.msvcrt.dll_ftell
mov dword [0x4b6064], eax
lea eax, [ebp - 0x78]
mov dword [esp], esi
mov dword [ebp - 0x9c], eax
call sub.msvcrt.dll_ftell
mov dword [ebp - 0xac], eax
lea eax, [ebp - 0x6c]
mov word [ebp - 0x68], 0
mov dword [ebp - 0x64], 0
mov dword [ebp - 0x6c], 0x544f4f52
mov dword [esp + 4], eax
mov dword [esp], esi
lea eax, [ebp - 0x78]
mov dword [ebp - 0x9c], eax
mov ecx, dword [ebp - 0x94]
call fcn.00410430
push ebx
lea eax, [ebp - 0x78]
push ebx
mov dword [ebp - 0x8c], 0
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x9c], eax
test esi, esi
jg 0x41260a
jmp 0x412808
lea eax, [ebp - 0x6c]
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x98]
mov dword [esp], eax
mov ecx, dword [ebp - 0x94]
call fcn.004120f0
sub esp, 0xc
mov esi, eax
mov eax, esi
test al, al
je 0x412780
mov eax, dword [ebp - 0x8c]
inc eax
mov dword [ebp - 0x8c], eax
mov eax, dword [ebp - 0x8c]
cmp dword [ebp + 0xc], eax
je 0x412808
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x8c]
mov ebx, dword [eax + ecx*4]
mov dword [esp + 4], 0x2a
mov dword [esp], ebx
call sub.msvcrt.dll_strchr
test eax, eax
je 0x4125c0
lea eax, [ebp - 0x28]
lea edi, [ebp - 0x40]
mov dword [ebp - 0x30], eax
mov word [ebp - 0x28], 0x6170
mov byte [ebp - 0x26], 0x6b
mov dword [ebp - 0x2c], 3
mov byte [ebp - 0x25], 0
mov dword [ebp - 0x48], edi
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
mov esi, eax
mov dword [ebp - 0x7c], eax
cmp eax, 0xf
ja 0x4127c8
cmp eax, 1
jne 0x4127b8
mov cl, byte [ebx]
mov byte [ebp - 0x40], cl
mov edx, edi
mov dword [ebp - 0x44], eax
mov byte [edx + eax], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov eax, dword [ebp - 0xa0]
mov dword [esp + 4], eax
lea eax, [ebp - 0x48]
mov dword [esp], eax
mov ecx, dword [ebp - 0x9c]
call fcn.0041fd80
mov edx, dword [ebp - 0x48]
sub esp, 0x10
cmp edx, edi
je 0x4126bd
mov eax, dword [ebp - 0x40]
mov dword [esp], edx
inc eax
mov dword [esp + 4], eax
call fcn.00480000
mov edx, dword [ebp - 0x30]
lea eax, [ebp - 0x28]
cmp edx, eax
je 0x4126d7
mov eax, dword [ebp - 0x28]
mov dword [esp], edx
inc eax
mov dword [esp + 4], eax
call fcn.00480000
mov ebx, dword [ebp - 0x78]
mov eax, dword [ebp - 0x70]
xor esi, esi
lea eax, [ebx + eax*4]
mov dword [ebp - 0x90], eax
cmp ebx, eax
jne 0x41272b
jmp 0x412780
lea eax, [ebp - 0x6c]
mov dword [esp + 8], edi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x98]
mov dword [esp], eax
mov ecx, dword [ebp - 0x94]
call fcn.004120f0
sub esp, 0xc
or esi, eax
add ebx, 4
cmp dword [ebp - 0x90], ebx
je 0x4125e4
mov eax, dword [ebp + 8]
mov edi, dword [ebx]
mov dword [esp], edi
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4126f8
mov dword [esp + 8], str.Skipping_reading_from_output_file
mov dword [esp + 4], str.Merge
mov eax, dword [0x4b61c0]
mov dword [esp], eax
call fcn.00425600
jmp 0x41271c
test eax, eax
je 0x41234c
lea edx, [ebp - 0x30]
mov eax, dword [ebp - 0xa4]
mov dword [ebp - 0xa0], edx
jmp 0x412944
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp - 0x8c]
mov eax, dword [eax + edx*4]
mov dword [esp + 8], str.file_or_dir__s_not_found_n
mov dword [esp + 0xc], eax
mov dword [esp + 4], str.Merge
mov eax, dword [0x4b61c0]
mov dword [esp], eax
call fcn.00425600
jmp 0x4125ee
test eax, eax
je 0x41266f
mov eax, edi
jmp 0x4127e9
lea eax, [ebp - 0x7c]
mov dword [esp + 4], 0
mov dword [esp], eax
lea ecx, [ebp - 0x48]
call fcn.0047e350
push edx
push edx
mov dword [ebp - 0x48], eax
mov edx, dword [ebp - 0x7c]
mov dword [ebp - 0x40], edx
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x7c]
mov edx, dword [ebp - 0x48]
jmp 0x412671
mov dword [esp + 8], 0
mov eax, dword [ebp - 0xac]
mov dword [esp + 4], eax
mov esi, dword [ebp - 0x98]
mov dword [esp], esi
call sub.msvcrt.dll_fseek
lea eax, [ebp - 0x6c]
mov dword [esp + 4], eax
mov dword [esp], esi
mov ecx, dword [ebp - 0x94]
call fcn.00410430
push ecx
push ecx
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov eax, dword [ebp + 8]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x60]
mov dword [esp], str.renaming_temporary_file__s_to__s_n
mov dword [esp + 4], eax
call fcn.004719d0
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x60]
mov dword [esp], eax
call sub.msvcrt.dll_rename
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0xa4]
cmp edx, eax
je 0x412890
mov eax, dword [ebp - 0x58]
mov dword [esp], edx
inc eax
mov dword [esp + 4], eax
call fcn.00480000
mov ecx, dword [ebp - 0x9c]
call fcn.004201a0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
test eax, eax
je 0x41246f
mov eax, dword [ebp - 0xa4]
jmp 0x4128dc
lea eax, [ebp - 0x30]
mov dword [esp + 4], 0
mov dword [esp], eax
mov ecx, dword [ebp - 0xa8]
call fcn.0047e350
push ecx
push ecx
mov dword [ebp - 0x60], eax
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x58], edx
mov dword [esp + 8], ebx
mov edx, dword [ebp + 8]
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x30]
mov edx, dword [ebp - 0x60]
jmp 0x412475
mov dword [esp + 4], 0x488888
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
jne 0x4123f1
jmp 0x4122f2
lea eax, [ebp - 0x30]
mov dword [esp + 4], 0
mov dword [ebp - 0xa0], eax
mov dword [esp], eax
mov ecx, dword [ebp - 0xa8]
call fcn.0047e350
push esi
push esi
mov dword [ebp - 0x60], eax
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x58], edx
mov dword [esp + 8], ebx
mov edx, dword [ebp + 8]
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x30]
mov edx, dword [ebp - 0x60]
jmp 0x41235b
mov eax, dword [ebp + 8]
mov dword [esp + 8], str.Cannot_open_destination_file__s
mov dword [esp + 0xc], eax
mov dword [esp + 4], str.Merge
mov eax, dword [0x4b61c0]
mov dword [esp], eax
call fcn.00425880
mov dword [esp], 0x488834
call fcn.004831f4
lea eax, [ebp - 0x78]
mov dword [esp], 0x4888ec
mov dword [ebp - 0x9c], eax
call fcn.004832e4
mov ebx, eax
lea eax, [ebp - 0x78]
mov dword [ebp - 0x9c], eax
jmp 0x48163a
mov ecx, dword [ebp - 0x9c]
call fcn.004201a0
mov dword [esp], ebx
call fcn.00462b50
mov ecx, dword [ebp - 0xa8]
call fcn.0047bd60
mov ecx, ebx
mov ebx, esi
call fcn.0047bd60
lea eax, [ebp - 0x78]
mov dword [ebp - 0x9c], eax
jmp 0x48163a