Function at 0x1001d510
Capabilities:
Create new key via cryptacquirecontext
Encrypt or decrypt via wincrypt
Read file on windows
Resolve function by parsing pe exports
Write file on windows

Disassembly:
sub esp, 0x2a0
mov eax, dword [0x10139d00]
xor eax, esp
mov dword [esp + 0x29c], eax
mov eax, dword [esp + 0x2a4]
push ebx
push ebp
push esi
push edi
mov edi, ecx
lea ecx, [esp + 0x48]
push ecx
push edi
mov dword [esp + 0x4c], eax
mov byte [esp + 0x1f], 0
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [esp + 0x40], eax
cmp eax, 0xffffffff
je 0x1001d90a
test byte [esp + 0x48], 0x10
mov eax, dword [esp + 0x50]
mov edx, dword [esp + 0x4c]
mov ebp, dword [esp + 0x68]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x30], edx
jne 0x1001d5bf
test eax, eax
ja 0x1001d57b
cmp ebp, 0x10
jb 0x1001d5bf
lea ecx, [esp + 0x24]
push ecx
lea ebx, [esp + 0x78]
call fcn.1001d390
add esp, 4
test eax, eax
je 0x1001d5bf
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x1001d595
sub eax, edx
sar eax, 1
lea edx, [eax + eax + 0x2a]
push 0x20
push edx
call fcn.100d2ffc
mov esi, eax
xor eax, eax
add esp, 8
cmp esi, eax
jne 0x1001d5e9
mov byte [esp + 0x17], al
mov ecx, dword [esp + 0x40]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
mov al, byte [esp + 0x17]
mov ecx, dword [esp + 0x2ac]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.100d0738
add esp, 0x2a0
ret 4
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
mov dword [esi], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x20], eax
mov eax, dword [esp + 0x24]
mov ebx, esi
mov dword [esi + 8], ecx
mov dword [esi + 0xc], edx
mov dword [esi + 0x14], ebp
mov dword [esi + 0x1c], eax
call fcn.1001d480
push 0xf0000000
xor ebx, ebx
push 0x18
push ebx
push ebx
lea ecx, [esp + 0x3c]
or ebp, 0xffffffff
push ecx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x30], ebp
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x2c], ebx
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x1001d646
mov byte [esp + 0x17], al
jmp 0x1001d8bc
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocString
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x1c], eax
cmp eax, ebp
jne 0x1001d66f
mov byte [esp + 0x17], 0
jmp 0x1001d8bc
mov ebx, dword [esi + 0x14]
push ebx
call fcn.100d279b
mov ebp, eax
xor edi, edi
add esp, 4
mov dword [esi + 0x10], ebp
cmp ebp, edi
jne 0x1001d690
mov byte [esp + 0x17], 0
jmp 0x1001d8bc
mov dword [esp + 0x3c], edi
test ebx, ebx
jbe 0x1001d6c3
push 0
lea edx, [esp + 0x40]
push edx
mov edx, dword [esp + 0x24]
mov eax, ebx
sub eax, edi
push eax
lea ecx, [edi + ebp]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1001d7ec
add edi, dword [esp + 0x3c]
cmp edi, ebx
jb 0x1001d698
mov eax, dword [0x101dd354]
test eax, eax
je 0x1001d6df
cmp eax, 0xea60
jbe 0x1001d6da
add eax, 0xffff15a0
jmp 0x1001d6dc
xor eax, eax
mov dword [esi + 0x18], eax
mov edi, dword [esi + 0x18]
lea eax, [edi - 1]
cmp edi, eax
je 0x1001d899
lea ecx, [ecx]
mov edx, dword [esp + 0x2c]
lea ecx, [esp + 0x18]
push ecx
push edx
mov ecx, edi
call fcn.1001d230
add esp, 8
test eax, eax
je 0x1001d7ec
mov dword [esp + 0x20], 0x10
mov eax, dword [ebp]
mov dword [esp + 0x29c], eax
mov ecx, dword [ebp + 4]
mov dword [esp + 0x2a0], ecx
mov edx, dword [ebp + 8]
mov dword [esp + 0x2a4], edx
mov eax, dword [ebp + 0xc]
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x2a0]
push edx
push 0
push 0
mov dword [esp + 0x2b8], eax
mov eax, dword [esp + 0x28]
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x1001d7ec
mov eax, dword [esi + 0x1c]
mov edx, dword [esp + 0x20]
lea ecx, [eax + eax*4]
cmp edx, dword [ecx*8 + 0x101b01ac]
jb 0x1001d785
lea ecx, [esp + 0x29c]
call fcn.1001d340
test eax, eax
jne 0x1001d7ae
mov eax, dword [esp + 0x18]
test eax, eax
je 0x1001d79c
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov dword [esp + 0x18], 0
mov eax, dword [esi + 0x18]
inc edi
dec eax
cmp edi, eax
jne 0x1001d6f0
jmp 0x1001d899
mov ecx, dword [esp + 0x20]
push ecx
lea edx, [esp + 0x2a0]
push edx
push ebp
call fcn.100d4950
mov eax, dword [esp + 0x2c]
add esp, 0xc
lea ecx, [esp + 0x30]
push ecx
lea edx, [eax + ebp]
push edx
push 0
push 1
sub ebx, eax
mov eax, dword [esp + 0x28]
push 0
push eax
mov dword [esp + 0x48], ebx
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
jne 0x1001d7f6
mov byte [esp + 0x17], 0
jmp 0x1001d8bc
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x44]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
add edx, ecx
push eax
mov dword [esi + 0x14], edx
mov dword [esi + 0x18], edi
mov dword [esi + 0x20], 1
mov dword [0x101dd354], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [esp + 0x28], ebx
cmp ebx, 0xffffffff
jne 0x1001d842
mov ecx, dword [esp + 0x18]
push ecx
jmp 0x1001d88b
xor edi, edi
mov dword [esp + 0x24], edi
cmp dword [esi + 0x14], edi
jbe 0x1001d877
mov eax, dword [esi + 0x14]
push 0
lea edx, [esp + 0x28]
push edx
sub eax, edi
push eax
lea ecx, [edi + ebp]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1001d7ec
add edi, dword [esp + 0x24]
mov byte [esp + 0x17], 1
cmp edi, dword [esi + 0x14]
jb 0x1001d84d
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x28], 0xffffffff
push edx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov dword [esp + 0x18], 0
push ebp
call fcn.100d1800
mov eax, dword [esp + 0x20]
add esp, 4
push eax
mov dword [esi + 0x10], 0
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x1c], 0xffffffff
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x1001d8cd
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [esp + 0x1c]
cmp eax, 0xffffffff
je 0x1001d8dd
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x28]
cmp eax, 0xffffffff
je 0x1001d8ed
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x1001d8fc
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push esi
call fcn.100d2fe2
add esp, 4
jmp 0x1001d5bf
xor al, al
jmp 0x1001d5ce