Function at 0x1004a98
Capabilities:
Check if file exists
Get file attributes
Query or enumerate registry value
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
xor ebx, ebx
push esi
push edi
mov edi, dword [ebp + 8]
cmp edi, ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0xc], ebx
mov byte [ebp - 1], bl
mov dword [ebp - 0x24], ebx
je 0x1004fef
mov esi, dword [ebp + 0xc]
cmp esi, ebx
je 0x1004fef
cmp word [edi], bx
je 0x1004c49
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1004aed
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x1004ff2
test ah, 0x40
jne 0x1004afc
mov eax, 0x1777
jmp 0x1004ff2
lea eax, [ebp - 0x10]
push eax
push edi
mov dword [ebp - 0x10], ebx
call dword [sym.imp.ADVAPI32.dll_QueryUsersOnEncryptedFile]
cmp eax, ebx
mov dword [ebp + 8], eax
jne 0x1004ff2
mov edi, dword [sym.imp.CRYPT32.dll_CertOpenStore]
push ebx
push 0x1000
push ebx
push ebx
push 2
call edi
cmp eax, ebx
mov dword [ebp - 8], eax
je 0x1004c32
push 0x1001524
mov esi, 0x10000
push esi
push ebx
push ebx
push 0xd
call edi
cmp eax, ebx
mov dword [ebp - 0x1c], eax
je 0x1004c19
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
cmp eax, ebx
mov dword [ebp - 0x28], eax
je 0x1004c02
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 4]
mov ecx, dword [ebp - 0x28]
mov eax, dword [eax + ecx*4 - 4]
push ebx
push dword [eax + 8]
push esi
push ebx
push 1
push dword [ebp - 0x1c]
call dword [sym.imp.CRYPT32.dll_CertFindCertificateInStore]
cmp eax, ebx
mov dword [ebp - 0x2c], eax
je 0x1004bf4
push eax
call fcn.010049d5
mov edi, eax
cmp edi, ebx
je 0x1004beb
push 0x40
push 1
push dword [edi + 4]
lea eax, [ebp - 0xc]
push dword [edi]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x1004be3
lea eax, [ebp - 0x18]
push eax
push 1
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
je 0x1004bd9
push ebx
push 4
push dword [ebp - 0x2c]
push dword [ebp - 8]
call dword [sym.imp.CRYPT32.dll_CertAddCertificateContextToStore]
test eax, eax
je 0x1004bd0
mov byte [ebp - 1], 1
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push edi
call dword [sym.imp.msvcrt.dll_free]
pop ecx
push dword [ebp - 0x2c]
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
dec dword [ebp - 0x28]
jne 0x1004b5e
cmp byte [ebp - 1], bl
jne 0x1004c0d
push 0x800006a4
call fcn.0100187f
pop ecx
push ebx
push dword [ebp - 0x1c]
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
jmp 0x1004c2f
push ebx
push dword [ebp - 8]
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
mov dword [ebp - 8], ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 8], eax
mov esi, dword [ebp + 0xc]
cmp dword [ebp - 0x10], ebx
je 0x1004da0
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_FreeEncryptionCertificateHashList]
jmp 0x1004da0
lea eax, [ebp - 0x24]
push eax
push 0x80000000
push ebx
push 0x1001358
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
cmp eax, ebx
mov dword [ebp + 8], eax
jne 0x1004fea
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea eax, [ebp - 0x34]
push eax
push ebx
lea eax, [ebp - 0x2c]
push eax
push ebx
mov esi, 0x1001334
push esi
push dword [ebp - 0x24]
call edi
cmp eax, ebx
mov dword [ebp + 8], eax
jne 0x1004d94
push dword [ebp - 0x34]
call dword [sym.imp.msvcrt.dll_malloc]
cmp eax, ebx
pop ecx
mov dword [ebp - 0x30], eax
je 0x1004d94
lea ecx, [ebp - 0x34]
push ecx
push eax
lea eax, [ebp - 0x2c]
push eax
push ebx
push esi
push dword [ebp - 0x24]
call edi
cmp eax, ebx
mov dword [ebp + 8], eax
jne 0x1004d8a
mov edi, dword [sym.imp.CRYPT32.dll_CertOpenStore]
push ebx
push 0x1000
push ebx
push ebx
push 2
call edi
cmp eax, ebx
mov dword [ebp - 8], eax
je 0x1004d8a
push 0x1001524
mov esi, 0x10000
push esi
push ebx
push ebx
push 0xd
call edi
cmp eax, ebx
mov dword [ebp - 0x1c], eax
je 0x1004d8a
push ebx
lea ecx, [ebp - 0x34]
push ecx
push esi
push ebx
push 1
push eax
call dword [sym.imp.CRYPT32.dll_CertFindCertificateInStore]
mov edi, eax
cmp edi, ebx
je 0x1004d80
push edi
call fcn.010049d5
mov esi, eax
cmp esi, ebx
je 0x1004d79
push 0x40
push 1
push dword [esi + 4]
lea eax, [ebp - 0xc]
push dword [esi]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x1004d71
lea eax, [ebp - 0x18]
push eax
push 1
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
je 0x1004d67
push ebx
push 4
push edi
push dword [ebp - 8]
call dword [sym.imp.CRYPT32.dll_CertAddCertificateContextToStore]
test eax, eax
je 0x1004d5e
mov byte [ebp - 1], 1
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push esi
call dword [sym.imp.msvcrt.dll_free]
pop ecx
push edi
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
push ebx
push dword [ebp - 0x1c]
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
push dword [ebp - 0x30]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [ebp + 0xc]
cmp byte [ebp - 1], bl
je 0x1004fdb
cmp dword [ebp - 8], ebx
je 0x1004fea
cmp dword [ebp + 8], ebx
jne 0x1004fdb
lea eax, [ebp + 0xc]
push 0x800006a6
push eax
mov dword [ebp + 0xc], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x2c], ebx
call fcn.01001bf2
cmp eax, ebx
pop ecx
pop ecx
mov dword [ebp + 8], eax
jne 0x1004e17
lea eax, [ebp - 0x10]
push 0x800006a9
push eax
call fcn.01001bf2
cmp eax, ebx
pop ecx
pop ecx
mov dword [ebp + 8], eax
jne 0x1004e17
push 0x40001
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push dword [ebp + 0xc]
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x2c], eax
call edi
jmp 0x1004e30
cmp dword [ebp + 0xc], ebx
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
je 0x1004e27
push dword [ebp + 0xc]
call edi
cmp dword [ebp - 0x10], ebx
je 0x1004fdb
push dword [ebp - 0x10]
call edi
cmp dword [ebp - 0x2c], 1
jne 0x1004fdb
cmp word [esi], bx
jne 0x1004e5e
push 0x104
push esi
push 0x800006aa
call fcn.01004a3a
cmp eax, ebx
mov dword [ebp + 8], eax
je 0x1004e5e
mov word [esi], bx
push esi
call dword [sym.imp.msvcrt.dll_wcslen]
cmp word [esi], bx
pop ecx
mov dword [ebp - 0x28], eax
je 0x1004fc9
cmp eax, 4
jbe 0x1004ea7
mov edi, 0x10014d8
lea eax, [esi + eax*2 - 8]
push edi
push eax
call dword [sym.imp.msvcrt.dll__wcsicmp]
test eax, eax
pop ecx
pop ecx
je 0x1004eb8
mov eax, dword [ebp - 0x28]
cmp eax, 0xff
ja 0x1004e9b
push edi
jmp 0x1004eac
mov dword [ebp + 8], 0x6f
mov word [esi], bx
jmp 0x1004eb8
push 0x10014d8
lea eax, [esi + eax*2]
push eax
call dword [sym.imp.msvcrt.dll_wcscpy]
pop ecx
pop ecx
cmp word [esi], bx
je 0x1004fc9
lea eax, [ebp - 0x14]
push eax
call fcn.01003822
test al, al
je 0x1004fbe
xor eax, eax
push 7
lea edi, [ebp - 0x20]
stosd dword es:[edi], eax
push ebx
push dword [ebp - 0x14]
stosd dword es:[edi], eax
mov edi, dword [sym.imp.CRYPT32.dll_PFXExportCertStoreEx]
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 8]
call edi
test eax, eax
je 0x1004fae
push dword [ebp - 0x20]
call dword [sym.imp.msvcrt.dll_malloc]
cmp eax, ebx
pop ecx
mov dword [ebp - 0x1c], eax
je 0x1004f9c
push 7
push ebx
push dword [ebp - 0x14]
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 8]
call edi
test eax, eax
je 0x1004f7d
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x1004f7d
push ebx
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x20]
push dword [ebp - 0x1c]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1004f66
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x800006a8
mov dword [ebp + 8], eax
call fcn.0100187f
jmp 0x1004f73
push 0x800006a7
call fcn.0100187f
mov dword [ebp + 8], ebx
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1004f91
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x800006a8
mov dword [ebp + 8], eax
call fcn.0100187f
pop ecx
push dword [ebp - 0x1c]
call dword [sym.imp.msvcrt.dll_free]
jmp 0x1004fad
push 0x800006a8
mov dword [ebp + 8], 8
call fcn.0100187f
pop ecx
cmp dword [ebp - 0x14], ebx
je 0x1004fdb
push dword [ebp - 0x14]
call dword [sym.imp.msvcrt.dll_free]
jmp 0x1004fda
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 8], eax
jmp 0x1004fdb
push 0x800006a8
mov dword [ebp + 8], 0x57
call fcn.0100187f
pop ecx
cmp dword [ebp - 8], ebx
je 0x1004fea
push ebx
push dword [ebp - 8]
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
mov eax, dword [ebp + 8]
jmp 0x1004ff2
push 0x57
pop eax
pop edi
pop esi
pop ebx
leave
ret 8