Function at 0x402330
Capabilities:
Write file on windows

Disassembly:
sub esp, 0xc
push ebp
push esi
mov esi, dword [0x418e0c]
push edi
xor edi, edi
mov dword [esp + 0xc], edi
mov ebp, esi
cmp eax, 0x30
je 0x402379
push eax
push 0x416278
push 0x176
push 0x416288
push str.usbip_err:__13s:_4d____12s__read_from_sock_ret__d_not_equal_a_usbip_header_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x18
pop edi
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0xc
ret
call fcn.00402210
test eax, eax
js 0x40236f
mov ecx, dword [ebp + 4]
xor edx, edx
mov eax, ecx
mov esi, 0x64
div esi
test edx, edx
jne 0x4023ab
push ecx
push str.Receive_sequence:_____d_r
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0xc
mov eax, dword [ebp + 4]
push eax
call dword [sym.imp.WS2_32.dll_htonl]
xor ecx, ecx
cmp dword [ecx*4 + 0x418a08], eax
je 0x402416
inc ecx
cmp ecx, 0x100
jl 0x4023b7
mov ecx, dword [ebp + 0x18]
mov dword [esp + 0x10], ecx
mov eax, ecx
mov esi, dword [ebp + 0x20]
shl esi, 4
cmp eax, edi
jne 0x4024c7
cmp esi, edi
jne 0x4024c7
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
push edx
lea eax, [esp + 0x10]
push eax
push 0x30
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
cmp esi, edi
je 0x402425
cmp dword [esp + 0xc], 0x30
jne 0x402425
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0xc
ret
xor eax, eax
mov dword [ecx*4 + 0x418a08], edi
mov dword [esp + 0x10], eax
jmp 0x4023d2
cmp dword [0x418e28], edi
je 0x4024bd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x416310
push 0x191
push 0x416320
push str.usbip_err:__13s:_4d____12s__last_error:_ld_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x18
cmp dword [0x418e28], edi
je 0x4024bd
mov edx, dword [esp + 0xc]
push esi
push edx
push 0x41635c
push 0x192
push 0x41636c
push str.usbip_err:__13s:_4d____12s__out:_ld_ret:_d_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x1c
cmp dword [0x418e28], edi
je 0x4024bd
push 0x4163a8
push 0x193
push 0x4163b8
push 0x4163c8
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x14
pop edi
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0xc
ret
lea edi, [esi + eax]
push ebx
lea ebx, [edi + 0x30]
cmp ebx, 0xf4240
jle 0x402516
cmp dword [0x418e28], 0
je 0x402652
push esi
push eax
push ebx
push 0x4163f8
push 0x19a
push 0x416408
push str.usbip_err:__13s:_4d____12s__too_big_len__d__ld__ld_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x20
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0xc
ret
mov eax, dword [esp + 0x20]
mov ecx, ebp
push eax
add ecx, 0x30
mov eax, edi
call fcn.00401820
add esp, 4
cmp eax, edi
je 0x40256d
cmp dword [0x418e28], 0
je 0x402652
push edi
push eax
push 0x41644c
push 0x1a2
push 0x41645c
push str.usbip_err:__13s:_4d____12s__recv_from_sock_failed__d__ld_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x1c
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0xc
ret
test esi, esi
je 0x402587
mov ecx, dword [0x418e0c]
mov edx, dword [esp + 0x14]
mov eax, dword [ebp + 0x20]
lea ecx, [ecx + edx + 0x30]
call fcn.004022f0
mov eax, dword [esp + 0x28]
push eax
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x14]
push ecx
push ebx
mov edx, ebp
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
je 0x4025b6
cmp dword [esp + 0x10], ebx
jne 0x4025b6
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0xc
ret
cmp dword [0x418e28], 0
je 0x402652
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4164a8
push 0x1ab
push 0x4164b8
push str.usbip_err:__13s:_4d____12s__last_error:_ld_n_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x18
cmp dword [0x418e28], 0
je 0x402652
mov ecx, dword [esp + 0x10]
push ebx
push esi
push ecx
push 0x4164f8
push 0x1ac
push 0x416508
push str.usbip_err:__13s:_4d____12s__out:_ld_ret:_d_len:_d_n_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x20
cmp dword [0x418e28], 0
je 0x402652
push str.write_to_dev
push 0x1ad
push 0x41655c
push str.usbip_err:__13s:_4d____12s__write_dev_failed_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x14
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0xc
ret