Function at 0x510a3a
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x284
mov eax, dword [0x5f2e68]
xor eax, esp
mov dword [esp + 0x280], eax
push ebx
push esi
push edi
xor ebx, ebx
push 0x103
lea eax, [esp + 0x185]
push ebx
push eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x20], ebx
mov byte [esp + 0x18c], bl
call fcn.005306b0
add esp, 0xc
push 0x148
lea eax, [esp + 0x38]
push ebx
push eax
mov dword [esp + 0x3c], ebx
call fcn.005306b0
mov word [esp + 0x28], bx
xor eax, eax
lea edi, [esp + 0x2a]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
add esp, 0xc
stosw word es:[edi], ax
push str.FTPCRF.fat
lea edi, [esp + 0x184]
call fcn.00470e3d
mov dword [esp], 0x1a18
mov esi, str..UpdatePAULA.c
lea eax, [esp + 0x20]
push esi
push eax
call fcn.004fb92f
add esp, 0xc
push 0x1a1a
push esi
push 4
pop edi
push edi
call fcn.00471db5
add esp, 0xc
push 0x1a1d
push esi
push edi
call fcn.00474c00
add esp, 0xc
test eax, eax
jne 0x510b1b
push edi
call fcn.00475a9e
mov dword [esp], 0x1a20
push esi
push edi
call fcn.00474c00
add esp, 0xc
test eax, eax
jne 0x510b1b
push str.:4:SetLastFTPConnectTime___could_not_logon_to_TAMS:_LockTAMSServer_LTS_FTPRESULTS__FAILED_
call fcn.0042bd38
pop ecx
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], ebx
mov eax, dword [esp + 0x10]
sub eax, ebx
je 0x510b54
dec eax
jne 0x511058
cmp dword [ebp + 8], 3
je 0x511043
push str.FTPCRF.fat
lea edi, [esp + 0x184]
call fcn.00470e3d
pop ecx
jmp 0x510b78
push str.FTPCRF.fat
push ebx
push ebx
call fcn.00493154
pop ecx
pop ecx
push eax
lea eax, [esp + 0x188]
push 0x553c34
push eax
call fcn.00531b2f
add esp, 0x10
mov edi, 0x14c
push edi
lea eax, [esp + 0x34]
push ebx
push eax
call fcn.005306b0
add esp, 0xc
push ebx
push 0x61a8
push 4
push 1
lea eax, [esp + 0x190]
push 7
push eax
mov eax, SQLGetDiagRec
call fcn.0042eb42
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0x18
mov dword [esp + 0xc], eax
call esi
cmp dword [esp + 0xc], 0xffffffff
jne 0x510be0
push eax
push str._GetLastError_
lea eax, [esp + 0x188]
push eax
push str.:5:SetLastFTPConnectTime___FAILED:_CreateFile___s___FAILED:__s_ld
call fcn.0042bd38
add esp, 0x10
jmp 0x51103f
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
push ebx
lea eax, [esp + 0x1c]
push eax
push edi
lea eax, [esp + 0x3c]
push eax
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x510c35
cmp dword [esp + 0x18], edi
jb 0x510c35
lea eax, [esp + 0x30]
call fcn.005119ff
test eax, eax
je 0x510c70
lea eax, [esp + 0x30]
call fcn.005119ff
push eax
lea eax, [esp + 0x184]
push eax
push str.:7:SetLastFTPConnectTime___read_data_from___s__and_it_seems_to_be_corrupt:_IsFtpConnectTimeInvalid___returned__ld
call fcn.0042bd38
add esp, 0xc
jmp 0x510c61
cmp dword [ebp + 8], 9
je 0x510c70
call esi
cmp eax, ebx
je 0x510c61
push eax
push str._GetLastError_
push edi
push dword [esp + 0x24]
lea eax, [esp + 0x190]
push eax
push str.:9:SetLastFTPConnectTime___encountered_a_problem:_ReadFile___s___FAILED__dwBytesRead___ld_of__ld:__s_ld
call fcn.0042b70b
add esp, 0x18
push edi
lea eax, [esp + 0x34]
push ebx
push eax
call fcn.005306b0
add esp, 0xc
mov ecx, dword [ebp + 8]
lea eax, [ecx - 1]
cmp eax, 8
ja case.default.0x510c7f
jmp dword [eax*4 + 0x51108a]
mov dword [esp + 0x30], 1
lea esi, [esp + 0x1c]
lea edi, [esp + 0x34]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
inc dword [esp + 0x54]
push 0x18
lea eax, [esp + 0x124]
mov dword [esp + 0x5c], ebx
call fcn.0046b1e5
mov eax, dword [0x70ff24]
mov dword [esp + 0x60], 1
lea esi, [esp + 0x20]
lea edi, [esp + 0x64]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
inc dword [esp + 0x84]
cmp eax, ebx
pop ecx
mov dword [esp + 0x84], ebx
mov dword [esp + 0xd8], ebx
mov dword [esp + 0xb8], ebx
je 0x510cf1
mov dword [esp + 0x13c], eax
mov eax, dword [0x70ff28]
cmp eax, ebx
je 0x510d01
mov dword [esp + 0x140], eax
lea eax, [esp + 0x144]
call fcn.0050b1cf
sub esp, 0x10
mov edx, 0x70ff54
mov esi, edx
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004f98b7
add esp, 0x10
test eax, eax
jne case.0x510c7f.9
mov esi, edx
lea edi, [esp + 0x16a]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
jmp case.0x510c7f.9
mov dword [esp + 0xd8], 1
lea edi, [esp + 0xdc]
push 0x18
lea eax, [esp + 0xf0]
lea esi, [esp + 0x20]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.0046b1e5
jmp 0x510e3b
lea esi, [esp + 0x1c]
lea edi, [esp + 0x88]
jmp 0x510d36
mov dword [esp + 0x30], ebx
lea esi, [esp + 0x1c]
lea edi, [esp + 0x44]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
inc dword [esp + 0x58]
mov dword [esp + 0x54], ebx
mov dword [esp + 0x5c], ebx
lea esi, [esp + 0x1c]
lea edi, [esp + 0x70]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
inc dword [esp + 0x84]
mov dword [esp + 0x80], ebx
mov dword [esp + 0xd8], ebx
mov dword [esp + 0xb8], ebx
jmp case.0x510c7f.9
lea esi, [esp + 0x1c]
lea edi, [esp + 0x10c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
push ebx
push ebx
movsd dword es:[edi], dword [esi]
call fcn.0046b280
pop ecx
pop ecx
mov ecx, eax
call fcn.004707d3
mov dword [esp + 0x11c], eax
jmp case.0x510c7f.9
mov dword [esp + 0xb8], 1
lea edi, [esp + 0x98]
push 0x19
lea eax, [esp + 0xc0]
jmp 0x510d5a
mov dword [esp + 0xb8], ebx
jmp 0x510df2
mov dword [esp + 0xb8], ebx
lea esi, [esp + 0x1c]
lea edi, [esp + 0x98]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea edi, [esp + 0xa8]
jmp 0x510df9
push ecx
push str.SetLastFTPConnectTime___FAILED:_iActionCode_was_set_to_an_invalid_value__ld
call fcn.0042b70b
pop ecx
pop ecx
call fcn.0046b2ee
mov ecx, eax
call fcn.004707d3
mov edi, dword [esp + 0xc]
push ebx
push ebx
push ebx
push edi
mov dword [esp + 0x118], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x510e8b
inc dword [0x7100b4]
cmp dword [0x7100b4], 0xa
jae 0x510e8b
push str._GetLastError_
lea eax, [esp + 0x184]
push eax
push str.SetLastFTPConnectTime___FAILED:_SetFilePointer___s___FAILED:__s
call fcn.0042b70b
add esp, 0xc
push ebx
lea eax, [esp + 0x18]
push eax
push 0x14c
lea eax, [esp + 0x3c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0xc], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x2c], eax
call fcn.00435716
cmp dword [esp + 0xc], ebx
je 0x51100c
cmp dword [esp + 0x14], 0x14c
jb 0x51100c
cmp dword [esp + 0x2c], ebx
je 0x511043
push dword [esp + 0x84]
lea esi, [esp + 0x74]
push dword [esp + 0x84]
push 1
sub esp, 0x10
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004fa0a6
add esp, 0x14
push eax
push 1
sub esp, 0x10
lea esi, [esp + 0x80]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004fa0a6
add esp, 0x14
push eax
push dword [esp + 0x6c]
lea esi, [esp + 0x58]
push dword [esp + 0x6c]
push dword [esp + 0x6c]
push 1
sub esp, 0x10
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004fa0a6
add esp, 0x14
push eax
push 1
sub esp, 0x10
lea esi, [esp + 0x68]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004fa0a6
add esp, 0x14
push eax
push dword [esp + 0x54]
push dword [ebp + 8]
push str.:2:SetLastFTPConnectTime___LOG:_Action_d:_Global:_bGS___d__GLST___s__GLFT___s__GLNCS___d__GLNCF___d____Local:_bLS___d__LLST___s__LLFT___s__LLNCS___d__LLNCF___d
call fcn.0042bd38
add esp, 0x30
lea eax, [esp + 0x180]
push eax
push dword [esp + 0x30]
mov esi, 0x2710
push esi
xor edx, edx
mov ecx, eax
call fcn.004328fa
pop ecx
push eax
push str.:2:FYI:_filesize___d__dwLastError___d:__s
call fcn.0042bd38
push 0x1ae2
push str..UpdatePAULA.c
mov edx, 0x54f4b4
lea ecx, [esp + 0x198]
call fcn.00434df1
mov edi, eax
add esp, 0x18
cmp edi, ebx
je 0x510ff6
push edi
push 0x14c
lea eax, [esp + 0x38]
push 1
push eax
call fcn.00531aad
mov ecx, edi
mov dword [esp + 0x24], eax
call fcn.00435239
push esi
xor edx, edx
lea ecx, [esp + 0x194]
call fcn.004328fa
add esp, 0x14
push eax
push dword [esp + 0x18]
push str.:2:FYI:_dwBytesWritten___d__filesize___d
call fcn.0042bd38
add esp, 0xc
jmp 0x511043
lea eax, [esp + 0x180]
push eax
push str.:2:FYI:_FAILED_TO_OPEN:__s
call fcn.0042bd38
pop ecx
pop ecx
jmp 0x511043
mov eax, dword [0x7100b4]
inc dword [0x7100b4]
cmp eax, 5
jae 0x51103f
push str._GetLastError_
push dword [esp + 0x18]
lea eax, [esp + 0x188]
push 0x14c
push eax
push str.:7:SetLastFTPConnectTime___FAILED:_WriteFile___s____ld_____ld_FAILED:__s
call fcn.0042b70b
add esp, 0x14
mov dword [esp + 0xc], ebx
inc dword [esp + 0x10]
cmp dword [esp + 0x10], 2
jl 0x510b27
mov ebx, dword [esp + 0xc]
jmp 0x511068
push dword [esp + 0x10]
push str.:9:SetLastFTPConnectTime___CRITICAL_ERROR:_An_impossible_phase_has_been_run____Phase__ld__
call fcn.0042b70b
pop ecx
pop ecx
push 4
call fcn.00475a9e
pop ecx
mov ecx, dword [esp + 0x28c]
pop edi
pop esi
mov eax, ebx
pop ebx
xor ecx, esp
call fcn.005317e7
mov esp, ebp
pop ebp
ret