Function at 0x1003aad
Capabilities:
Check if file exists
Get file attributes
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x28
push esi
lea eax, [ebp - 0xc]
xor esi, esi
push eax
mov dword [ebp - 4], esi
call fcn.01003822
test al, al
jne 0x1003ad3
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x1003d79
push ebx
push edi
push esi
push 0x1000
push esi
push esi
push 2
call dword [sym.imp.CRYPT32.dll_CertOpenStore]
push dword [ebp + 8]
mov dword [ebp - 8], eax
call dword [sym.imp.msvcrt.dll_wcslen]
lea eax, [eax + eax + 0xa]
push eax
call dword [sym.imp.msvcrt.dll_malloc]
cmp dword [ebp - 8], esi
pop ecx
pop ecx
mov ebx, eax
je 0x1003d4e
cmp ebx, esi
je 0x1003d4e
push dword [ebp + 8]
push ebx
call dword [sym.imp.msvcrt.dll_wcscpy]
push 0x10014d8
push ebx
call dword [sym.imp.msvcrt.dll_wcscat]
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
add esp, 0x10
push ebx
call edi
cmp eax, 0xffffffff
je 0x1003b4e
lea eax, [ebp - 0x14]
push eax
push ebx
call fcn.010039ef
cmp eax, esi
mov dword [ebp - 4], eax
jne 0x1003b85
cmp dword [ebp - 0x14], esi
jne 0x1003b85
push dword [ebp + 8]
push ebx
call dword [sym.imp.msvcrt.dll_wcscpy]
push 0x10014cc
push ebx
call dword [sym.imp.msvcrt.dll_wcscat]
add esp, 0x10
push ebx
call edi
cmp eax, 0xffffffff
je 0x1003b9c
lea eax, [ebp - 0x14]
push eax
push ebx
call fcn.010039ef
cmp eax, esi
mov dword [ebp - 4], eax
jne 0x1003b85
cmp dword [ebp - 0x14], esi
je 0x1003b9c
push ebx
call dword [sym.imp.msvcrt.dll_free]
pop ecx
push esi
push dword [ebp - 8]
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
jmp 0x1003d74
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x10]
push eax
call fcn.010033d2
test al, al
je 0x1003d31
push esi
push 0x80
push 2
push esi
push esi
push 0x40000000
push ebx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x14], esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x1003c0d
push esi
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x10]
push dword [eax + 8]
push dword [eax + 4]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1003bfc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x1003c04
push 0x28
call fcn.0100187f
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1003c16
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
push esi
push 4
push dword [ebp - 0x10]
push dword [ebp - 8]
call dword [sym.imp.CRYPT32.dll_CertAddCertificateContextToStore]
test eax, eax
je 0x1003d08
xor eax, eax
push 7
lea edi, [ebp - 0x28]
stosd dword es:[edi], eax
push esi
push dword [ebp - 0xc]
stosd dword es:[edi], eax
mov edi, dword [sym.imp.CRYPT32.dll_PFXExportCertStoreEx]
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 8]
call edi
test eax, eax
je 0x1003cff
push dword [ebp - 0x28]
call dword [sym.imp.msvcrt.dll_malloc]
cmp eax, esi
pop ecx
mov dword [ebp - 0x24], eax
je 0x1003cf6
push 7
push esi
push dword [ebp - 0xc]
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 8]
call edi
test eax, eax
je 0x1003ce1
push dword [ebp + 8]
push ebx
call dword [sym.imp.msvcrt.dll_wcscpy]
push 0x10014d8
push ebx
call dword [sym.imp.msvcrt.dll_wcscat]
add esp, 0x10
push esi
push 0x80
push 2
push esi
push esi
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x1003ce1
push esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x28]
push dword [ebp - 0x24]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1003cd0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x1003cd8
push 0x29
call fcn.0100187f
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1003cea
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
push dword [ebp - 0x24]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
jmp 0x1003d08
mov dword [ebp - 4], 8
jmp 0x1003d08
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
push dword [ebp - 0x10]
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.RPCRT4.dll_RpcStringFreeW]
push 0x50
push 1
push dword [ebp - 0x1c]
lea eax, [ebp - 0x20]
push dword [ebp - 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
jmp 0x1003d3a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
push ebx
call dword [sym.imp.msvcrt.dll_free]
pop ecx
push esi
push dword [ebp - 8]
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
jmp 0x1003d55
mov dword [ebp - 4], 8
cmp dword [ebp - 0xc], esi
je 0x1003d64
push dword [ebp - 0xc]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
cmp dword [ebp - 4], esi
je 0x1003d74
push dword [ebp - 4]
push esi
call fcn.010019e8
pop ecx
pop ecx
mov eax, dword [ebp - 4]
pop edi
pop ebx
pop esi
leave
ret 4