Function at 0x40dca0
Capabilities:
Read file on windows
Resolve function by parsing pe exports
Write file on windows

Disassembly:
sub esp, 0x64
push ebx
push ebp
push esi
push edi
mov ecx, 0x10
xor eax, eax
lea edi, [esp + 0x30]
mov ebp, dword [esp + 0x78]
rep stosd dword es:[edi], eax
mov ebx, dword [esp + 0x80]
mov ecx, dword [ebp + 4]
stosb byte es:[edi], al
xor eax, eax
xor esi, esi
mov al, bh
push ecx
mov dword [esp + 0x14], 1
mov dword [esp + 0x1c], esi
mov dword [esp + 0x18], esi
mov byte [esp + 0x35], al
mov byte [esp + 0x36], bl
call sub.HID.DLL_HidD_FlushQueue
xor edx, edx
push esi
mov dword [esp + 0x20], edx
push 1
mov dword [esp + 0x28], edx
push 1
mov dword [esp + 0x30], edx
push esi
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], edx
call dword [sym.imp.KERNEL32.DLL_CreateEventA]
cmp bx, si
mov dword [esp + 0x2c], eax
jbe 0x40dde6
mov eax, dword [esp + 0x14]
xor ecx, ecx
mov cl, ah
cmp bx, 0x3a
mov byte [esp + 0x33], cl
mov byte [esp + 0x34], al
mov byte [esp + 0x35], 0
mov byte [esp + 0x36], 0x3a
ja 0x40dd3a
mov byte [esp + 0x36], bl
cmp bx, 0x3a
jbe 0x40dd47
mov ecx, 0x3a
jmp 0x40dd4f
mov ecx, ebx
and ecx, 0xffff
mov edx, dword [esp + 0x7c]
mov esi, eax
and esi, 0xffff
lea edi, [esp + 0x37]
add esi, edx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x1c]
and ecx, 3
push eax
mov eax, dword [ebp + 4]
lea edx, [esp + 0x34]
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x84]
push ecx
push 0x41
push edx
push eax
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
jne 0x40dd9e
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0x3e5
jne 0x40de1a
mov ecx, dword [esp + 0x2c]
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
mov ecx, dword [ebp + 4]
lea edx, [esp + 0x80]
push 0
lea eax, [esp + 0x20]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.DLL_GetOverlappedResult]
cmp bx, 0x3a
jbe 0x40dde4
mov ecx, dword [esp + 0x14]
add ebx, 0xffc6
add ecx, 0x3a
test bx, bx
mov dword [esp + 0x14], ecx
ja 0x40dd16
xor esi, esi
mov ecx, 0x10
xor eax, eax
lea edi, [esp + 0x30]
rep stosd dword es:[edi], eax
stosb byte es:[edi], al
mov byte [esp + 0x32], 0x3a
mov eax, dword [esp + 0x31]
mov edx, eax
and edx, 0xff
shl edx, 8
or edx, 0x3a
jle 0x40df14
mov ebx, dword [esp + 0x84]
jmp 0x40de29
mov dword [esp + 0x10], 0
jmp 0x40df45
xor esi, esi
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x80]
push eax
mov eax, dword [ebp + 4]
push ecx
lea edx, [esp + 0x38]
push 0x41
push edx
push eax
call dword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
jne 0x40de5c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0x3e5
jne 0x40df36
mov ecx, dword [esp + 0x2c]
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
test eax, eax
jne 0x40df36
mov ecx, dword [ebp + 4]
lea edx, [esp + 0x80]
push 1
lea eax, [esp + 0x20]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.DLL_GetOverlappedResult]
test eax, eax
je 0x40df36
movzx dx, byte [esp + 0x34]
mov ecx, dword [esp + 0x88]
xor eax, eax
mov ah, byte [esp + 0x33]
or eax, edx
mov edx, dword [ecx]
and eax, 0xffff
cmp eax, edx
jae 0x40df36
mov ecx, dword [esp + 0x36]
lea esi, [esp + 0x37]
and ecx, 0xff
lea edi, [eax + ebx]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x18]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
movzx ax, byte [esp + 0x36]
mov ecx, dword [esp + 0x32]
add edx, eax
mov eax, dword [esp + 0x31]
mov edi, ecx
mov esi, eax
and edi, 0xff
and esi, 0xff
mov dword [esp + 0x18], edx
shl esi, 8
or esi, edi
and edx, 0xffff
cmp edx, esi
jl 0x40de27
xor esi, esi
jmp 0x40df18
mov ecx, dword [esp + 0x32]
mov edx, dword [esp + 0x18]
and eax, 0xff
shl eax, 8
and ecx, 0xff
and edx, 0xffff
or eax, ecx
cmp edx, eax
je 0x40df3c
mov dword [esp + 0x10], esi
jmp 0x40df45
mov ecx, dword [esp + 0x88]
mov dword [ecx], edx
mov edx, dword [esp + 0x2c]
push edx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x64
ret