Function at 0x40a430
Capabilities:
Hash data using sha256
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x81c
mov eax, dword [0x4353f4]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [0x2389cd9], 0
push ebx
push esi
mov esi, 5
push edi
mov dword [ebp - 0x818], 0x277a800
mov dword [ebp - 0x80c], 0
mov dword [ebp - 0x814], esi
je 0x40a47e
mov dword [ebp - 0x814], 4
mov esi, dword [ebp - 0x814]
mov ebx, dword [ebp + 8]
cmp ebx, 0x100000
jbe 0x40a4af
push 0x100000
push ebx
push str.In_WritePort_and_length__d_bytes_is_greater_than_buffer_size_of__d_bytes
push 0x1381
push str.WritePort
push 1
call fcn.00401210
add esp, 0x18
push 1
call fcn.004017c0
cmp byte [0x23893aa], 0
je 0x40a57e
xor eax, eax
cmp eax, 0x3a85960
je 0x40a4f5
push 0x8c
push eax
push 0x3a85960
call fcn.0041c990
add esp, 0xc
mov ecx, 8
mov esi, 0x42af98
mov edi, 0x3a85968
xor eax, eax
rep movsd dword es:[edi], dword [esi]
mov dword [0x3a85960], eax
mov dword [0x3a85964], eax
test ebx, ebx
je 0x40a512
push 0x3a859a8
push 0x3a85960
mov eax, ebx
mov ecx, 0x277a800
call fcn.00417390
add esp, 8
mov esi, 0x3a859a8
mov ebx, 0x3a85960
call fcn.00417490
push esi
mov eax, 0x2389c44
mov ecx, ebx
call fcn.00417570
add esp, 4
xor edi, edi
xor esi, esi
jmp 0x40a540
movzx ecx, byte [edi + 0x2389c44]
push ecx
mov edx, 0x100000
push 0x42ee4c
sub edx, esi
push edx
lea eax, [esi + 0x253a740]
push eax
call fcn.00418f10
add esi, 2
add esp, 0x10
inc edi
cmp esi, 0x40
jl 0x40a540
mov ebx, dword [ebp + 8]
mov esi, dword [ebp - 0x814]
mov byte [edi*2 + 0x253a740], 0
cmp byte [0x2389bca], 0
je 0x40a62c
push 0
push 0x800
push 0
push ebx
lea edx, [ebp - 0x808]
call fcn.00414560
add esp, 0x10
cmp byte [0x23893aa], 0
jne 0x40a5eb
mov edx, dword [0x2389c24]
mov eax, dword [0x2389c20]
lea ecx, [ebp - 0x808]
push ecx
mov ecx, dword [0x2389c1c]
push edx
mov edx, dword [0x2389c18]
push eax
push ecx
push edx
push str.CHANNEL_DATA__P_.4lld___H_.5lld____s____HOST_TO_TARGET____
push 0x1396
push str.WritePort
push esi
call fcn.00401210
add esp, 0x24
jmp 0x40a6a8
mov ecx, dword [0x2389c24]
mov edx, dword [0x2389c20]
push 0x253a740
lea eax, [ebp - 0x808]
push eax
mov eax, dword [0x2389c1c]
push ecx
mov ecx, dword [0x2389c18]
push edx
push eax
push ecx
push str.CHANNEL_DATA__P_.4lld___H_.5lld____s____HOST_TO_TARGET_____SHA256_DIGEST:__s
push 0x1398
push str.WritePort
push esi
call fcn.00401210
add esp, 0x28
jmp 0x40a6a8
cmp byte [0x23893aa], 0
push 0x277a800
jne 0x40a670
mov edx, dword [0x2389c24]
mov eax, dword [0x2389c20]
mov ecx, dword [0x2389c1c]
push ebx
push edx
mov edx, dword [0x2389c18]
push eax
push ecx
push edx
push str.CHANNEL_DATA__P_.4lld___H_.5lld____7d_bytes____HOST_TO_TARGET_____n_n_s_n_n
push 0x13a1
push str.WritePort
push esi
call fcn.00401210
add esp, 0x28
jmp 0x40a6a8
mov eax, dword [0x2389c24]
mov ecx, dword [0x2389c20]
mov edx, dword [0x2389c1c]
push 0x253a740
push ebx
push eax
mov eax, dword [0x2389c18]
push ecx
push edx
push eax
push str.CHANNEL_DATA__P_.4lld___H_.5lld____7d_bytes____HOST_TO_TARGET_____SHA256_DIGEST:__s_n_n_s_n_n
push 0x13a7
push str.WritePort
push esi
call fcn.00401210
add esp, 0x2c
cmp byte [0x2389c41], 1
jne 0x40a6b8
mov ecx, 0x13ad
jmp 0x40a6cc
cmp byte [ebp + 0xc], 0
jne 0x40a6df
cmp byte [0x436422], 5
jb 0x40a6df
mov ecx, 0x13af
push str.WritePort
push ebx
push 0x277a800
call fcn.0040ae40
add esp, 0xc
mov al, byte [0x2389cd9]
cmp al, 2
jne 0x40a6f0
cmp byte [ebp + 0xc], 1
je 0x40a6fa
jmp 0x40a744
cmp al, 1
jne 0x40a744
cmp byte [ebp + 0xc], 0
jne 0x40a744
push ebx
push str._nINTERACTIVE_Press_any_key_to_SEND_the_above__d_bytes__q_to_quit_interactive_:
call fcn.0041917f
add esp, 8
call fcn.0041a1b2
push 2
push 0
push 0
mov byte [ebp - 0x80d], al
call fcn.00418966
push eax
call fcn.00418c8a
add esp, 0x10
cmp byte [ebp - 0x80d], 0x71
jne 0x40a737
mov byte [0x2389cd9], 0
push 0x42e2b8
call fcn.0041917f
add esp, 4
cmp byte [0x2389c43], 0
je 0x40a77b
mov eax, ebx
mov dword [ebp - 0x80c], eax
test eax, eax
jne 0x40a801
push str.WriteFile_failed__reported_0_bytes_written
push 0x13f6
push str.WritePort
push 1
call fcn.00401210
add esp, 0x10
jmp 0x40a4a8
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
xor esi, esi
mov edx, dword [ebp - 0x818]
mov eax, dword [0x2389ca4]
push 0
lea ecx, [ebp - 0x80c]
push ecx
push ebx
push edx
push eax
call edi
test eax, eax
mov eax, dword [ebp - 0x80c]
jne 0x40a7ac
add dword [ebp - 0x818], eax
cmp eax, ebx
jae 0x40a7d7
push 0x64
lea ecx, [esi + 1]
push ecx
push ebx
push eax
push str.Only__d_bytes_written_of__d_requested__attempt__d_of__d
push 0x13e3
push str.WritePort
push 5
call fcn.00401210
mov eax, dword [ebp - 0x80c]
add esp, 0x20
sub ebx, eax
je 0x40a7e3
inc esi
cmp esi, 0x64
jb 0x40a783
jmp 0x40a7ec
cmp esi, 0x64
jb 0x40a755
push esi
push 0x23f6ee0
push str.Could_not_write_to__s__Windows_API_WriteFile_failed__Your_device_is_probably_not_on_this_port__attempted__d_times
push 0x13ef
jmp 0x40a499
cmp byte [0x2389cdb], 0
je 0x40ab21
xor edx, edx
cmp edx, 0x3a85960
je 0x40a84a
push 0x8c
xor ebx, ebx
push ebx
push 0x3a85960
call fcn.0041c990
mov ecx, 8
mov esi, 0x42af98
mov edi, 0x3a85968
rep movsd dword es:[edi], dword [esi]
add esp, 0xc
mov dword [0x3a85960], ebx
mov dword [0x3a85964], ebx
mov eax, dword [ebp - 0x80c]
push 0x3a859a8
push 0x3a85960
mov ecx, 0x277a800
call fcn.00417390
mov esi, 0x3a859a8
mov ebx, 0x3a85960
call fcn.00417490
push esi
mov eax, 0x2389c44
mov ecx, ebx
call fcn.00417570
xor ebx, ebx
add esp, 0xc
cmp byte [ebp + 0xc], bl
jne 0x40a8b3
push ebx
push 0x100000
push ebx
push 0x100000
push ebx
push 0x80
push ebx
push 0x30
push ebx
push ebx
push 0x277a800
push 0x253a740
call fcn.0040b150
add esp, 0x30
mov eax, 0x253a740
lea edx, [eax + 1]
jmp 0x40a8c0
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40a8c0
sub eax, edx
cmp eax, 0x80
jae 0x40a8e9
mov edx, 0x80
sub edx, eax
push edx
lea ecx, [eax + 0x253a740]
push 0x20
push ecx
call fcn.0041c990
add esp, 0xc
mov eax, 0x253a740
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40a8f1
sub eax, edx
mov ecx, 0xffff7
sub ecx, eax
cmp ecx, 6
jb 0x40a926
mov edx, dword [str._____]
mov cx, word [0x42f2d0]
mov dword [eax + 0x253a740], edx
mov word [eax + 0x253a744], cx
mov byte [eax + 0x253a746], bl
mov edi, 0x253a740
lea ecx, [edi + 1]
mov edi, edi
mov al, byte [edi]
inc edi
cmp al, bl
jne 0x40a930
sub edi, ecx
lea edx, [edi + 0x40]
cmp edx, 0x100000
jg 0x40a986
xor esi, esi
jmp 0x40a950
movzx eax, byte [esi + 0x2389c44]
mov ecx, 0x80000
sub ecx, esi
push eax
add ecx, ecx
push 0x42ee4c
sub ecx, edi
push ecx
lea edx, [edi + esi*2 + 0x253a740]
push edx
call fcn.00418f10
inc esi
add esp, 0x10
cmp esi, 0x20
jl 0x40a950
mov byte [edi + esi*2 + 0x253a740], bl
mov eax, 0x253a740
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40a990
xor edi, edi
sub eax, edx
cmp edi, ebx
jg 0x40a9e6
jl 0x40a9a8
cmp eax, 0x100000
ja 0x40a9e6
xor ecx, ecx
xor esi, esi
cmp edi, ebx
jl 0x40a9e6
jg 0x40a9c0
cmp eax, ebx
jbe 0x40a9e6
jmp 0x40a9c0
mov dl, byte [ecx + 0x253a740]
cmp dl, 0xa
je 0x40a9d0
cmp dl, 0xd
jne 0x40a9d7
mov byte [ecx + 0x253a740], 0x20
add ecx, 1
adc esi, ebx
cmp esi, edi
jl 0x40a9c0
jg 0x40a9e6
cmp ecx, eax
jb 0x40a9c0
cmp byte [0x23893ab], bl
je 0x40aad8
mov eax, str.command_trace.txt
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40aa00
sub eax, edx
push eax
mov edx, 0x42f2d4
mov ecx, str.command_trace.txt
call fcn.00410ed0
mov ecx, dword [0x2389c38]
mov edx, dword [0x2389c3c]
mov esi, dword [0x2389c20]
add esp, 4
mov edi, 1
sub ecx, edi
sbb edx, ebx
cmp esi, ecx
mov ecx, dword [0x2389c24]
mov dword [0x2389bf8], eax
jne 0x40aa9d
cmp ecx, edx
jne 0x40aa9d
mov edx, dword [0x447640]
push edx
mov edx, dword [0x3a85a18]
push edx
mov edx, dword [0x2389c18]
push ecx
mov ecx, dword [0x2389c1c]
push esi
push ecx
push edx
push str._P_.4lld___H_.5lld____7d_bytes____________________NEW_HASH_TABLE_SENT_HERE___3i_______________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_n
push eax
call fcn.00419576
add dword [0x447640], edi
mov eax, dword [0x2389bf8]
add esp, 0x20
add dword [0x2389c18], edi
adc dword [0x2389c1c], ebx
xor esi, esi
xor ecx, ecx
mov dword [0x2389c20], esi
mov dword [0x2389c24], ecx
mov edx, dword [ebp - 0x80c]
push 0x253a740
push edx
mov edx, dword [0x2389c18]
push ecx
mov ecx, dword [0x2389c1c]
push esi
push ecx
push edx
push str._P_.4lld___H_.5lld____7d_bytes___s_n
push eax
call fcn.00419576
mov eax, dword [0x2389bf8]
push eax
call fcn.00419df4
add esp, 0x24
mov dword [0x2389bf8], ebx
cmp byte [0x2389cdb], bl
je 0x40ab21
push 0x10
mov edx, 0x42f3a4
mov ecx, str.DIGEST_TABLE.bin
call fcn.00410ed0
add esp, 4
mov dword [0x2389bfc], eax
cmp eax, ebx
je 0x40ab21
push eax
push 1
push 0x20
push 0x2389c44
call fcn.004197d9
mov ecx, dword [0x2389bfc]
push ecx
call fcn.00419df4
add esp, 0x14
mov dword [0x2389bfc], ebx
mov eax, 1
add dword [0x2389c18], eax
mov ecx, 0
pop edi
adc dword [0x2389c1c], ecx
add dword [0x2389c20], eax
mov eax, dword [ebp - 0x80c]
pop esi
adc dword [0x2389c24], ecx
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.00417675
mov esp, ebp
pop ebp
ret