Function at 0x403c30
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
mov eax, dword [esp + 0x74]
mov ebx, dword [esp + 0x70]
test eax, eax
je 0x403dd0
xor eax, eax
test ebx, ebx
je 0x403c52
cmp byte [ebx], 0
jne 0x403c60
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], 0x180
mov dword [esp + 4], 0x102
mov dword [esp], ebx
call sub.msvcrt.dll__open
cmp eax, 0xffffffff
mov edi, eax
je 0x403e00
mov dword [esp + 4], 1
mov dword [esp], eax
call sym.brltty.exe_acquireFileLock
test eax, eax
mov ebx, eax
je 0x403de0
lea ebp, [esp + 0x30]
mov dword [esp + 8], 0x20
mov dword [esp + 4], ebp
mov dword [esp], edi
call sub.msvcrt.dll__read
cmp eax, 0xffffffff
je 0x403ed0
cmp eax, 0x20
mov edx, 0x1f
cmove eax, edx
mov byte [esp + eax + 0x30], 0
lea eax, [esp + 0x2b]
mov dword [esp + 0xc], eax
lea eax, [esp + 0x2c]
mov dword [esp + 8], eax
mov dword [esp + 4], str._lu_c
mov dword [esp], ebp
call sub.msvcrt.dll_sscanf
cmp eax, 1
je 0x403e51
cmp eax, 2
je 0x403e40
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], edi
call sub.msvcrt.dll__lseek
cmp eax, 0xffffffff
je 0x403ee6
mov dword [esp + 4], 0
mov dword [esp], edi
call sub.msvcrt.dll__chsize
cmp eax, 0xffffffff
je 0x403ea8
mov eax, dword [esp + 0x74]
xor esi, esi
mov dword [esp + 8], str._lu_n
mov dword [esp + 4], 0x20
mov dword [esp], ebp
mov dword [esp + 0xc], eax
call fcn.0046e270
mov dword [esp + 4], ebp
mov dword [esp], edi
mov dword [esp + 8], eax
call sub.msvcrt.dll__write
cmp eax, 0xffffffff
jne 0x403d81
mov dword [esp], 0x476258
mov si, 3
call sym.brltty.exe_logSystemError
test ebx, ebx
jne 0x403ec0
mov dword [esp], edi
call sub.msvcrt.dll__close
cmp esi, 2
je 0x403e96
cmp esi, 3
je 0x403df6
test esi, esi
mov eax, 1
je 0x403c52
mov dword [esp + 8], esi
mov dword [esp + 4], str.unexpected_PID_file_state:__u
mov dword [esp], 4
call sym.brltty.exe_logMessage
xor eax, eax
jmp 0x403c52
call sym.brltty.exe_getProcessIdentifier
mov dword [esp + 0x74], eax
jmp 0x403c47
call sub.msvcrt.dll__errno
cmp dword [eax], 0x28
je 0x403c9d
mov dword [esp], edi
call sub.msvcrt.dll__close
xor eax, eax
jmp 0x403c52
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str.cannot_open_process_identifier_file
mov dword [esp + 4], 0x476294
mov dword [esp], 4
mov dword [esp + 0x10], eax
call sym.brltty.exe_logMessage
xor eax, eax
jmp 0x403c52
movzx eax, byte [esp + 0x2b]
cmp al, 0xd
je 0x403e51
cmp al, 0xa
jne 0x403d00
mov eax, dword [esp + 0x2c]
xor esi, esi
cmp eax, dword [esp + 0x74]
je 0x403d81
mov dword [esp], eax
call sym.brltty.exe_testProcessIdentifier
test eax, eax
je 0x403d00
mov eax, dword [esp + 0x2c]
mov si, 2
mov dword [esp + 4], str.instance_already_running:_PID_lu
mov dword [esp], 3
mov dword [esp + 8], eax
call sym.brltty.exe_logMessage
jmp 0x403d81
call sub.msvcrt.dll__errno
mov dword [eax], 0x11
xor eax, eax
jmp 0x403c52
mov dword [esp], str.ftruncate
mov esi, 3
call sym.brltty.exe_logSystemError
jmp 0x403d81
mov dword [esp], edi
call sym.brltty.exe_releaseFileLock
jmp 0x403d89
mov dword [esp], 0x47624e
mov esi, 3
call sym.brltty.exe_logSystemError
jmp 0x403d81
mov dword [esp], 0x476268
mov esi, 3
call sym.brltty.exe_logSystemError
jmp 0x403d81