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

Disassembly:
push ebp
mov ebp, esp
push str.f:_sourcelcc_startepa_sendfile.c
push 0x2350000
push str.PicoFirmwareUpload
mov dword [0x44100c], ebp
sub esp, 0xa0
mov ecx, 0x28
dec ecx
mov dword [esp + ecx*4], 0xfffa5a5a
jne 0x40a9cc
push ebx
push esi
push edi
mov byte [ebp - 8], 1
mov byte [ebp - 8], 6
cmp dword [0x430be8], 0
jne 0x40a9f7
cmp dword [0x430be4], 0
je 0x40ae0f
mov byte [ebp - 8], 7
push 0x4550e0
push dword [ebp + 8]
call sub.CRTDLL.DLL_fopen
add esp, 8
mov dword [0x44100c], ebp
mov dword [ebp - 0x20], eax
cmp eax, 0
je 0x40ae0b
inc dword [ebp - 8]
push 2
push 0
push dword [ebp - 0x20]
call sub.CRTDLL.DLL_fseek
add esp, 0xc
mov dword [0x44100c], ebp
inc dword [ebp - 8]
push dword [ebp - 0x20]
call sub.CRTDLL.DLL_ftell
add esp, 4
mov dword [0x44100c], ebp
mov dword [ebp - 0x24], eax
inc dword [ebp - 8]
push dword [ebp - 0x20]
call sub.CRTDLL.DLL_rewind
add esp, 4
mov dword [0x44100c], ebp
inc dword [ebp - 8]
push dword [ebp - 0x24]
push 0
call sub.KERNEL32.dll_GlobalAlloc
mov dword [0x44100c], ebp
mov dword [ebp - 0x28], eax
cmp eax, 0
je 0x40ae07
inc dword [ebp - 8]
push dword [ebp - 0x20]
push 1
push dword [ebp - 0x24]
push dword [ebp - 0x28]
call sub.CRTDLL.DLL_fread
add esp, 0x10
mov dword [0x44100c], ebp
inc dword [ebp - 8]
push dword [ebp - 0x20]
call sub.CRTDLL.DLL_fclose
add esp, 4
mov dword [0x44100c], ebp
inc dword [ebp - 8]
cmp dword [0x434434], 0
je 0x40aad1
inc dword [ebp - 8]
push 8
push dword [0x434434]
call sub.USER32.DLL_ShowWindow
mov dword [0x44100c], ebp
mov byte [ebp - 8], 0x10
cmp dword [0x430088], 0
je 0x40aafe
inc dword [ebp - 8]
push 0x2000000
push 0
push 0x401
push dword [0x430088]
call sub.USER32.DLL_SendMessageA
mov dword [0x44100c], ebp
mov byte [ebp - 8], 0x12
cmp dword [0x430be4], 0
jne 0x40ab98
inc dword [ebp - 8]
push str.Set_Picoboard_in_Programming_mode_r_n
call fcn.004090ac
add esp, 4
mov dword [0x44100c], ebp
inc dword [ebp - 8]
call fcn.00407ce1
mov dword [0x44100c], ebp
inc dword [ebp - 8]
push 0x4b0
push dword [0x430be8]
call fcn.00407a0b
add esp, 8
mov dword [0x44100c], ebp
inc dword [ebp - 8]
call fcn.00407ce1
mov dword [0x44100c], ebp
inc dword [ebp - 8]
mov dword [ebp - 0x10], 1
mov byte [ebp - 8], 0x19
push 0xc8
call sub.KERNEL32.dll_Sleep
mov dword [0x44100c], ebp
mov byte [ebp - 8], 0x1a
cmp dword [0x430be4], 0
jne 0x40ab98
mov edi, dword [ebp - 0x10]
mov esi, edi
add esi, 1
mov dword [ebp - 0x10], esi
cmp edi, 0x14
jl 0x40ab67
mov byte [ebp - 8], 0x1d
cmp dword [0x430be4], 0
je 0x40ade8
inc dword [ebp - 8]
push 0x5c
push dword [ebp + 8]
call sub.CRTDLL.DLL_strrchr
add esp, 8
mov dword [0x44100c], ebp
mov dword [ebp - 0x1c], eax
cmp eax, 0
je 0x40abd0
inc dword [ebp - 8]
add dword [ebp - 0x1c], 1
jmp 0x40abda
mov byte [ebp - 8], 0x21
mov edi, dword [ebp + 8]
mov dword [ebp - 0x1c], edi
mov byte [ebp - 8], 0x23
push dword [ebp - 0x1c]
push dword [0x430be4]
push str._c:_s
lea edi, [ebp - 0xac]
push edi
call fcn.0042ba29
add esp, 0x10
mov dword [0x44100c], ebp
inc dword [ebp - 8]
push 0x4550b2
lea edi, [ebp - 0xac]
push edi
call sub.CRTDLL.DLL_fopen
add esp, 8
mov dword [0x44100c], ebp
mov dword [ebp - 0x20], eax
cmp eax, 0
je 0x40adda
inc dword [ebp - 8]
push dword [0x430be4]
push dword [ebp - 0x24]
push dword [ebp - 0x1c]
push str.Copy_Firmware__s___d_Bytes________Picoboard__c:_r_n
call fcn.004090ac
add esp, 0x10
mov dword [0x44100c], ebp
inc dword [ebp - 8]
mov eax, dword [ebp - 0x24]
mov ecx, 0x200
cdq
idiv ecx
mov dword [ebp - 0x2c], eax
inc dword [ebp - 8]
mov edi, dword [ebp - 0x24]
mov dword [ebp - 0x14], edi
inc dword [ebp - 8]
mov dword [ebp - 0x10], 0
inc dword [ebp - 8]
mov edi, dword [ebp - 0x28]
mov dword [ebp - 0x1c], edi
jmp 0x40ad0f
mov byte [ebp - 8], 0x2b
mov edi, dword [ebp - 0x2c]
cmp dword [ebp - 0x14], edi
jle 0x40ac91
mov ebx, 0x200
jmp 0x40ac94
mov ebx, dword [ebp - 0x14]
mov dword [ebp - 0x18], ebx
mov byte [ebp - 8], 0x2c
push dword [ebp - 0x20]
push dword [ebp - 0x18]
push 1
push dword [ebp - 0x1c]
call sub.CRTDLL.DLL_fwrite
add esp, 0x10
mov dword [0x44100c], ebp
push dword [ebp - 0x20]
call sub.CRTDLL.DLL_fflush
add esp, 4
mov dword [0x44100c], ebp
inc dword [ebp - 8]
mov edi, dword [ebp - 0x18]
sub dword [ebp - 0x14], edi
inc dword [ebp - 8]
mov edi, dword [ebp - 0x18]
add edi, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], edi
inc dword [ebp - 8]
cmp dword [0x430088], 0
je 0x40ad0b
inc dword [ebp - 8]
push 0
mov edi, dword [ebp - 0x10]
add edi, 1
mov dword [ebp - 0x10], edi
push edi
push 0x402
push dword [0x430088]
call sub.USER32.DLL_SendMessageA
mov dword [0x44100c], ebp
mov byte [ebp - 8], 0x31
mov byte [ebp - 8], 0x2a
cmp dword [ebp - 0x14], 0
jg 0x40ac7e
mov byte [ebp - 8], 0x32
push str.Programming..._please_wait_r_n
call fcn.004090ac
add esp, 4
mov dword [0x44100c], ebp
inc dword [ebp - 8]
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x18], 0
inc dword [ebp - 8]
mov eax, dword [ebp - 0x24]
mov ecx, 0x4268
cdq
idiv ecx
mov dword [ebp - 0x14], eax
jmp 0x40ad9b
mov byte [ebp - 8], 0x36
push 0
push dword [ebp - 0x10]
push 0x402
push dword [0x430088]
call sub.USER32.DLL_SendMessageA
mov dword [0x44100c], ebp
inc dword [ebp - 8]
mov edi, dword [ebp - 0x18]
mov eax, edi
shl eax, 9
mov ecx, dword [ebp - 0x14]
cdq
idiv ecx
mov dword [ebp - 0x10], eax
inc dword [ebp - 8]
push 0x64
call sub.KERNEL32.dll_Sleep
mov dword [0x44100c], ebp
mov byte [ebp - 8], 0x35
mov edi, dword [ebp - 0x18]
mov esi, edi
add esi, 1
mov dword [ebp - 0x18], esi
cmp edi, dword [ebp - 0x14]
jl 0x40ad58
mov byte [ebp - 8], 0x3a
push str.Picoboard_Reset...
call fcn.004090ac
add esp, 4
mov dword [0x44100c], ebp
inc dword [ebp - 8]
push dword [ebp - 0x20]
call sub.CRTDLL.DLL_fclose
add esp, 4
mov dword [0x44100c], ebp
mov byte [ebp - 8], 0x3d
mov dword [0x430be4], 0
mov byte [ebp - 8], 0x3f
push dword [ebp - 0x28]
call sub.KERNEL32.dll_GlobalFree
mov dword [0x44100c], ebp
inc dword [ebp - 8]
mov dword [0x430b98], 0
mov byte [ebp - 8], 0x42
mov byte [ebp - 8], 0x43
mov byte [ebp - 8], 0x44
cmp dword [ebp - 0xc], 0x454fc4
je 0x40ae26
push 0
call fcn.0042b684
add esp, 4
pop edi
pop esi
pop ebx
leave
ret