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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x81c
mov eax, dword [0x4363f4]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [0x238a859], 0
push ebx
push esi
mov esi, 5
push edi
mov dword [ebp - 0x818], 0x277b380
mov dword [ebp - 0x80c], 0
mov dword [ebp - 0x814], esi
je 0x40a4de
mov dword [ebp - 0x814], 4
mov esi, dword [ebp - 0x814]
mov ebx, dword [ebp + 8]
cmp ebx, 0x100000
jbe 0x40a50f
push 0x100000
push ebx
push str.In_WritePort_and_length__d_bytes_is_greater_than_buffer_size_of__d_bytes
push 0x130f
push str.WritePort
push 1
call fcn.00401210
add esp, 0x18
push 1
call fcn.004017c0
cmp byte [0x2389f2a], 0
je 0x40a5de
xor eax, eax
cmp eax, 0x3a864e0
je 0x40a555
push 0x8c
push eax
push 0x3a864e0
call fcn.0041d060
add esp, 0xc
mov ecx, 8
mov esi, 0x42bf98
mov edi, 0x3a864e8
xor eax, eax
rep movsd dword es:[edi], dword [esi]
mov dword [0x3a864e0], eax
mov dword [0x3a864e4], eax
test ebx, ebx
je 0x40a572
push 0x3a86528
push 0x3a864e0
mov eax, ebx
mov ecx, 0x277b380
call fcn.00417a60
add esp, 8
mov esi, 0x3a86528
mov ebx, 0x3a864e0
call fcn.00417b60
push esi
mov eax, 0x238a7c4
mov ecx, ebx
call fcn.00417c40
add esp, 4
xor edi, edi
xor esi, esi
jmp 0x40a5a0
movzx ecx, byte [edi + 0x238a7c4]
push ecx
mov edx, 0x100000
push 0x42fda4
sub edx, esi
push edx
lea eax, [esi + 0x253b2c0]
push eax
call fcn.004195e0
add esi, 2
add esp, 0x10
inc edi
cmp esi, 0x40
jl 0x40a5a0
mov ebx, dword [ebp + 8]
mov esi, dword [ebp - 0x814]
mov byte [edi*2 + 0x253b2c0], 0
cmp byte [0x238a74a], 0
je 0x40a68c
push 0
push 0x800
push 0
push ebx
lea edx, [ebp - 0x808]
call fcn.00414590
add esp, 0x10
cmp byte [0x2389f2a], 0
jne 0x40a64b
mov edx, dword [0x238a7a4]
mov eax, dword [0x238a7a0]
lea ecx, [ebp - 0x808]
push ecx
mov ecx, dword [0x238a79c]
push edx
mov edx, dword [0x238a798]
push eax
push ecx
push edx
push str.CHANNEL_DATA__P_.4lld___H_.5lld____s____HOST_TO_TARGET____
push 0x1324
push str.WritePort
push esi
call fcn.00401210
add esp, 0x24
jmp 0x40a708
mov ecx, dword [0x238a7a4]
mov edx, dword [0x238a7a0]
push 0x253b2c0
lea eax, [ebp - 0x808]
push eax
mov eax, dword [0x238a79c]
push ecx
mov ecx, dword [0x238a798]
push edx
push eax
push ecx
push str.CHANNEL_DATA__P_.4lld___H_.5lld____s____HOST_TO_TARGET_____SHA256_DIGEST:__s
push 0x1326
push str.WritePort
push esi
call fcn.00401210
add esp, 0x28
jmp 0x40a708
cmp byte [0x2389f2a], 0
push 0x277b380
jne 0x40a6d0
mov edx, dword [0x238a7a4]
mov eax, dword [0x238a7a0]
mov ecx, dword [0x238a79c]
push ebx
push edx
mov edx, dword [0x238a798]
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 0x132f
push str.WritePort
push esi
call fcn.00401210
add esp, 0x28
jmp 0x40a708
mov eax, dword [0x238a7a4]
mov ecx, dword [0x238a7a0]
mov edx, dword [0x238a79c]
push 0x253b2c0
push ebx
push eax
mov eax, dword [0x238a798]
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 0x1335
push str.WritePort
push esi
call fcn.00401210
add esp, 0x2c
cmp byte [0x238a7c1], 1
jne 0x40a718
mov ecx, 0x133b
jmp 0x40a72c
cmp byte [ebp + 0xc], 0
jne 0x40a73f
cmp byte [0x43740e], 5
jb 0x40a73f
mov ecx, 0x133d
push str.WritePort
push ebx
push 0x277b380
call fcn.0040aea0
add esp, 0xc
mov al, byte [0x238a859]
cmp al, 2
jne 0x40a750
cmp byte [ebp + 0xc], 1
je 0x40a75a
jmp 0x40a7a4
cmp al, 1
jne 0x40a7a4
cmp byte [ebp + 0xc], 0
jne 0x40a7a4
push ebx
push str._nINTERACTIVE_Press_any_key_to_SEND_the_above__d_bytes__q_to_quit_interactive_:
call fcn.0041984f
add esp, 8
call fcn.0041a881
push 2
push 0
push 0
mov byte [ebp - 0x80d], al
call fcn.00419036
push eax
call fcn.0041935a
add esp, 0x10
cmp byte [ebp - 0x80d], 0x71
jne 0x40a797
mov byte [0x238a859], 0
push 0x42f210
call fcn.0041984f
add esp, 4
cmp byte [0x238a7c3], 0
je 0x40a7db
mov eax, ebx
mov dword [ebp - 0x80c], eax
test eax, eax
jne 0x40a861
push str.WriteFile_failed__reported_0_bytes_written
push 0x1384
push str.WritePort
push 1
call fcn.00401210
add esp, 0x10
jmp 0x40a508
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
xor esi, esi
mov edx, dword [ebp - 0x818]
mov eax, dword [0x238a824]
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 0x40a80c
add dword [ebp - 0x818], eax
cmp eax, ebx
jae 0x40a837
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 0x1371
push str.WritePort
push 5
call fcn.00401210
mov eax, dword [ebp - 0x80c]
add esp, 0x20
sub ebx, eax
je 0x40a843
inc esi
cmp esi, 0x64
jb 0x40a7e3
jmp 0x40a84c
cmp esi, 0x64
jb 0x40a7b5
push esi
push 0x23f7a60
push str.Could_not_write_to__s__Windows_API_WriteFile_failed__Your_device_is_probably_not_on_this_port__attempted__d_times
push 0x137d
jmp 0x40a4f9
cmp byte [0x238a85b], 0
je 0x40ab81
xor edx, edx
cmp edx, 0x3a864e0
je 0x40a8aa
push 0x8c
xor ebx, ebx
push ebx
push 0x3a864e0
call fcn.0041d060
mov ecx, 8
mov esi, 0x42bf98
mov edi, 0x3a864e8
rep movsd dword es:[edi], dword [esi]
add esp, 0xc
mov dword [0x3a864e0], ebx
mov dword [0x3a864e4], ebx
mov eax, dword [ebp - 0x80c]
push 0x3a86528
push 0x3a864e0
mov ecx, 0x277b380
call fcn.00417a60
mov esi, 0x3a86528
mov ebx, 0x3a864e0
call fcn.00417b60
push esi
mov eax, 0x238a7c4
mov ecx, ebx
call fcn.00417c40
xor ebx, ebx
add esp, 0xc
cmp byte [ebp + 0xc], bl
jne 0x40a913
push ebx
push 0x100000
push ebx
push 0x100000
push ebx
push 0x80
push ebx
push 0x30
push ebx
push ebx
push 0x277b380
push 0x253b2c0
call fcn.0040b1b0
add esp, 0x30
mov eax, 0x253b2c0
lea edx, [eax + 1]
jmp 0x40a920
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40a920
sub eax, edx
cmp eax, 0x80
jae 0x40a949
mov edx, 0x80
sub edx, eax
push edx
lea ecx, [eax + 0x253b2c0]
push 0x20
push ecx
call fcn.0041d060
add esp, 0xc
mov eax, 0x253b2c0
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40a951
sub eax, edx
mov ecx, 0xffff7
sub ecx, eax
cmp ecx, 6
jb 0x40a986
mov edx, dword [str._____]
mov cx, word [0x430228]
mov dword [eax + 0x253b2c0], edx
mov word [eax + 0x253b2c4], cx
mov byte [eax + 0x253b2c6], bl
mov edi, 0x253b2c0
lea ecx, [edi + 1]
mov edi, edi
mov al, byte [edi]
inc edi
cmp al, bl
jne 0x40a990
sub edi, ecx
lea edx, [edi + 0x40]
cmp edx, 0x100000
jg 0x40a9e6
xor esi, esi
jmp 0x40a9b0
movzx eax, byte [esi + 0x238a7c4]
mov ecx, 0x80000
sub ecx, esi
push eax
add ecx, ecx
push 0x42fda4
sub ecx, edi
push ecx
lea edx, [edi + esi*2 + 0x253b2c0]
push edx
call fcn.004195e0
inc esi
add esp, 0x10
cmp esi, 0x20
jl 0x40a9b0
mov byte [edi + esi*2 + 0x253b2c0], bl
mov eax, 0x253b2c0
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40a9f0
xor edi, edi
sub eax, edx
cmp edi, ebx
jg 0x40aa46
jl 0x40aa08
cmp eax, 0x100000
ja 0x40aa46
xor ecx, ecx
xor esi, esi
cmp edi, ebx
jl 0x40aa46
jg 0x40aa20
cmp eax, ebx
jbe 0x40aa46
jmp 0x40aa20
mov dl, byte [ecx + 0x253b2c0]
cmp dl, 0xa
je 0x40aa30
cmp dl, 0xd
jne 0x40aa37
mov byte [ecx + 0x253b2c0], 0x20
add ecx, 1
adc esi, ebx
cmp esi, edi
jl 0x40aa20
jg 0x40aa46
cmp ecx, eax
jb 0x40aa20
cmp byte [0x2389f2b], bl
je 0x40ab38
mov eax, str.command_trace.txt
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40aa60
sub eax, edx
push eax
mov edx, 0x43022c
mov ecx, str.command_trace.txt
call fcn.00410f40
mov ecx, dword [0x238a7b8]
mov edx, dword [0x238a7bc]
mov esi, dword [0x238a7a0]
add esp, 4
mov edi, 1
sub ecx, edi
sbb edx, ebx
cmp esi, ecx
mov ecx, dword [0x238a7a4]
mov dword [0x238a778], eax
jne 0x40aafd
cmp ecx, edx
jne 0x40aafd
mov edx, dword [0x4481c8]
push edx
mov edx, dword [0x3a86598]
push edx
mov edx, dword [0x238a798]
push ecx
mov ecx, dword [0x238a79c]
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.00419c46
add dword [0x4481c8], edi
mov eax, dword [0x238a778]
add esp, 0x20
add dword [0x238a798], edi
adc dword [0x238a79c], ebx
xor esi, esi
xor ecx, ecx
mov dword [0x238a7a0], esi
mov dword [0x238a7a4], ecx
mov edx, dword [ebp - 0x80c]
push 0x253b2c0
push edx
mov edx, dword [0x238a798]
push ecx
mov ecx, dword [0x238a79c]
push esi
push ecx
push edx
push str._P_.4lld___H_.5lld____7d_bytes___s_n
push eax
call fcn.00419c46
mov eax, dword [0x238a778]
push eax
call fcn.0041a4c4
add esp, 0x24
mov dword [0x238a778], ebx
cmp byte [0x238a85b], bl
je 0x40ab81
push 0x10
mov edx, 0x4302fc
mov ecx, str.DIGEST_TABLE.bin
call fcn.00410f40
add esp, 4
mov dword [0x238a77c], eax
cmp eax, ebx
je 0x40ab81
push eax
push 1
push 0x20
push 0x238a7c4
call fcn.00419ea9
mov ecx, dword [0x238a77c]
push ecx
call fcn.0041a4c4
add esp, 0x14
mov dword [0x238a77c], ebx
mov eax, 1
add dword [0x238a798], eax
mov ecx, 0
pop edi
adc dword [0x238a79c], ecx
add dword [0x238a7a0], eax
mov eax, dword [ebp - 0x80c]
pop esi
adc dword [0x238a7a4], ecx
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.00417d45
mov esp, ebp
pop ebp
ret