Function at 0x402b70
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x844
add eax, 8
push ebx
mov dword [ebp - 8], eax
movzx eax, word [ebp + 0x10]
push esi
push edi
mov dword [ebp - 0x10], eax
xor edi, edi
jmp 0x402b90
mov ecx, dword [ebp + 0x14]
mov dx, word [ecx]
mov word [ebp - 0x83e], dx
xor ecx, ecx
mov edx, 0x200
mov word [ebp - 0x840], 0x121
mov word [ebp - 0x83c], cx
movzx esi, ax
cmp ax, dx
jb 0x402bbe
mov esi, edx
mov ecx, dword [ebp - 8]
movzx eax, si
push eax
push ecx
lea edx, [ebp - 0x838]
push edx
mov word [ebp - 0x83a], si
call fcn.0040bc80
movsx esi, si
add esp, 0xc
add esi, 8
mov dword [ebp - 0x14], esi
mov dword [ebp + 0x10], 5
dec dword [ebp + 0x10]
push edi
push edi
push 1
push edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], edi
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x34]
push eax
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 4]
push ecx
push esi
lea edx, [ebp - 0x840]
push edx
push eax
xor ebx, ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x402d51
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov dword [ebp - 0xc], eax
cmp eax, 0x3e5
jne 0x402c95
mov ecx, dword [ebp - 0x1c]
push 0x1388
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x402c64
mov dword [ebp - 4], edi
call esi
mov ecx, str.ProcessOverlappedIoRequest:_WaitForSingleObject_failed
jmp 0x402c86
mov ecx, dword [ebp + 0xc]
push edi
lea edx, [ebp - 4]
push edx
lea eax, [ebp - 0x34]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x402d4e
call esi
mov ecx, str.ProcessOverlappedIoRequest:_GetOverlappedResult_failed
push ecx
mov dword [ebp - 0xc], eax
call fcn.00403900
mov eax, dword [ebp - 0xc]
add esp, 4
cmp eax, edi
je 0x402d4e
call esi
mov ebx, dword [ebp + 0xc]
push edi
lea edx, [ebp - 0x20]
push edx
push 4
mov esi, eax
lea eax, [ebp - 0x18]
push eax
push 4
lea ecx, [ebp - 0x38]
push ecx
push 0x2200b8
push ebx
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x20], edi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x402cda
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp - 0x18]
jmp 0x402cfa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._AMRUSBGetLastError:_error__d
call fcn.00403900
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, 0xc0000000
mov edx, dword [ebp - 0xc]
push eax
push edx
push str.ProcessOverlappedIoRequest:_failed__error__d__usbd_status__.8x
call fcn.00403900
add esp, 0xc
cmp dword [ebp - 0x34], 0x103
jne 0x402d38
push ebx
call dword [sym.imp.KERNEL32.dll_CancelIo]
mov eax, dword [ebp - 0x24]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x402d38
push str.WritePipe__the_I_O_may_not_be_cancelled
call fcn.00403900
add esp, 4
mov ecx, dword [ebp + 0x10]
push ecx
push str.WritePipe:_ProcessOverlappedIoRequest_failed__nAtt:__d
call fcn.00403900
add esp, 8
mov ebx, 0xffffffef
mov esi, dword [ebp - 0x14]
mov eax, dword [ebp - 4]
cmp esi, eax
je 0x402d70
mov edx, dword [ebp + 0x10]
push edx
push eax
push esi
push str.WritePipe:_failed_to_write__cbBuffer:__d__cbWritten:__d__nAtt:__d
call fcn.00403900
add esp, 0x10
mov ebx, 0xffffffef
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebx, edi
je 0x402d8b
cmp dword [ebp + 0x10], edi
jne 0x402bec
cmp ebx, edi
jne 0x402db7
movsx eax, word [ebp - 0x83a]
mov esi, dword [ebp - 0x10]
mov ecx, dword [ebp + 0x14]
inc word [ecx]
add dword [ebp - 8], eax
sub esi, eax
push 1
mov dword [ebp - 0x10], esi
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp si, di
je 0x402dd1
mov eax, esi
jmp 0x402b90
movsx ecx, bl
push ecx
push str.UploadSmallDataPackets_failed__error:__d
call fcn.00403900
add esp, 8
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret