joyce8/EMBER2024-capa huggingface dataset:
Function at 0x407400
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
cmp byte [ebp + 0x10], 0
push ebx
push esi
push edi
mov esi, ecx
mov dword [ebp - 4], 0
je 0x4074ec
push dword [ebp + 0xc]
mov edi, dword [ebp + 8]
push 0
push edi
call fcn.00411990
add esp, 0xc
mov dword [ebp + 0x10], 0
lea ebx, [esi + 0x258]
cmp dword [ebx], 0
jbe 0x407470
nop dword [eax]
mov eax, dword [esi + 0x254]
push 7
push 0x426c40
mov al, byte [eax]
inc dword [ebp - 4]
mov byte [edi], al
inc edi
inc dword [esi + 0x254]
lea eax, [edi - 7]
push eax
call fcn.0040cf30
add esp, 0xc
test eax, eax
je 0x4074de
add dword [ebx], 0xffffffff
jne 0x407440
push dword [esi + 0x25c]
push 0
push dword [esi + 0x250]
call fcn.00411990
mov eax, dword [esi + 0x25c]
add esp, 0xc
mov ecx, dword [esi + 0x250]
mov dword [ebx], eax
mov eax, dword [esi + 0x238]
push 0
push ebx
mov dword [esi + 0x254], ecx
push dword [ebx]
push ecx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4074c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4074c2
mov dword [ebx], 0
mov eax, dword [ebp + 0x10]
inc eax
mov dword [ebp + 0x10], eax
cmp eax, 3
jl 0x407438
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
dec dword [ebx]
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [esi + 0x258]
mov edi, dword [ebp + 0xc]
mov dword [ebp - 4], edi
test eax, eax
je 0x407564
push eax
push str.Using__i_bytes_from_mbuffer
push esi
call fcn.00409880
mov eax, dword [esi + 0x258]
add esp, 0xc
cmp eax, edi
jb 0x407541
push edi
push dword [esi + 0x254]
sub eax, edi
push edi
push dword [ebp + 8]
mov dword [esi + 0x258], eax
call fcn.0040bb96
add esp, 0x10
mov eax, edi
add dword [esi + 0x254], edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ebx, dword [ebp + 8]
push eax
push dword [esi + 0x254]
push edi
push ebx
call fcn.0040bb96
mov eax, dword [esi + 0x258]
add esp, 0x10
add ebx, eax
sub edi, eax
mov dword [ebp - 4], edi
jmp 0x407567
mov ebx, dword [ebp + 8]
mov eax, dword [esi + 0x238]
lea ecx, [ebp - 4]
push 0
push ecx
push edi
push ebx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40758b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
jmp 0x40758d
xor ecx, ecx
mov eax, dword [ebp - 4]
add eax, dword [esi + 0x258]
mov dword [esi + 0x258], 0
test ecx, ecx
je 0x4075a6
mov eax, ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
Function at 0x407950
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push ebx
push esi
push edi
mov edi, ecx
lea ebx, [edi + 0x258]
mov esi, dword [edi + 0x24c]
push 0x800
push 0
push esi
mov dword [ebp - 4], 0
call fcn.00411990
add esp, 0xc
mov dword [ebp - 8], 0
cmp dword [ebx], 0
jbe 0x4079c0
nop word [eax + eax]
mov eax, dword [edi + 0x254]
push 7
push 0x426c40
mov al, byte [eax]
inc dword [ebp - 4]
mov byte [esi], al
inc esi
inc dword [edi + 0x254]
lea eax, [esi - 7]
push eax
call fcn.0040cf30
add esp, 0xc
test eax, eax
je 0x407a24
add dword [ebx], 0xffffffff
jne 0x407990
push dword [edi + 0x25c]
push 0
push dword [edi + 0x250]
call fcn.00411990
mov eax, dword [edi + 0x25c]
add esp, 0xc
mov ecx, dword [edi + 0x250]
mov dword [ebx], eax
mov eax, dword [edi + 0x238]
push 0
push ebx
mov dword [edi + 0x254], ecx
push dword [ebx]
push ecx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x407a12
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x407a12
mov dword [ebx], 0
mov eax, dword [ebp - 8]
inc eax
mov dword [ebp - 8], eax
cmp eax, 3
jl 0x407985
jmp 0x407a26
dec dword [ebx]
cmp dword [ebp - 4], 0
jle 0x407a8d
push dword [edi + 0x24c]
push edi
call fcn.00409880
push 0x426e94
push dword [edi + 0x24c]
call fcn.0040cfb0
add esp, 0x10
test eax, eax
jne 0x407a84
push 0x426e98
push dword [edi + 0x24c]
call fcn.0040cfb0
add esp, 8
test eax, eax
je 0x407961
push str._n___Target_returned_NAK____n
push edi
call fcn.00409880
add esp, 8
mov eax, 0xd
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0x15
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x407aa0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x260]
push esi
mov esi, ecx
test eax, eax
jne 0x407ad6
mov eax, 0x57
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040b500
mov esp, ebp
pop ebp
ret 0x25c
push edi
push eax
lea eax, [ebp - 0x404]
push 0x200
push eax
call fcn.0040bcd0
push 0x800
push 0
push dword [esi + 0x264]
call fcn.00411990
push str.__xml_version_1.0_____data_
push 0x800
push dword [esi + 0x264]
call fcn.0040ca05
push 0x426bec
mov edx, 0x423aec
lea ecx, [ebp - 0x404]
call fcn.00408540
push 0x426bec
mov edx, 0x423aec
lea ecx, [ebp - 0x404]
call fcn.00408540
mov edx, dword [esi + 0x264]
add esp, 0x2c
mov ecx, edx
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x407b48
push 0x800
sub ecx, edi
lea eax, [ebp - 0x404]
push eax
push 0x7d0
lea eax, [edx + ecx]
push eax
lea eax, [ebp - 0x40c]
push eax
call fcn.0040cdf6
push str.___data__n
push 0x800
push dword [esi + 0x264]
call fcn.0040d22e
mov edx, dword [esi + 0x264]
add esp, 0x20
mov ecx, edx
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x407b95
mov eax, dword [esi + 0x238]
sub ecx, edi
push 0
lea edi, [ebp - 0x408]
mov dword [ebp - 0x408], ecx
push edi
push ecx
push edx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop edi
test eax, eax
jne 0x407bcc
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x407be2
push dword [esi + 0x264]
push esi
call fcn.00409880
add esp, 8
mov ecx, esi
call fcn.00407950
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop esi
call fcn.0040b500
mov esp, ebp
pop ebp
ret 0x25c
Function at 0x407df0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
cmp dword [ebp + 8], 0
push ebx
mov ebx, ecx
je 0x407fbc
cmp dword [ebp + 0x18], 0
je 0x407fbc
push esi
push edi
push 0x800
push 0
push dword [ebx + 0x264]
call fcn.00411990
mov edi, dword [ebp + 0x10]
add esp, 0xc
mov ecx, dword [ebp + 0xc]
test edi, edi
jl 0x407e5b
jg 0x407e32
test ecx, ecx
jb 0x407e5b
mov esi, dword [ebx + 0x22c]
mov eax, esi
cdq
push edx
push eax
push edi
push ecx
call fcn.0041d710
mov edi, dword [ebp + 0x14]
push eax
movzx eax, byte [ebp + 0x1c]
push eax
mov eax, edi
cdq
idiv esi
push eax
push esi
push str.__xml_version_1.0_____data__n_read_SECTOR_SIZE_IN_BYTES__i__num_partition_sectors__i__physical_partition_number__i__start_sector__i____n__data_
jmp 0x407e82
mov esi, dword [ebx + 0x22c]
mov eax, esi
cdq
push edx
push eax
push edi
push ecx
call fcn.0041d710
mov edi, dword [ebp + 0x14]
push eax
movzx eax, byte [ebp + 0x1c]
push eax
mov eax, edi
cdq
idiv esi
push eax
push esi
push str.__xml_version_1.0_____data__n_read_SECTOR_SIZE_IN_BYTES__i__num_partition_sectors__i__physical_partition_number__i__start_sector_NUM_DISK_SECTORS_i____n__data_
push 0x800
push dword [ebx + 0x264]
call fcn.0040ca05
mov edx, dword [ebx + 0x264]
add esp, 0x1c
mov ecx, edx
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x407ea0
mov eax, dword [ebx + 0x238]
sub ecx, esi
push 0
lea esi, [ebp + 0x1c]
mov dword [ebp + 0x1c], ecx
push esi
push ecx
push edx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x407ecc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebx + 0x264]
push ebx
call fcn.00409880
add esp, 8
nop dword [eax + eax]
mov ecx, ebx
call fcn.00407950
cmp eax, 0x15
je 0x407ee0
cmp eax, 0xd
je 0x407fb3
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
mov ecx, dword [ebx + 0x22c]
mov dword [ebp + 0x10], eax
mov eax, edi
mov dword [ebp - 4], edx
xor edx, edx
div ecx
mov esi, eax
mov dword [ebp + 0x1c], esi
test esi, esi
je 0x407f7a
mov edi, dword [ebx + 0x25c]
xor edx, edx
mov eax, edi
div ecx
cmp esi, eax
jae 0x407f2b
imul ecx, esi
mov edi, ecx
xor esi, esi
test edi, edi
je 0x407f4b
push 0
mov eax, edi
mov ecx, ebx
sub eax, esi
push eax
mov eax, dword [ebp + 8]
add eax, esi
push eax
call fcn.00407400
add esi, eax
cmp esi, edi
jb 0x407f31
mov eax, dword [ebp + 0x18]
mov esi, dword [ebp + 0x1c]
add dword [ebp + 8], edi
push esi
add dword [eax], edi
push str.Sectors_remaining__i_r
call fcn.0040b79b
mov ecx, dword [ebx + 0x22c]
xor edx, edx
mov eax, edi
add esp, 8
div ecx
sub esi, eax
mov dword [ebp + 0x1c], esi
jne 0x407f16
mov edi, dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
mov esi, 1
mov ecx, 0
sub esi, dword [ebp + 0x10]
sbb ecx, dword [ebp - 4]
add eax, esi
adc edx, ecx
push edx
push eax
push 0
push edi
call fcn.0041d7c0
push eax
push str._nDownloaded_raw_image_at_speed__i_KB_s_n
call fcn.0040b79b
add esp, 8
mov ecx, ebx
call fcn.00407950
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov eax, 0x57
pop ebx
mov esp, ebp
pop ebp
ret 0x18
Function at 0x407fd0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
push dword [ebp + 0x14]
mov esi, ecx
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
push str.__xml_version_1.0_____data__n_createstoragedrives_DRIVE4_SIZE_IN_KB__i__DRIVE5_SIZE_IN_KB__i__DRIVE6_SIZE_IN_KB__i__DRIVE7_SIZE_IN_KB__i______data_
push 0x800
push dword [esi + 0x264]
call fcn.0040ca05
mov edx, dword [esi + 0x264]
add esp, 0x1c
mov ecx, edx
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x408006
mov eax, dword [esi + 0x238]
sub ecx, edi
push 0
lea edi, [ebp + 0x14]
mov dword [ebp + 0x14], ecx
push edi
push ecx
push edx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x408032
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [esi + 0x264]
push esi
call fcn.00409880
add esp, 8
mov ecx, esi
call fcn.00407950
push 0
push dword [esi + 0x25c]
mov ecx, esi
mov edi, eax
push dword [esi + 0x24c]
call fcn.00407400
test eax, eax
jle 0x408072
push dword [esi + 0x24c]
push esi
call fcn.00409880
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebp
ret 0x10

Function at 0x408080
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
push dword [ebp + 8]
mov esi, ecx
push str.__xml_version_1.0_____data__n_setbootablestoragedrive_value__i______data__n
push 0x800
push dword [esi + 0x264]
call fcn.0040ca05
mov edx, dword [esi + 0x264]
add esp, 0x10
mov ecx, edx
lea edi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4080b0
mov eax, dword [esi + 0x238]
sub ecx, edi
push 0
lea edi, [ebp + 8]
mov dword [ebp + 8], ecx
push edi
push ecx
push edx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4080dc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [esi + 0x264]
push esi
call fcn.00409880
add esp, 8
mov ecx, esi
call fcn.00407950
push 0
push dword [esi + 0x25c]
mov ecx, esi
mov edi, eax
push dword [esi + 0x24c]
call fcn.00407400
test eax, eax
jle 0x40811c
push dword [esi + 0x24c]
push esi
call fcn.00409880
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebp
ret 4
Function at 0x408130
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
push edi
mov esi, ecx
push 0x800
push 0
push dword [esi + 0x264]
call fcn.00411990
push str.__xml_version_1.0_____data_
push 0x800
push dword [esi + 0x264]
call fcn.0040ca05
mov edx, dword [esi + 0x264]
add esp, 0x18
mov ecx, edx
lea edi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x408170
push 0x800
push dword [ebp + 8]
sub ecx, edi
push 0x200
lea eax, [edx + ecx]
push eax
lea eax, [ebp - 4]
push eax
call fcn.0040cdf6
push str.___data__n
push 0x800
push dword [esi + 0x264]
call fcn.0040d22e
mov edx, dword [esi + 0x264]
add esp, 0x20
mov ecx, edx
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4081b6
mov eax, dword [esi + 0x238]
sub ecx, edi
push ebx
xor edi, edi
mov dword [ebp + 8], ecx
push edi
lea ebx, [ebp + 8]
push ebx
push ecx
push edx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop ebx
test eax, eax
jne 0x4081e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push dword [esi + 0x264]
push str.Programming_RAW_command:__s_n
push esi
call fcn.00409880
add esp, 0xc
mov ecx, esi
push 0
push dword [esi + 0x25c]
push dword [esi + 0x24c]
call fcn.00407400
push dword [esi + 0x24c]
push 0x42734c
push esi
call fcn.00409880
add esp, 0xc
mov eax, edi
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4
Function at 0x4086d0
Capabilities:
Hash data using crc32b

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
xor edi, edi
or ebx, 0xffffffff
cmp dword [ebp + 0xc], edi
jle 0x408781
mov edx, 0x80
push esi
nop dword [eax]
mov eax, dword [ebp + 8]
movzx ecx, byte [edi + eax]
xor eax, eax
test cl, 1
cmovne eax, edx
sar ecx, 1
test cl, 1
je 0x40870a
bts eax, 6
sar ecx, 1
test cl, 1
je 0x408715
bts eax, 5
sar ecx, 1
test cl, 1
je 0x408720
bts eax, 4
sar ecx, 1
test cl, 1
je 0x40872b
bts eax, 3
sar ecx, 1
test cl, 1
je 0x408736
bts eax, 2
sar ecx, 1
test cl, 1
je 0x408741
bts eax, 1
test cl, 2
je 0x40874a
bts eax, 0
mov esi, 8
nop
mov edx, ebx
movzx ecx, al
sar edx, 0x1f
add ebx, ebx
and edx, 1
shr ecx, 7
xor ecx, edx
je 0x40876a
xor ebx, 0x4c11db7
add al, al
sub esi, 1
jne 0x408750
inc edi
mov edx, 0x80
cmp edi, dword [ebp + 0xc]
jl 0x4086f0
pop esi
xor eax, eax
lea ecx, [eax + 0x1f]
test bl, 1
je 0x40878e
bts eax, ecx
dec ecx
sar ebx, 1
cmp ecx, 0xffffffff
jg 0x408786
pop edi
not eax
pop ebx
pop ebp
ret 8
Function at 0x409510
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push esi
push edi
push 0
push 0
push 3
push 0
push 1
mov esi, ecx
push 0x80000000
push dword [ebp + 8]
mov dword [esi + 4], 0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40954e
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4
push ebx
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov dword [ebp - 4], ebx
cmp ebx, 0xffffffff
jne 0x409574
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, ebx
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4
push ebx
call fcn.0040b57a
lea ecx, [ebx*2 + 4]
mov dword [ebp + 8], eax
push ecx
call fcn.0040b57a
add esp, 8
mov dword [esi + 4], eax
mov dword [esi + 0xc], eax
lea ecx, [eax + ebx*2]
mov dword [esi + 8], ecx
mov ecx, dword [ebp + 8]
test ecx, ecx
je 0x4095c4
test eax, eax
je 0x4095c4
push 0
lea eax, [ebp - 4]
push eax
push ebx
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
mov ecx, 0x3ee
mov ebx, 0
cmove ebx, ecx
jmp 0x4095c9
mov ebx, 0xe
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
jne 0x409676
mov eax, dword [ebp - 4]
push eax
push dword [ebp + 8]
add eax, 2
push eax
push dword [esi + 4]
lea eax, [ebp - 8]
push eax
call fcn.0040d628
mov eax, dword [esi + 4]
add esp, 0x14
mov edx, dword [esi + 8]
mov dword [esi + 0xc], eax
cmp eax, edx
jae 0x409626
nop
mov eax, dword [esi + 0xc]
mov cx, word [eax]
add eax, 2
mov dword [esi + 0xc], eax
cmp cx, 0x3c
jne 0x409621
mov cx, word [eax]
add eax, 2
mov dword [esi + 0xc], eax
cmp cx, 0x3f
je 0x409626
cmp dword [esi + 0xc], edx
jb 0x409600
mov ecx, dword [esi + 0xc]
cmp ecx, edx
jae 0x409655
nop dword [eax]
mov ax, word [ecx]
lea edi, [ecx + 2]
mov dword [esi + 0xc], edi
cmp ax, 0x3f
jne 0x40964e
mov cx, word [edi]
lea eax, [edi + 2]
mov dword [esi + 0xc], eax
cmp cx, 0x3e
je 0x409655
mov ecx, dword [esi + 0xc]
cmp ecx, edx
jb 0x409630
cmp dword [esi + 0xc], edx
jae 0x409676
nop word [eax + eax]
mov eax, dword [esi + 0xc]
mov cx, word [eax]
add eax, 2
mov dword [esi + 0xc], eax
cmp cx, 0x3e
je 0x409676
cmp eax, edx
jb 0x409660
mov eax, dword [ebp + 8]
test eax, eax
je 0x409686
push eax
call fcn.0040b542
add esp, 4
mov eax, ebx
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4
Function at 0x40a040
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x124
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 8], eax
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, ecx
push 3
push 1
call fcn.0040a680
test eax, eax
jne 0x40a19f
mov eax, dword [esi]
lea ecx, [ebp - 0x120]
push 0
push ecx
push 0x10
lea ecx, [ebp - 0x11c]
mov dword [ebp - 0x120], 0x10
push ecx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a0a3
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40a18c
cmp dword [ebp - 0x120], 0
je 0x40a18c
mov eax, dword [ebp - 0x11c]
cmp eax, 0xb
je 0x40a0cf
push eax
push str.Unexpected_response_for_command_mode__i_n
push esi
call fcn.00409ee0
add esp, 0xc
jmp 0x40a19a
push ecx
lea eax, [ebp - 0x10c]
mov ecx, esi
push eax
push 1
call fcn.00409f00
test eax, eax
jle 0x40a0f3
cmp eax, 0x100
jae 0x40a0f3
mov eax, dword [ebp - 0x10c]
mov dword [edi], eax
push ecx
lea eax, [ebp - 0x10c]
mov ecx, esi
push eax
push 2
call fcn.00409f00
test eax, eax
jle 0x40a118
cmp eax, 0x100
jae 0x40a118
mov eax, dword [ebp - 0x108]
mov dword [edi + 4], eax
push ecx
lea eax, [ebp - 0x10c]
mov ecx, esi
push eax
push 3
call fcn.00409f00
test eax, eax
jle 0x40a14b
cmp eax, 0x100
jae 0x40a14b
push 0x20
lea eax, [ebp - 0x10c]
push eax
lea eax, [edi + 8]
push 0x20
push eax
call fcn.0040bb96
add esp, 0x10
push ecx
lea eax, [ebp - 0x10c]
mov ecx, esi
push eax
push 7
call fcn.00409f00
test eax, eax
jle 0x40a170
cmp eax, 0x100
jae 0x40a170
mov eax, dword [ebp - 0x10c]
mov dword [edi + 0x28], eax
push ecx
mov ecx, esi
call fcn.0040a1c0
xor eax, eax
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040b500
mov esp, ebp
pop ebp
ret 4
push str.No_response_from_device_after_switch_mode_command_n
push esi
call fcn.00409ee0
add esp, 8
mov eax, 0x57
mov ecx, dword [ebp - 8]
pop edi
xor ecx, ebp
pop esi
call fcn.0040b500
mov esp, ebp
pop ebp
ret 4
Function at 0x40a680
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x50
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x4c], eax
push esi
push edi
push 0x2c
lea eax, [esp + 0x2c]
mov dword [esp + 0x28], 0
push 0
push eax
mov edi, ecx
call fcn.00411990
add esp, 0xc
mov dword [esp + 8], 0x30
cmp byte [ebp + 8], 0
je 0x40a79d
mov esi, dword [edi]
lea eax, [esp + 0x10]
push eax
mov dword [esp + 0x1c], 0xa
mov dword [esp + 0x14], 0xffffffff
push dword [esi]
mov dword [esp + 0x1c], 0xffffffff
mov dword [esp + 0x28], 0xa
mov dword [esp + 0x24], 0xffffffff
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
push 0
lea ecx, [esp + 0xc]
mov dword [esi + 8], 0xa
mov eax, dword [edi]
push ecx
push dword [esp + 0x10]
lea ecx, [esp + 0x30]
push ecx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a725
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esp + 0x24], 1
je 0x40a75d
mov ecx, edi
call fcn.0040a840
test eax, eax
je 0x40a75d
push str.Did_not_receive_Sahara_hello_packet_from_device_n
push edi
call fcn.00409ec0
add esp, 8
mov eax, 6
pop edi
pop esi
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.0040b500
mov esp, ebp
pop ebp
ret 8
mov esi, dword [edi]
lea eax, [esp + 0x10]
push eax
mov dword [esp + 0x1c], 0x7d0
mov dword [esp + 0x14], 0xffffffff
push dword [esi]
mov dword [esp + 0x1c], 0xffffffff
mov dword [esp + 0x28], 0x7d0
mov dword [esp + 0x24], 0xffffffff
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
mov dword [esi + 8], 0x7d0
jmp 0x40a7a4
mov ecx, dword [edi]
call fcn.0040aa90
mov eax, dword [ebp + 0xc]
lea ecx, [esp + 0xc]
push 0
push ecx
mov dword [esp + 0x40], eax
lea ecx, [esp + 0x2c]
mov eax, dword [edi]
push 0x30
push ecx
mov dword [esp + 0x34], 2
mov dword [esp + 0x38], 0x30
mov dword [esp + 0x3c], 2
mov dword [esp + 0x40], 1
mov dword [esp + 0x44], 0
mov dword [esp + 0x1c], 0x30
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a827
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x40a827
push str.Failed_to_write_hello_response_back_to_device_n
push edi
call fcn.00409ec0
add esp, 8
mov eax, 6
pop edi
pop esi
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.0040b500
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [esp + 0x54]
xor eax, eax
pop edi
pop esi
xor ecx, esp
call fcn.0040b500
mov esp, ebp
pop ebp
ret 8
Function at 0x40a840
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
push 3
push 0
mov edi, ecx
call fcn.0040a680
test eax, eax
jne 0x40a903
mov esi, dword [edi]
lea eax, [ebp - 0x18]
push eax
mov dword [ebp - 0x2c], 0x10
mov dword [ebp - 0x10], 0xa
push dword [esi]
mov dword [ebp - 0x18], 0xffffffff
mov dword [ebp - 0x14], 0xffffffff
mov dword [ebp - 8], 0xa
mov dword [ebp - 0xc], 0xffffffff
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
push 0
lea ecx, [ebp - 0x2c]
mov dword [esi + 8], 0xa
mov eax, dword [edi]
push ecx
push dword [ebp - 0x2c]
lea ecx, [ebp - 0x28]
push ecx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a8c9
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40a8fb
cmp dword [ebp - 0x2c], 0
je 0x40a8fb
mov eax, dword [ebp - 0x28]
cmp eax, 0xb
je 0x40a8fb
push eax
push str.PblHack:_Error____i_n
push edi
call fcn.00409ec0
add esp, 0xc
mov eax, 0xd
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040b500
mov esp, ebp
pop ebp
ret
push ecx
mov ecx, edi
call fcn.0040a1c0
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0040b500
mov esp, ebp
pop ebp
ret

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

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push edi
mov edi, ecx
mov dword [ebp - 4], 0
cmp dword [edi], 0xffffffff
jne 0x40abb1
mov eax, 6
pop edi
mov esp, ebp
pop ebp
ret 0x10
push ebx
lea eax, [ebp - 8]
mov dword [ebp - 8], 0x20000
push eax
push dword [edi + 4]
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.0040acc0
mov eax, dword [ebp - 8]
lea ecx, [ebp + 0xc]
push 0
push ecx
push eax
push dword [edi + 4]
mov dword [ebp + 0xc], eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40abf3
call ebx
test eax, eax
jne 0x40ac55
push esi
xor esi, esi
mov eax, dword [edi + 4]
lea ecx, [ebp - 4]
push 0
push ecx
push 1
add eax, esi
mov dword [ebp - 4], 1
push eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40ac1d
call ebx
test eax, eax
jne 0x40ac54
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x40ac45
mov eax, dword [edi + 4]
cmp byte [esi + eax], 0x7e
jne 0x40ac34
cmp esi, 1
jg 0x40ac3f
xor esi, esi
inc esi
cmp esi, 0x20000
jl 0x40abf6
jmp 0x40ac45
lea ecx, [esi + 1]
mov dword [ebp - 4], ecx
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push ecx
push dword [edi + 4]
call fcn.0040ad70
pop esi
pop ebx
pop edi
mov esp, ebp
pop ebp
ret 0x10