Function at 0x76b3c3b6
Capabilities:
Encrypt data using speck

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
xor ebx, ebx
mov dword [ebp - 0x30], 0xc
test dword [ebp + 0x14], 0x80
push esi
push ebx
pop eax
sete al
mov dword [ebp - 0x20], ebx
test dword [ebp + 0x14], 0x80
mov dword [ebp - 0x28], eax
sete al
mov byte [ebp - 2], bl
dec al
mov dword [ebp - 0x2c], ebx
and al, 0x10
mov byte [ebp - 1], al
lea eax, [ebp - 0x20]
push eax
call sym.msvcrt.dll__get_fmode
pop ecx
test eax, eax
je 0x76b3c40d
push ebx
push ebx
push ebx
push ebx
push ebx
call fcn.76b4977b
add esp, 0x14
mov al, byte [ebp - 1]
mov esi, 0x8000
mov ecx, dword [ebp + 0x14]
mov byte [ebp - 1], al
test esi, ecx
jne 0x76b3c437
test ecx, 0x74000
jne 0x76b3c42f
mov byte [ebp - 1], al
cmp dword [ebp - 0x20], esi
je 0x76b3c437
mov dl, al
or dl, 0x80
mov byte [ebp - 1], dl
mov eax, ecx
and eax, 3
sub eax, ebx
je 0x76b3c4a0
sub eax, 1
je 0x76b3c47c
sub eax, 1
je 0x76b3c475
call sym.msvcrt.dll___doserrno
mov dword [eax], ebx
mov eax, dword [ebp + 0xc]
or dword [eax], 0xffffffff
call sym.msvcrt.dll__errno
push 0x16
pop esi
push ebx
push ebx
push ebx
push ebx
push ebx
mov dword [eax], esi
call sym.msvcrt.dll__invalid_parameter
add esp, 0x14
mov eax, esi
jmp 0x76b3cb5f
mov esi, 0xc0000000
jmp 0x76b3c4a5
mov esi, ecx
and esi, 0x70000
neg esi
sbb esi, esi
neg esi
test cl, 8
setne al
movzx eax, al
and esi, eax
shl esi, 0x1f
add esi, 0x40000000
jmp 0x76b3c4a5
mov esi, 0x80000000
mov eax, dword [ebp + 0x18]
push edi
push 0x10
pop edi
mov dword [ebp - 0x18], esi
push 2
pop edx
mov dword [ebp - 0x24], edx
sub eax, edi
je 0x76b3c4e8
sub eax, edi
je 0x76b3c4e3
sub eax, edi
je 0x76b3c4df
sub eax, edi
je 0x76b3c4da
sub eax, 0x40
jne 0x76b3c542
cmp esi, 0x80000000
sete al
mov dword [ebp - 0xc], eax
mov edi, eax
jmp 0x76b3c4ed
push 3
pop edi
jmp 0x76b3c4ea
mov edi, edx
jmp 0x76b3c4ea
xor edi, edi
inc edi
jmp 0x76b3c4ea
mov edi, ebx
mov dword [ebp - 0xc], edi
mov eax, ecx
and eax, 0x700
cmp eax, 0x400
ja 0x76b3c52d
je 0x76b3c524
test eax, eax
je 0x76b3c524
cmp eax, 0x100
je 0x76b3c51b
cmp eax, 0x200
je 0x76b3c56d
cmp eax, 0x300
jne 0x76b3c542
mov dword [ebp - 0x10], edx
jmp 0x76b3c57d
mov dword [ebp - 0x10], 4
jmp 0x76b3c57d
mov dword [ebp - 0x10], 3
jmp 0x76b3c57d
cmp eax, 0x500
je 0x76b3c576
cmp eax, 0x600
je 0x76b3c56d
cmp eax, 0x700
je 0x76b3c576
call sym.msvcrt.dll___doserrno
mov dword [eax], ebx
mov eax, dword [ebp + 0xc]
or dword [eax], 0xffffffff
call sym.msvcrt.dll__errno
push 0x16
pop esi
push ebx
push ebx
push ebx
push ebx
push ebx
mov dword [eax], esi
call sym.msvcrt.dll__invalid_parameter
add esp, 0x14
mov eax, esi
jmp 0x76b3cb5e
mov dword [ebp - 0x10], 5
jmp 0x76b3c57d
mov dword [ebp - 0x10], 1
mov edx, 0x100
mov eax, 0x80
mov dword [ebp - 8], eax
test edx, ecx
je 0x76b3c5a7
mov eax, dword [0x76baaf64]
not eax
and eax, dword [ebp + 0x1c]
test al, al
js 0x76b3c5a4
xor eax, eax
inc eax
mov dword [ebp - 8], eax
jmp 0x76b3c5a7
mov eax, dword [ebp - 8]
test cl, 0x40
je 0x76b3c5c3
or eax, 0x4000000
or esi, 0x10000
or edi, 4
mov dword [ebp - 8], eax
mov dword [ebp - 0x18], esi
mov dword [ebp - 0xc], edi
test ecx, 0x1000
je 0x76b3c5d0
or eax, edx
mov dword [ebp - 8], eax
test cl, 0x20
je 0x76b3c5dc
or eax, 0x8000000
jmp 0x76b3c5e6
test cl, 0x10
je 0x76b3c5e9
or eax, 0x10000000
mov dword [ebp - 8], eax
call fcn.76b3b293
mov edi, dword [ebp + 0xc]
mov dword [edi], eax
cmp eax, 0xffffffff
jne 0x76b3c613
call sym.msvcrt.dll___doserrno
mov dword [eax], ebx
or dword [edi], 0xffffffff
call sym.msvcrt.dll__errno
push 0x18
pop ecx
mov dword [eax], ecx
mov eax, ecx
jmp 0x76b3cb5e
mov eax, dword [ebp + 8]
push ebx
push dword [ebp - 8]
push dword [ebp - 0x10]
mov dword [eax], 1
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 0xc]
push esi
push dword [ebp + 0x10]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileA]
mov dword [ebp - 0x1c], eax
cmp eax, 0xffffffff
jne 0x76b3c6aa
mov ecx, 0xc0000000
mov eax, esi
and eax, ecx
cmp eax, ecx
jne 0x76b3c678
test byte [ebp + 0x14], 1
je 0x76b3c678
push ebx
push dword [ebp - 8]
lea eax, [ebp - 0x30]
and esi, 0x7fffffff
push dword [ebp - 0x10]
mov dword [ebp - 0x18], esi
push eax
push dword [ebp - 0xc]
push esi
push dword [ebp + 0x10]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileA]
mov dword [ebp - 0x1c], eax
cmp eax, 0xffffffff
jne 0x76b3c6aa
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + sym.msvcrt.dll___pioinfo]
and byte [eax + ecx + 4], 0xfe
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
push eax
call fcn.76b262a9
pop ecx
call sym.msvcrt.dll__errno
mov ebx, dword [eax]
jmp 0x76b3cb5c
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileType]
test eax, eax
jne 0x76b3c6f7
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + sym.msvcrt.dll___pioinfo]
and byte [eax + ecx + 4], 0xfe
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov esi, eax
push esi
call fcn.76b262a9
pop ecx
push dword [ebp - 0x1c]
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
test esi, esi
jne 0x76b3c69e
call sym.msvcrt.dll__errno
mov dword [eax], 0xd
jmp 0x76b3c69e
cmp eax, 2
jne 0x76b3c702
or byte [ebp - 1], 0x40
jmp 0x76b3c70b
cmp eax, 3
jne 0x76b3c70b
or byte [ebp - 1], 8
push dword [ebp - 0x1c]
push dword [edi]
call fcn.76b3b6fd
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x76b3c72d
push dword [ebp - 0x1c]
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x76b3cb5e
mov ecx, dword [edi]
mov eax, ecx
mov dl, byte [ebp - 1]
and ecx, 0x1f
sar eax, 5
or dl, 1
imul ecx, ecx, 0x24
mov byte [ebp - 1], dl
mov eax, dword [eax*4 + sym.msvcrt.dll___pioinfo]
mov byte [eax + ecx + 4], dl
mov ecx, dword [edi]
mov eax, ecx
sar eax, 5
and ecx, 0x1f
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + sym.msvcrt.dll___pioinfo]
and dword [eax + ecx + 8], 0xfffffffc
mov al, dl
mov ecx, dword [ebp + 0x14]
and al, 0xc8
cmp al, 0x80
jne 0x76b3c7ef
test cl, 2
je 0x76b3c7ef
push 2
push 0xffffffffffffffff
push dword [edi]
call fcn.76b3bda1
add esp, 0xc
mov dword [ebp - 0x14], eax
cmp eax, 0xffffffff
jne 0x76b3c7a6
call sym.msvcrt.dll___doserrno
cmp dword [eax], 0x83
je 0x76b3c7e9
push dword [edi]
call fcn.76b3961e
jmp 0x76b3c69d
push 1
lea eax, [ebp - 3]
mov byte [ebp - 3], bl
push eax
push dword [edi]
call fcn.76b3d03e
add esp, 0xc
test eax, eax
jne 0x76b3c7d8
cmp byte [ebp - 3], 0x1a
jne 0x76b3c7d8
mov eax, dword [ebp - 0x14]
cdq
push edx
push eax
push dword [edi]
call fcn.76b39242
add esp, 0xc
cmp eax, 0xffffffff
je 0x76b3c79a
push ebx
push ebx
push dword [edi]
call fcn.76b3bda1
add esp, 0xc
cmp eax, 0xffffffff
je 0x76b3c79a
mov dl, byte [ebp - 1]
mov ecx, dword [ebp + 0x14]
test dl, dl
jns 0x76b3ca5f
test ecx, 0x74000
jne 0x76b3c816
mov eax, dword [ebp - 0x20]
and eax, 0x74000
jne 0x76b3c811
or ecx, 0x4000
jmp 0x76b3c813
or ecx, eax
mov dword [ebp + 0x14], ecx
mov eax, ecx
and eax, 0x74000
cmp eax, 0x4000
je 0x76b3c872
cmp eax, 0x10000
je 0x76b3c85a
cmp eax, 0x14000
je 0x76b3c85a
cmp eax, 0x20000
je 0x76b3c854
cmp eax, 0x24000
je 0x76b3c854
cmp eax, 0x40000
je 0x76b3c84e
cmp eax, 0x44000
jne 0x76b3c875
mov byte [ebp - 2], 1
jmp 0x76b3c875
mov byte [ebp - 2], 2
jmp 0x76b3c875
mov eax, ecx
and eax, 0x301
cmp eax, 0x301
setne al
dec al
and al, 2
mov byte [ebp - 2], al
jmp 0x76b3c875
mov byte [ebp - 2], bl
test ecx, 0x70000
je 0x76b3ca5f
mov dword [ebp - 0x14], ebx
test dl, 0x40
jne 0x76b3ca5f
mov eax, 0xc0000000
mov ecx, 0xfeff
and esi, eax
cmp esi, 0x40000000
je 0x76b3c9e6
cmp esi, 0x80000000
je 0x76b3c922
cmp esi, eax
jne 0x76b3ca5f
mov eax, dword [ebp - 0x10]
sub eax, 1
je 0x76b3c9ce
sub eax, 1
je 0x76b3c9ce
sub eax, 1
je 0x76b3c8e2
sub eax, 1
je 0x76b3c8e2
sub eax, 1
je 0x76b3c9ce
jmp 0x76b3ca5f
push 2
push ebx
push ebx
push dword [edi]
call fcn.76b3bf3b
add esp, 0x10
or eax, edx
je 0x76b3c913
push ebx
push ebx
push ebx
push dword [edi]
call fcn.76b3bf3b
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
je 0x76b3c79a
xor eax, eax
mov esi, ebx
inc eax
jmp 0x76b3c918
xor esi, esi
mov eax, ebx
inc esi
test eax, eax
je 0x76b3c9c1
jmp 0x76b3c924
mov esi, ebx
push 3
lea eax, [ebp - 0x14]
push eax
push dword [edi]
call fcn.76b3d03e
add esp, 0xc
test eax, eax
jle 0x76b3c941
cmp esi, 1
jne 0x76b3c94a
mov esi, ebx
jmp 0x76b3c94a
cmp eax, 0xffffffff
je 0x76b3c79a
mov ecx, dword [ebp - 0x14]
push 2
pop edx
cmp eax, edx
je 0x76b3c967
cmp eax, 3
jne 0x76b3c9ac
cmp ecx, 0xbfbbef
jne 0x76b3c967
mov byte [ebp - 2], 1
jmp 0x76b3c9c1
movzx eax, cx
cmp eax, 0xfffe
jne 0x76b3c98a
push dword [edi]
call fcn.76b3961e
pop ecx
call sym.msvcrt.dll__errno
push 0x16
pop esi
mov ebx, esi
mov dword [eax], esi
jmp 0x76b3cb5c
cmp eax, 0xfeff
jne 0x76b3c9ac
push ebx
push edx
push dword [edi]
call fcn.76b3bda1
add esp, 0xc
cmp eax, 0xffffffff
je 0x76b3c79a
mov byte [ebp - 2], 2
jmp 0x76b3c9c1
push ebx
push ebx
push dword [edi]
call fcn.76b3bda1
add esp, 0xc
cmp eax, 0xffffffff
je 0x76b3c79a
test esi, esi
je 0x76b3ca5f
mov ecx, 0xfeff
movzx eax, byte [ebp - 2]
mov esi, ebx
mov dword [ebp - 0x14], ebx
sub eax, 1
je 0x76b3ca2c
sub eax, 1
jne 0x76b3ca5f
push 2
pop eax
jmp 0x76b3ca37
mov eax, dword [ebp - 0x10]
sub eax, 1
je 0x76b3c9ce
sub eax, 1
je 0x76b3c9ce
sub eax, 1
je 0x76b3ca01
sub eax, 1
jne 0x76b3c8d4
push 2
push ebx
push ebx
push dword [edi]
call fcn.76b3bf3b
add esp, 0x10
or eax, edx
je 0x76b3c9c9
push ebx
push ebx
push ebx
push dword [edi]
call fcn.76b3bf3b
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
jne 0x76b3ca5f
jmp 0x76b3c79a
push 3
pop eax
mov dword [ebp - 0x24], eax
mov ecx, 0xbfbbef
mov dword [ebp - 0x14], ecx
sub eax, esi
push eax
lea eax, [ebp - 0x14]
add eax, esi
push eax
push dword [edi]
call sym.msvcrt.dll__write
add esp, 0xc
cmp eax, 0xffffffff
je 0x76b3c79a
add esi, eax
mov eax, dword [ebp - 0x24]
cmp eax, esi
jg 0x76b3ca3a
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul esi, ecx, 0x24
mov edx, dword [eax*4 + sym.msvcrt.dll___pioinfo]
movzx eax, byte [ebp - 2]
mov ecx, dword [edx + esi + 8]
and ecx, 0xfffffffc
or ecx, eax
mov dword [edx + esi + 8], ecx
mov ecx, dword [edi]
mov eax, ecx
sar eax, 5
and ecx, 0x1f
imul edx, ecx, 0x24
mov ecx, dword [eax*4 + sym.msvcrt.dll___pioinfo]
mov eax, dword [ebp + 0x14]
shr eax, 0xd
xor eax, dword [ecx + edx + 8]
and eax, 8
xor dword [ecx + edx + 8], eax
test byte [ebp - 1], 0x48
mov ecx, dword [ebp + 0x14]
jne 0x76b3cad3
test cl, 8
je 0x76b3cad3
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + sym.msvcrt.dll___pioinfo]
or byte [eax + ecx + 4], 0x20
mov ecx, dword [ebp + 0x14]
mov esi, dword [ebp - 0x18]
mov edx, 0xc0000000
mov eax, esi
and eax, edx
cmp eax, edx
jne 0x76b3cb5c
test cl, 1
je 0x76b3cb5c
push dword [ebp - 0x1c]
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
push ebx
push dword [ebp - 8]
lea eax, [ebp - 0x30]
and esi, 0x7fffffff
push 3
push eax
push dword [ebp - 0xc]
push esi
push dword [ebp + 0x10]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileA]
cmp eax, 0xffffffff
jne 0x76b3cb45
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
push eax
call fcn.76b262a9
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + sym.msvcrt.dll___pioinfo]
and byte [eax + ecx + 4], 0xfe
push dword [edi]
call fcn.76b3b466
pop ecx
jmp 0x76b3c69d
mov edx, dword [edi]
mov ecx, edx
sar ecx, 5
and edx, 0x1f
imul edx, edx, 0x24
mov ecx, dword [ecx*4 + sym.msvcrt.dll___pioinfo]
mov dword [edx + ecx], eax
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret