Function at 0x424640
Capabilities:
Encode data using xor

Disassembly:
push ebp
push edi
push esi
mov esi, ecx
push ebx
sub esp, 0x22c
mov ecx, dword [ecx + 0x18]
movzx edx, byte [esi + 0x10]
mov eax, dword [0x5398d0]
mov dword [esp + 0x21c], eax
xor eax, eax
mov eax, dword [esp + 0x244]
mov ebx, dword [esp + 0x248]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x240]
mov dword [esp], eax
lea eax, [esp + 0x1c]
call fcn.00423a90
cmp byte [0x526581], 0
jne 0x4246e9
xor eax, eax
lea esi, [esi]
mov edx, dword [eax + 0x4cd960]
xor dword [esp + eax + 0x1c], edx
add eax, 4
cmp eax, 0x200
jne 0x424698
lea eax, [esp + 0x1c]
mov ecx, esi
mov dword [esp], eax
call fcn.00424470
sub esp, 4
test al, al
jne 0x424726
mov byte [esi + 0x14], 1
xor edi, edi
mov eax, dword [esp + 0x21c]
sub eax, dword [0x5398d0]
jne 0x4248ce
add esp, 0x22c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
mov eax, dword [esi + 0x18]
mov dword [esp], str.JMB39x:_Write_request_sector__d_n
mov dword [esp + 4], eax
call fcn.004026d0
cmp byte [0x526581], 1
jbe 0x42468f
lea eax, [esp + 0x1c]
mov dword [esp + 8], 0
mov dword [esp + 4], 0x200
mov dword [esp], eax
call fcn.0043a720
jmp 0x42468f
xor eax, eax
lea esi, [esi]
nop
mov edx, dword [esp + eax + 0x1c]
xor edx, dword [eax + 0x4cd960]
mov dword [esp + eax + 0x1c], edx
add eax, 4
cmp eax, 0x200
jne 0x424730
lea edi, [ebx + 4]
mov ecx, ebx
xor eax, eax
mov dword [ebx], 0
mov dword [ebx + 0x1fc], 0
and edi, 0xfffffffc
sub ecx, edi
add ecx, 0x200
shr ecx, 2
rep stosd dword es:[edi], eax
mov dword [esp], ebx
mov ecx, esi
call fcn.00424270
sub esp, 4
mov edi, eax
test al, al
je 0x4246c1
xor eax, eax
lea esi, [esi]
nop
movzx edx, byte [eax + 0x4cd960]
xor byte [ebx + eax], dl
add eax, 1
cmp eax, 0x200
jne 0x424790
cmp byte [0x526581], 0
jne 0x42481c
lea eax, [esp + 0x1c]
mov dword [esp + 8], 0x200
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x42480e
mov ebp, dword [ebx + 0x1fc]
mov eax, ebx
call fcn.00423880
cmp ebp, eax
jne 0x424859
mov eax, dword [ebx]
cmp dword [esp + 0x1c], eax
je 0x4248b8
mov byte [esi + 0x14], 1
mov dword [esp + 8], str.Invalid_header_in_JMB39x_response
mov dword [esp + 4], 5
mov eax, dword [esi]
add esi, dword [eax - 0xc]
mov dword [esp], esi
call fcn.00422370
mov edi, eax
jmp 0x4246c7
mov byte [esi + 0x14], 1
mov dword [esp + 8], str.No_JMB39x_response_detected
jmp 0x4247f2
mov eax, dword [esi + 0x18]
mov dword [esp], str.JMB39x:_Read_response_sector__d_n
mov dword [esp + 4], eax
call fcn.004026d0
cmp byte [0x526581], 1
jbe 0x4247ad
mov dword [esp + 8], 0
mov dword [esp + 4], 0x200
mov dword [esp], ebx
call fcn.0043a720
jmp 0x4247ad
mov byte [esi + 0x14], 1
xor eax, eax
nop
movzx edx, byte [eax + 0x4cd960]
xor byte [ebx + eax], dl
add eax, 1
cmp eax, 0x200
jne 0x424860
mov eax, dword [esi]
mov edi, dword [ebx + 0x1fc]
add esi, dword [eax - 0xc]
mov eax, ebx
call fcn.00423880
mov edx, str.CRC_error_in_JMB39x_response
mov dword [esp + 8], 0x4cd152
cmp edi, eax
mov eax, str.JMB39x_response_contains_a_wakeup_sector
mov dword [esp + 4], 5
cmovne eax, edx
mov dword [esp], esi
mov dword [esp + 0xc], eax
call fcn.00422370
mov edi, eax
jmp 0x4246c7
mov eax, dword [ebx + 4]
cmp dword [esp + 0x20], eax
jne 0x4247e6
add dword [esi + 0x18], 1
jmp 0x4246c7
call fcn.00485600
nop
lea esi, [esi]
lea esi, [esi]
nop
push ebp
push edi
push esi
push ebx
mov ebx, ecx
add ecx, 4
sub esp, 0x24c
mov eax, dword [0x5398d0]
mov dword [esp + 0x23c], eax
xor eax, eax
mov eax, dword [ebx + 4]
mov esi, dword [esp + 0x260]
call dword [eax + 8]
test al, al
je 0x424b9b
movzx edi, byte [ebx + 0x14]
mov eax, edi
test al, al
jne 0x424ac0
mov eax, dword [esi + 0x64]
test eax, eax
jne 0x424970
mov dword [esp + 8], str.NO_DATA_ATA_commands_not_implemented__JMB39x_
mov dword [esp + 4], 0x28
mov eax, dword [ebx]
add ebx, dword [eax - 0xc]
mov dword [esp], ebx
call fcn.00422370
mov edi, eax
mov eax, dword [esp + 0x23c]
sub eax, dword [0x5398d0]
jne 0x424b96
add esp, 0x24c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret 8
mov dword [esp + 8], str.JMB39x
mov ecx, ebx
mov dword [esp + 4], 0
mov dword [esp], esi
call fcn.004224c0
sub esp, 0xc
test al, al
je 0x424946
movzx edx, byte [esi + 0xc]
cmp dl, 0xb0
je 0x424ad8
cmp dl, 0xec
jne 0x424ae3
mov ebp, 1
cmp dword [esi + 0x64], 1
jne 0x424baa
xor ecx, ecx
xor eax, eax
mov dword [esp + eax + 0x24], ecx
add eax, 4
cmp eax, 0x18
jb 0x4249ba
movzx eax, byte [ebx + 0x11]
mov dword [esp + 0x25], 0xff0302
mov ecx, ebx
mov byte [esp + 0x3a], dl
mov byte [esp + 0x28], al
movzx eax, byte [esi]
mov dword [esp + 0x29], 0xe00002
mov byte [esp + 0x2e], al
movzx eax, byte [esi + 2]
mov byte [esp + 0x38], 0xa0
mov byte [esp + 0x30], al
movzx eax, byte [esi + 4]
mov byte [esp + 0x32], al
movzx eax, byte [esi + 6]
mov byte [esp + 0x34], al
movzx eax, byte [esi + 8]
mov dword [esp + 4], 0x18
mov byte [esp + 0x36], al
lea eax, [esp + 0x3c]
mov dword [esp + 8], eax
lea eax, [esp + 0x24]
mov dword [esp], eax
call fcn.00424640
sub esp, 0xc
mov edx, eax
test al, al
je 0x424946
movzx eax, byte [esp + 0x5b]
test al, al
je 0x424b80
mov ecx, eax
and ecx, 0xffffffc1
cmp cl, 0x40
jne 0x424b10
cmp dword [esi + 0x6c], 0x200
jne 0x424bb9
mov eax, dword [esi + 0x68]
mov byte [esp + 0x1f], dl
lea ebx, [esp + 0x5c]
lea edi, [eax + 4]
mov dword [eax], 0
mov dword [eax + 0x1fc], 0
and edi, 0xfffffffc
sub eax, edi
lea ecx, [eax + 0x200]
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov eax, dword [esi + 0x6c]
mov ecx, dword [esi + 0x68]
mov dword [esp + 4], ebx
sub eax, 0x30
mov dword [esp], ecx
mov dword [esp + 8], eax
call sub.msvcrt.dll_memcpy
cmp ebp, 2
movzx edx, byte [esp + 0x1f]
je 0x424b50
mov edi, edx
jmp 0x424946
mov dword [esp + 8], str.Device_blocked_due_to_previous_errors
mov dword [esp + 4], 5
jmp 0x424937
movzx eax, byte [esi]
cmp al, 0xd1
ja 0x424af0
cmp al, 0xcf
ja 0x424b40
mov dword [esp + 8], str.ATA_command_not_implemented_due_to_truncated_response__JMB39x_
jmp 0x42492f
cmp al, 0xd5
jne 0x424ae3
movzx eax, byte [esi + 4]
cmp al, 1
je 0x424b40
cmp al, 0xe0
je 0x4249a7
test al, al
jne 0x424ae3
jmp 0x4249a7
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.ATA_command_failed__status0x_02x_
mov dword [esp + 4], 5
mov eax, dword [ebx]
add ebx, dword [eax - 0xc]
mov dword [esp], ebx
call fcn.00422370
mov edi, eax
jmp 0x424946
mov ebp, 2
jmp 0x4249ac
mov eax, dword [esi + 0x68]
mov byte [esp + 0x1f], dl
mov dword [esp], eax
call fcn.00409600
movzx edx, byte [esp + 0x1f]
mov ecx, eax
mov eax, dword [esi + 0x68]
mov edi, edx
sub byte [eax + 0x1ff], cl
jmp 0x424946
movzx eax, byte [ebx + 0x11]
mov byte [ebx + 0x14], 1
mov dword [esp + 8], str.No_device_connected_to_JMB39x_port__d
mov dword [esp + 0xc], eax
jmp 0x424b1c
call fcn.00485600
mov edx, str.is_open__
mov eax, 0x26f
call fcn.00423900
mov edx, str.in.direction__ata_cmd_in::data_in
mov eax, 0x27a
call fcn.00423900
mov edx, str.in.size__sizeof_response_
mov eax, 0x29f
call fcn.00423900
lea esi, [esi]
nop