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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff54
push ebx
push esi
push edi
mov esi, dword [ebp + 8]
lea edi, [ebp - 0x68]
mov word [ebp - 2], 0
mov word [ebp - 4], 0
push 0x41
push 0
push edi
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0xac]
push 0x41
push 0
push eax
call sub.msvcrt.dll_memset
mov edx, dword [ebp + 0xc]
add esp, 0xc
mov bx, word [edx + 0x406]
movsx eax, bx
sar eax, 8
mov edx, ebx
and dl, 0xff
mov byte [edi + 1], al
mov byte [edi + 2], dl
push esi
call sub.HID.DLL_HidD_FlushQueue
test al, al
jne 0x451cbf
or eax, 0xffffffff
jmp 0x451f55
push 0x14
push 0
lea edx, [ebp - 0x24]
push edx
call sub.msvcrt.dll_memset
add esp, 0xc
push 0
push 1
push 1
push 0
call sub.kernel32.dll_CreateEventA
mov dword [ebp - 0x14], eax
test bx, bx
jle 0x451def
movsx ecx, word [ebp - 4]
sar ecx, 8
mov byte [edi + 3], cl
mov al, byte [ebp - 4]
and al, 0xff
mov byte [edi + 4], al
mov byte [edi + 5], 0
cmp bx, 0x3a
jle 0x451d08
mov dl, 0x3a
jmp 0x451d0a
mov edx, ebx
mov byte [edi + 6], dl
cmp bx, 0x3a
jle 0x451d1a
mov eax, 0x3a
jmp 0x451d1d
movsx eax, bx
push eax
movsx edx, word [ebp - 4]
add edx, dword [ebp + 0xc]
push edx
lea ecx, [edi + 7]
push ecx
call sub.msvcrt.dll_memcpy
add esp, 0xc
mov eax, dword [ebp + 0xc]
cmp byte [eax + 1], 0x47
je 0x451d8c
mov dword [ebp - 0x10], 1
push 0x40
lea ecx, [ebp - 0xab]
mov edx, dword [ebp + 0x10]
lea eax, [edi + 1]
push edx
push ecx
push eax
call fcn.00451b74
add esp, 0x10
lea edx, [ebp - 0x24]
lea ecx, [ebp - 0xc]
lea eax, [ebp - 0xac]
push edx
push ecx
push 0x41
push eax
push esi
call sub.kernel32.dll_WriteFile_1
test eax, eax
jne 0x451dbc
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x3e5
je 0x451dbc
mov ebx, 0xf0000003
jmp 0x451f4a
xor eax, eax
mov dword [ebp - 0x10], eax
lea edx, [ebp - 0x24]
push edx
lea ecx, [ebp - 0xc]
push ecx
push 0x41
push edi
push esi
call sub.kernel32.dll_WriteFile_1
test eax, eax
jne 0x451dbc
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x3e5
je 0x451dbc
mov ebx, 0xf0000003
jmp 0x451f4a
push 0xffffffffffffffff
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_WaitForSingleObject
push 0
lea edx, [ebp - 0xc]
push edx
lea ecx, [ebp - 0x24]
push ecx
push esi
call sub.kernel32.dll_GetOverlappedResult
cmp bx, 0x3a
jle 0x451def
add bx, 0xffc6
add word [ebp - 4], 0x3a
test bx, bx
jg 0x451ce8
mov byte [edi + 2], 0x3a
jmp 0x451f0a
cmp dword [ebp - 0x10], 1
jne 0x451e2f
lea eax, [ebp - 0x24]
lea edx, [ebp - 0xc]
push eax
push edx
lea ecx, [ebp - 0xac]
push 0x41
push ecx
push esi
call sub.kernel32.dll_ReadFile
test eax, eax
jne 0x451e5a
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x3e5
je 0x451e5a
mov ebx, 0xf0000003
jmp 0x451f4a
lea eax, [ebp - 0x24]
lea edx, [ebp - 0xc]
push eax
push edx
push 0x41
push edi
push esi
call sub.kernel32.dll_ReadFile
test eax, eax
jne 0x451e5a
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x3e5
je 0x451e5a
mov ebx, 0xf0000003
jmp 0x451f4a
push 0xffffffffffffffff
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_WaitForSingleObject
mov ebx, eax
test ebx, ebx
je 0x451e75
mov ebx, 0xf0000003
jmp 0x451f4a
push 1
lea eax, [ebp - 0xc]
push eax
lea edx, [ebp - 0x24]
push edx
push esi
call sub.kernel32.dll_GetOverlappedResult
test eax, eax
jne 0x451e93
mov ebx, 0xf0000003
jmp 0x451f4a
cmp dword [ebp - 0x10], 1
jne 0x451eb2
push 0x40
lea edx, [edi + 1]
mov eax, dword [ebp + 0x10]
lea ecx, [ebp - 0xab]
push eax
push edx
push ecx
call fcn.00451be4
add esp, 0x10
xor eax, eax
xor edx, edx
mov al, byte [edi + 3]
mov dl, byte [edi + 4]
shl eax, 8
or ax, dx
cmp ax, 0x400
jl 0x451ecf
mov ebx, 0xf0000003
jmp 0x451f4a
movsx eax, ax
xor edx, edx
lea ecx, [edi + 7]
mov dl, byte [edi + 6]
push edx
push ecx
add eax, dword [ebp + 0xc]
add eax, 6
push eax
call sub.msvcrt.dll_memcpy
mov dl, byte [edi + 6]
xor eax, eax
mov al, dl
and edx, 0xff
add esp, 0xc
mov cl, byte [edi + eax + 5]
mov byte [ebp - 5], cl
mov al, byte [edi + eax + 6]
mov byte [ebp - 6], al
add word [ebp - 2], dx
movsx edx, word [ebp - 2]
xor ecx, ecx
xor eax, eax
mov cl, byte [edi + 1]
mov al, byte [edi + 2]
shl ecx, 8
or ecx, eax
cmp ecx, edx
jg 0x451df8
add word [ebp - 2], 0xfffe
mov ecx, dword [ebp + 0xc]
mov ax, word [ebp - 2]
mov word [ecx + 0x408], ax
mov dl, byte [ebp - 6]
push edx
mov cl, byte [ebp - 5]
push ecx
call fcn.00451af0
add esp, 8
mov ebx, eax
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_CloseHandle
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc