Function at 0x14001139d
Capabilities:
Read file on windows
Write file on windows

Disassembly:
jmp 0x140012540
mov qword [rsp + 0x10], rdx
mov dword [rsp + 8], ecx
push rbp
push rdi
sub rsp, 0x3c8
lea rbp, [rsp + 0x30]
lea rdi, [rsp + 0x30]
mov ecx, 0x86
mov eax, 0xcccccccc
rep stosd dword [rdi], eax
mov ecx, dword [rsp + 0x3e8]
mov rax, qword [0x14001f008]
xor rax, rbp
mov qword [rbp + 0x388], rax
lea rcx, [0x140025010]
call fcn.1400113ed
mov qword [rbp + 8], 0
mov dword [rbp + 0x24], 0
mov dword [rbp + 0x44], 0
mov dword [rbp + 0x64], 0
mov dword [rbp + 0x84], 0
mov dword [rbp + 0xa4], 0
lea rax, [rbp + 0xc8]
mov rdi, rax
xor eax, eax
mov ecx, 0xa
rep stosb byte [rdi], al
lea rax, [rbp + 0xf8]
mov rdi, rax
xor eax, eax
mov ecx, 9
rep stosb byte [rdi], al
mov byte [rbp + 0x124], 0
mov byte [rbp + 0x144], 0
mov byte [rbp + 0x164], 0
mov qword [rbp + 0x188], 0
lea rax, [rbp + 0x1a8]
mov rdi, rax
xor eax, eax
mov ecx, 8
rep stosb byte [rdi], al
lea rcx, str._nbuzz_i2c_eeprom_tool__AT24C256...__flasherdumper_for_buzzpirat__bus_pirate_nby_Dreg__therealdreg_https:__github.com_therealdreg__http:__buzzpirat.com__n__nWARNING_:_ugly__buggy_and_crap_code_n__nMIT_LICENSE_n__nSyntax:_n_tbuzz_i2c_eeprom_tool.exe__com____chip_addr_0_8___R_W___file___len___mem_addr__n_nNOTE:_len_is_ignored_when_W_n_nExample_retrieving_500_bytes_from_the_address_0x69__chip_addr:_0_:_n_tbuzz_i2c_eeprom_tool.exe_com8_0_R_dump.bin_500_0x69_n
call qword [sym.imp.ucrtbased.dll_puts]
cmp dword [rbp + 0x3b0], 4
jl 0x140012635
cmp dword [rbp + 0x3b0], 7
jle 0x14001264c
lea rcx, str.bad_syntax_
call qword [sym.imp.ucrtbased.dll_puts]
mov eax, 1
jmp 0x1400131c1
mov eax, 8
imul rax, rax, 2
mov ecx, 1
imul rcx, rcx, 0
mov rdx, qword [rbp + 0x3b8]
mov rax, qword [rdx + rax]
movsx eax, byte [rax + rcx]
cmp eax, 0x38
jg 0x140012698
mov eax, 8
imul rax, rax, 2
mov ecx, 1
imul rcx, rcx, 0
mov rdx, qword [rbp + 0x3b8]
mov rax, qword [rdx + rax]
movsx eax, byte [rax + rcx]
cmp eax, 0x30
jge 0x1400126ae
lea rcx, str.Chip_address_out_of_range_n
call fcn.1400111c7
mov eax, 2
jmp 0x1400131c1
mov eax, 8
imul rax, rax, 2
mov ecx, 1
imul rcx, rcx, 0
mov rdx, qword [rbp + 0x3b8]
mov rax, qword [rdx + rax]
movsx eax, byte [rax + rcx]
lea eax, [rax + rax - 0x60]
or eax, 0xa0
mov byte [rbp + 0x144], al
movzx eax, byte [rbp + 0x144]
movzx ecx, byte [rbp + 0x144]
mov r8d, eax
mov edx, ecx
lea rcx, str.chip_addr:_0x_X__d__n
call fcn.1400111c7
cmp dword [rbp + 0x3b0], 6
jl 0x1400127b1
lea rax, [0x14001c594]
mov qword [rbp + 0x188], rax
mov eax, 8
imul rax, rax, 5
lea rdx, [0x14001c598]
mov rcx, qword [rbp + 0x3b8]
mov rcx, qword [rcx + rax]
call fcn.140011401
test rax, rax
jne 0x140012762
mov eax, 8
imul rax, rax, 5
lea rdx, [0x14001c59c]
mov rcx, qword [rbp + 0x3b8]
mov rcx, qword [rcx + rax]
call fcn.140011401
test rax, rax
je 0x140012770
lea rax, [0x14001c5a0]
mov qword [rbp + 0x188], rax
mov eax, 8
imul rax, rax, 5
lea r8, [rbp + 0x84]
mov rdx, qword [rbp + 0x188]
mov rcx, qword [rbp + 0x3b8]
mov rcx, qword [rcx + rax]
call fcn.1400112c1
test eax, eax
jne 0x1400127b1
lea rcx, str.Data_length_invalid_n
call fcn.1400111c7
mov eax, 3
jmp 0x1400131c1
cmp dword [rbp + 0x3b0], 7
jne 0x140012875
lea rax, [0x14001c594]
mov qword [rbp + 0x188], rax
mov eax, 8
imul rax, rax, 6
lea rdx, [0x14001c598]
mov rcx, qword [rbp + 0x3b8]
mov rcx, qword [rcx + rax]
call fcn.140011401
test rax, rax
jne 0x140012816
mov eax, 8
imul rax, rax, 6
lea rdx, [0x14001c59c]
mov rcx, qword [rbp + 0x3b8]
mov rcx, qword [rcx + rax]
call fcn.140011401
test rax, rax
je 0x140012824
lea rax, [0x14001c5a0]
mov qword [rbp + 0x188], rax
mov eax, 8
imul rax, rax, 6
lea r8, [rbp + 0x24]
mov rdx, qword [rbp + 0x188]
mov rcx, qword [rbp + 0x3b8]
mov rcx, qword [rcx + rax]
call fcn.1400112c1
test eax, eax
jne 0x140012862
lea rcx, str.Memory_address_invalid_n
call fcn.1400111c7
mov eax, 3
jmp 0x1400131c1
mov r8d, dword [rbp + 0x24]
mov edx, dword [rbp + 0x24]
lea rcx, str.memory_addr:_0x_X__d__n
call fcn.1400111c7
mov eax, 8
imul rax, rax, 3
mov ecx, 1
imul rcx, rcx, 0
mov rdx, qword [rbp + 0x3b8]
mov rax, qword [rdx + rax]
movsx eax, byte [rax + rcx]
cmp eax, 0x52
je 0x1400128d7
mov eax, 8
imul rax, rax, 3
mov ecx, 1
imul rcx, rcx, 0
mov rdx, qword [rbp + 0x3b8]
mov rax, qword [rdx + rax]
movsx eax, byte [rax + rcx]
cmp eax, 0x57
je 0x1400128d7
lea rcx, str.Must_specify_read_or_write_mode_n
call fcn.1400111c7
mov eax, 4
jmp 0x1400131c1
mov eax, 8
imul rax, rax, 3
mov ecx, 1
imul rcx, rcx, 0
mov rdx, qword [rbp + 0x3b8]
mov rax, qword [rdx + rax]
movsx eax, byte [rax + rcx]
cmp eax, 0x52
jne 0x14001291c
cmp dword [rbp + 0x84], 0
jne 0x14001291c
lea rcx, str.Must_specify_read_length_n
call fcn.1400111c7
mov eax, 4
jmp 0x1400131c1
mov eax, 8
imul rax, rax, 4
mov rcx, qword [rbp + 0x3b8]
mov rdx, qword [rcx + rax]
lea rcx, str.file:__s_n
call fcn.1400111c7
mov eax, 8
imul rax, rax, 3
mov ecx, 1
imul rcx, rcx, 0
mov rdx, qword [rbp + 0x3b8]
mov rax, qword [rdx + rax]
movsx eax, byte [rax + rcx]
cmp eax, 0x52
jne 0x140012989
mov eax, 8
imul rax, rax, 4
lea rdx, [0x14001c65c]
mov rcx, qword [rbp + 0x3b8]
mov rcx, qword [rcx + rax]
call qword [sym.imp.ucrtbased.dll_fopen]
mov qword [rbp + 8], rax
jmp 0x1400129ae
mov eax, 8
imul rax, rax, 4
lea rdx, [0x14001c660]
mov rcx, qword [rbp + 0x3b8]
mov rcx, qword [rcx + rax]
call qword [sym.imp.ucrtbased.dll_fopen]
mov qword [rbp + 8], rax
cmp qword [rbp + 8], 0
jne 0x1400129df
mov eax, 8
imul rax, rax, 4
mov rcx, qword [rbp + 0x3b8]
mov rdx, qword [rcx + rax]
lea rcx, str.Error_opening_file:__s_n
call fcn.1400111c7
mov eax, 2
jmp 0x1400131c1
mov eax, 8
imul rax, rax, 3
mov ecx, 1
imul rcx, rcx, 0
mov rdx, qword [rbp + 0x3b8]
mov rax, qword [rdx + rax]
movsx eax, byte [rax + rcx]
cmp eax, 0x52
jne 0x140012a34
mov eax, 8
imul rax, rax, 4
mov rcx, qword [rbp + 0x3b8]
mov r9, qword [rcx + rax]
mov r8d, dword [rbp + 0x84]
mov edx, dword [rbp + 0x84]
lea rcx, str.Reading_0x_X__d__bytes_from_eeprom_to__s_n
call fcn.1400111c7
jmp 0x140012aa8
mov r8d, 2
xor edx, edx
mov rcx, qword [rbp + 8]
call qword [sym.imp.ucrtbased.dll_fseek]
mov eax, 8
imul rax, rax, 4
mov qword [rbp + 0x378], rax
mov rcx, qword [rbp + 8]
call qword [sym.imp.ucrtbased.dll_ftell]
mov dword [rbp + 0x380], eax
mov rcx, qword [rbp + 8]
call qword [sym.imp.ucrtbased.dll_ftell]
mov rcx, qword [rbp + 0x3b8]
mov rdx, qword [rbp + 0x378]
mov r9, qword [rcx + rdx]
mov ecx, dword [rbp + 0x380]
mov r8d, ecx
mov edx, eax
lea rcx, str.Writting_0x_X__d__bytes_to_eeprom_from__s_n
call fcn.1400111c7
xor r8d, r8d
xor edx, edx
mov rcx, qword [rbp + 8]
call qword [sym.imp.ucrtbased.dll_fseek]
lea rcx, str.If_this_program_freezes__2_mins_without_output___close_this_program__reconnect_the_Bus_Pirate_to_the_USB_port_and_try_again_n
call fcn.1400111c7
mov eax, 8
imul rax, rax, 1
mov rcx, qword [rbp + 0x3b8]
mov rdx, qword [rcx + rax]
lea rcx, str.Connecting_to__s_n
call fcn.1400111c7
mov eax, 8
imul rax, rax, 1
mov rcx, qword [rbp + 0x3b8]
mov rdx, qword [rcx + rax]
lea rcx, [rbp + 0x1a8]
call fcn.140011078
mov ecx, 0x1f4
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rcx, str.this_process_can_be_slow__please__wait_and_be_patient...._n
call fcn.1400111c7
lea rcx, str.Resetting_bus_pirate_n
call fcn.1400111c7
lea rcx, [rbp + 0x1a8]
call fcn.1400113b6
mov ecx, 0x1f4
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rcx, str.Entering_bin_mode_n
call fcn.1400111c7
lea rcx, [rbp + 0x1a8]
call fcn.1400110ff
mov ecx, 0x1f4
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rcx, str.Entering_i2c_mode_n
call fcn.1400111c7
lea rcx, [rbp + 0x1a8]
call fcn.14001140b
mov ecx, 0x1f4
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rcx, str.Flushing_Com_In_n
call fcn.1400111c7
lea rcx, [rbp + 0x1a8]
call fcn.14001101e
lea rcx, str.Setting_I2C_speed_50khz__I_dont_trust_in_your_crap_cables__n
call fcn.1400111c7
xor r8d, r8d
mov dl, 0x61
lea rcx, [rbp + 0x1a8]
call fcn.1400110af
xor r8d, r8d
mov dl, 0x4c
lea rcx, [rbp + 0x1a8]
call fcn.1400110af
lea rcx, str.Flushing_Com_In_n
call fcn.1400111c7
lea rcx, [rbp + 0x1a8]
call fcn.14001101e
mov eax, 8
imul rax, rax, 3
mov ecx, 1
imul rcx, rcx, 0
mov rdx, qword [rbp + 0x3b8]
mov rax, qword [rdx + rax]
movsx eax, byte [rax + rcx]
cmp eax, 0x52
jne 0x140012f62
mov eax, 1
imul rax, rax, 0
mov byte [rbp + rax + 0xf8], 2
mov eax, 1
imul rax, rax, 1
mov byte [rbp + rax + 0xf8], 0x12
mov eax, 1
imul rax, rax, 2
movzx ecx, byte [rbp + 0x144]
mov byte [rbp + rax + 0xf8], cl
mov eax, dword [rbp + 0x24]
shr eax, 8
mov ecx, 1
imul rcx, rcx, 3
mov byte [rbp + rcx + 0xf8], al
mov eax, dword [rbp + 0x24]
and eax, 0xff
mov ecx, 1
imul rcx, rcx, 4
mov byte [rbp + rcx + 0xf8], al
mov eax, 1
imul rax, rax, 5
mov byte [rbp + rax + 0xf8], 3
xor r9d, r9d
mov r8d, 6
lea rdx, [rbp + 0xf8]
lea rcx, [rbp + 0x1a8]
call fcn.1400113b1
lea rcx, [rbp + 0x1a8]
call fcn.14001101e
mov eax, 1
imul rax, rax, 0
mov byte [rbp + rax + 0xf8], 2
mov eax, 1
imul rax, rax, 1
mov byte [rbp + rax + 0xf8], 0x10
movzx eax, byte [rbp + 0x144]
or eax, 1
mov ecx, 1
imul rcx, rcx, 2
mov byte [rbp + rcx + 0xf8], al
mov eax, 1
imul rax, rax, 2
movzx eax, byte [rbp + rax + 0xf8]
mov ecx, 1
imul rcx, rcx, 2
movzx ecx, byte [rbp + rcx + 0xf8]
mov r8d, eax
mov edx, ecx
lea rcx, str.chip_addr_for_bulk:_0x_X__d__n
call fcn.1400111c7
xor r9d, r9d
mov r8d, 3
lea rdx, [rbp + 0xf8]
lea rcx, [rbp + 0x1a8]
call fcn.1400113b1
lea rcx, [rbp + 0x1a8]
call fcn.14001101e
mov eax, dword [rbp + 0x24]
mov dword [rbp + 0x44], eax
mov dword [rbp + 0xa4], 0
jmp 0x140012d61
mov eax, dword [rbp + 0x84]
dec eax
mov dword [rbp + 0x84], eax
mov eax, dword [rbp + 0xa4]
inc eax
mov dword [rbp + 0xa4], eax
cmp dword [rbp + 0x84], 0
je 0x140012ed7
xor edx, edx
mov eax, dword [rbp + 0xa4]
mov ecx, 0x10
div ecx
mov eax, edx
test eax, eax
jne 0x140012d9b
mov edx, dword [rbp + 0x44]
lea rcx, str._n0x_08X:
call fcn.1400111c7
mov eax, dword [rbp + 0x44]
add eax, 0x10
mov dword [rbp + 0x44], eax
mov eax, 1
imul rax, rax, 0
mov byte [rbp + rax + 0xf8], 4
mov eax, 1
imul rax, rax, 1
mov byte [rbp + rax + 0xf8], 6
xor r9d, r9d
mov r8d, 2
lea rdx, [rbp + 0xf8]
lea rcx, [rbp + 0x1a8]
call fcn.1400113b1
mov eax, 1
imul rax, rax, 0
mov qword [rbp + 0x348], rax
cmp qword [rbp + 0x348], 0xa
jae 0x140012df5
jmp 0x140012dfa
call fcn.1400112f3
mov rax, qword [rbp + 0x348]
mov byte [rbp + rax + 0xc8], 0
mov qword [rbp + 0x368], 1
cmp qword [rbp + 0x368], 0xa
jae 0x140012e20
jmp 0x140012e25
call fcn.1400112f3
mov rax, qword [rbp + 0x368]
mov byte [rbp + rax + 0xc8], 0
xor r9d, r9d
mov r8d, 2
lea rdx, [rbp + 0xc8]
lea rcx, [rbp + 0x1a8]
call fcn.140011249
mov eax, 1
imul rax, rax, 0
movzx eax, byte [rbp + rax + 0xc8]
mov ecx, eax
call qword [sym.imp.ucrtbased.dll_isalnum]
test eax, eax
je 0x140012e86
mov eax, 1
imul rax, rax, 0
movzx eax, byte [rbp + rax + 0xc8]
mov dword [rbp + 0x374], eax
jmp 0x140012e90
mov dword [rbp + 0x374], 0x20
mov eax, 1
imul rax, rax, 0
movzx eax, byte [rbp + rax + 0xc8]
mov r8d, dword [rbp + 0x374]
mov edx, eax
lea rcx, str._02X__c_
call fcn.1400111c7
mov r9, qword [rbp + 8]
mov r8d, 1
mov edx, 1
lea rcx, [rbp + 0xc8]
call qword [sym.imp.ucrtbased.dll_fwrite]
jmp 0x140012d45
mov eax, 8
imul rax, rax, 4
mov rcx, qword [rbp + 0x3b8]
mov r9, qword [rcx + rax]
mov r8d, dword [rbp + 0xa4]
mov edx, dword [rbp + 0xa4]
lea rcx, str._n_n0x_X__d__bytes_saved_to__s_n
call fcn.1400111c7
mov rcx, qword [rbp + 8]
call qword [sym.imp.ucrtbased.dll_fflush]
mov eax, 1
imul rax, rax, 0
mov byte [rbp + rax + 0xf8], 4
mov eax, 1
imul rax, rax, 1
mov byte [rbp + rax + 0xf8], 7
mov eax, 1
imul rax, rax, 2
mov byte [rbp + rax + 0xf8], 3
xor r9d, r9d
mov r8d, 3
lea rdx, [rbp + 0xf8]
lea rcx, [rbp + 0x1a8]
call fcn.1400113b1
jmp 0x1400131a9
mov dword [rbp + 0x64], 0
mov eax, 1
imul rax, rax, 0
mov byte [rbp + rax + 0xf8], 2
mov eax, 1
imul rax, rax, 1
mov byte [rbp + rax + 0xf8], 0x13
mov eax, 1
imul rax, rax, 2
movzx ecx, byte [rbp + 0x144]
mov byte [rbp + rax + 0xf8], cl
mov eax, 1
imul rax, rax, 6
mov byte [rbp + rax + 0xf8], 3
mov dword [rbp + 0xa4], 0
mov eax, dword [rbp + 0x24]
mov dword [rbp + 0x44], eax
mov r9, qword [rbp + 8]
mov r8d, 1
mov edx, 1
lea rcx, [rbp + 0x124]
call qword [sym.imp.ucrtbased.dll_fread]
test rax, rax
je 0x140013175
xor edx, edx
mov eax, dword [rbp + 0xa4]
mov ecx, 0x10
div ecx
mov eax, edx
test eax, eax
jne 0x140013015
mov edx, dword [rbp + 0x44]
lea rcx, str._n0x_08X:
call fcn.1400111c7
mov eax, dword [rbp + 0x44]
add eax, 0x10
mov dword [rbp + 0x44], eax
mov eax, dword [rbp + 0x24]
shr eax, 8
mov ecx, 1
imul rcx, rcx, 3
mov byte [rbp + rcx + 0xf8], al
mov eax, dword [rbp + 0x24]
and eax, 0xff
mov ecx, 1
imul rcx, rcx, 4
mov byte [rbp + rcx + 0xf8], al
mov eax, 1
imul rax, rax, 5
movzx ecx, byte [rbp + 0x124]
mov byte [rbp + rax + 0xf8], cl
mov eax, dword [rbp + 0x64]
inc eax
mov dword [rbp + 0x64], eax
xor r9d, r9d
mov r8d, 7
lea rdx, [rbp + 0xf8]
lea rcx, [rbp + 0x1a8]
call fcn.1400113b1
mov r8d, 0xa
xor edx, edx
lea rcx, [rbp + 0xc8]
call fcn.140011311
xor r9d, r9d
mov r8d, 7
lea rdx, [rbp + 0xc8]
lea rcx, [rbp + 0x1a8]
call fcn.140011249
mov eax, 1
imul rax, rax, 2
movzx eax, byte [rbp + rax + 0xc8]
test eax, eax
jne 0x14001305a
mov eax, 1
imul rax, rax, 3
movzx eax, byte [rbp + rax + 0xc8]
test eax, eax
jne 0x14001305a
mov eax, 1
imul rax, rax, 4
movzx eax, byte [rbp + rax + 0xc8]
test eax, eax
jne 0x14001305a
mov eax, 1
imul rax, rax, 5
movzx eax, byte [rbp + rax + 0xc8]
test eax, eax
jne 0x14001305a
movzx eax, byte [rbp + 0x124]
mov ecx, eax
call qword [sym.imp.ucrtbased.dll_isalnum]
test eax, eax
je 0x14001312c
movzx eax, byte [rbp + 0x124]
mov dword [rbp + 0x374], eax
jmp 0x140013136
mov dword [rbp + 0x374], 0x20
movzx eax, byte [rbp + 0x124]
mov r8d, dword [rbp + 0x374]
mov edx, eax
lea rcx, str._02X__c_
call fcn.1400111c7
mov eax, dword [rbp + 0xa4]
inc eax
mov dword [rbp + 0xa4], eax
mov eax, dword [rbp + 0x64]
dec eax
mov dword [rbp + 0x64], eax
mov eax, dword [rbp + 0x24]
inc eax
mov dword [rbp + 0x24], eax
jmp 0x140012fc3
mov eax, 8
imul rax, rax, 4
mov ecx, dword [rbp + 0x64]
mov dword [rsp + 0x20], ecx
mov rcx, qword [rbp + 0x3b8]
mov r9, qword [rcx + rax]
mov r8d, dword [rbp + 0xa4]
mov edx, dword [rbp + 0xa4]
lea rcx, str._n_n0x_X__d__bytes_written_to_eeprom_from__s_with__d_retries_n
call fcn.1400111c7
lea rcx, [rbp + 0x1a8]
call fcn.1400113b6
mov rcx, qword [rbp + 8]
call qword [sym.imp.ucrtbased.dll_fclose]
xor eax, eax
mov rdi, rax
lea rcx, [rbp - 0x30]
lea rdx, [0x14001c270]
call fcn.140011375
mov rax, rdi
mov rcx, qword [rbp + 0x388]
xor rcx, rbp
call fcn.1400111e0
lea rsp, [rbp + 0x398]
pop rdi
pop rbp
ret