Function at 0x408031
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x201c4
call fcn.0041ad80
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
xor edi, edi
mov dword [eax], edi
push edi
push edi
lea eax, [ebp - 0x1c4]
push 0x103
push eax
push 0xffffffffffffffff
push dword [ebp + 8]
push edi
push edi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0x88
lea eax, [ebp - 0xc0]
push edi
push eax
mov dword [ebp - 0x28], edi
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0xc0]
mov byte [ebp - 0xc0], 0x88
push edi
push eax
lea eax, [ebp - 0x1c4]
push eax
call dword [sym.imp.KERNEL32.dll_OpenFile]
mov ebx, eax
cmp ebx, edi
je 0x40833d
lea eax, [ebp - 0x28]
push edi
push eax
lea eax, [ebp - 0x201c4]
push 0x20000
push eax
push ebx
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x18], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40833d
push 0xc
lea eax, [ebp - 0x38]
push edi
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x20]
push edi
push edi
push eax
push 0xff
push ebx
call dword [sym.imp.imagehlp.dll_ImageEnumerateCertificates]
test eax, eax
je 0x40833d
cmp dword [ebp - 0x20], edi
je 0x40833d
lea eax, [ebp - 0x38]
push eax
push edi
push ebx
call dword [sym.imp.imagehlp.dll_ImageGetCertificateHeader]
test eax, eax
je 0x40833d
mov esi, dword [sym.imp.imagehlp.dll_ImageGetCertificateData]
lea eax, [ebp - 0x18]
push eax
push edi
push edi
push ebx
call esi
mov eax, dword [ebp - 0x38]
add eax, 0xd
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
cmp eax, edi
pop ecx
mov dword [ebp - 0x1c], eax
je 0x40833d
mov ecx, dword [ebp - 0x38]
add ecx, 0xd
push ecx
push edi
push eax
call sub.MSVCRT.dll_memset
mov eax, dword [ebp - 0x38]
add esp, 0xc
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x1c]
push edi
push ebx
call esi
test eax, eax
je 0x40833d
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x1c]
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 8], edi
movzx eax, word [esi + 6]
dec eax
mov dword [ebp - 0x10], edi
dec eax
jne 0x408319
push edi
push edi
push edi
push edi
push edi
push 0x10001
call dword [sym.imp.CRYPT32.dll_CryptMsgOpenToDecode]
mov ebx, eax
cmp ebx, edi
mov dword [ebp - 0x14], ebx
je 0x408319
push 1
push dword [esi]
add esi, 8
push esi
push ebx
call dword [sym.imp.CRYPT32.dll_CryptMsgUpdate]
test eax, eax
je 0x408312
lea eax, [ebp - 4]
mov esi, dword [sym.imp.CRYPT32.dll_CryptMsgGetParam]
push eax
lea eax, [ebp - 0xc]
push eax
push edi
push 5
push ebx
mov dword [ebp - 4], 4
call esi
test eax, eax
je 0x408312
cmp dword [ebp - 0xc], edi
mov dword [ebp + 8], edi
jbe 0x408220
lea eax, [ebp - 4]
push eax
push edi
push dword [ebp + 8]
push 6
push ebx
call esi
test eax, eax
je 0x408215
push dword [ebp - 4]
call dword [sym.imp.MSVCRT.dll_malloc]
pop ecx
mov dword [ebp - 0x2c], eax
lea ecx, [ebp - 4]
push ecx
push eax
push dword [ebp + 8]
push 6
push ebx
call esi
test eax, eax
je 0x408215
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x10], eax
inc dword [ebp + 8]
mov eax, dword [ebp + 8]
cmp eax, dword [ebp - 0xc]
jb 0x4081e0
lea eax, [ebp - 4]
mov dword [ebp - 4], 4
push eax
lea eax, [ebp - 0xc]
push eax
push edi
push 0xb
push ebx
call esi
test eax, eax
je 0x408312
cmp dword [ebp - 0xc], edi
mov dword [ebp + 8], edi
jbe 0x408312
lea eax, [ebp - 4]
push eax
push edi
push dword [ebp + 8]
push 0xc
push ebx
call esi
test eax, eax
je 0x4082f4
push dword [ebp - 4]
call dword [sym.imp.MSVCRT.dll_malloc]
pop ecx
mov dword [ebp - 8], eax
lea ecx, [ebp - 4]
push ecx
push eax
push dword [ebp + 8]
push 0xc
push ebx
call esi
test eax, eax
je 0x4082f4
push dword [ebp - 4]
push dword [ebp - 8]
push 0x10001
call dword [sym.imp.CRYPT32.dll_CertCreateCertificateContext]
mov ebx, eax
cmp ebx, edi
je 0x4082df
mov edx, dword [ebp - 0x10]
mov eax, dword [ebx + 0xc]
mov ecx, dword [edx + 4]
cmp dword [eax + 0x18], ecx
jne 0x4082d8
push ecx
push dword [edx + 8]
push dword [eax + 0x1c]
call sub.MSVCRT.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x4082d8
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebx + 0xc]
mov ecx, dword [ecx + 0xc]
cmp dword [eax + 4], ecx
jne 0x4082d8
push ecx
mov ecx, dword [ebp - 0x10]
push dword [ecx + 0x10]
push dword [eax + 8]
call sub.MSVCRT.dll_memcmp
add esp, 0xc
test eax, eax
je 0x408305
push ebx
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
cmp dword [ebp - 8], edi
je 0x4082f1
push dword [ebp - 8]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
mov dword [ebp - 8], edi
mov ebx, dword [ebp - 0x14]
inc dword [ebp + 8]
mov eax, dword [ebp + 8]
cmp eax, dword [ebp - 0xc]
jb 0x408249
jmp 0x408312
push ebx
call dword [sym.imp.CRYPT32.dll_CertDuplicateCertificateContext]
mov ebx, dword [ebp - 0x14]
mov dword [ebp - 0x24], eax
push ebx
call dword [sym.imp.CRYPT32.dll_CryptMsgClose]
push dword [ebp - 0x1c]
mov esi, dword [sym.imp.MSVCRT.dll_free]
call esi
cmp dword [ebp - 8], edi
pop ecx
je 0x408330
push dword [ebp - 8]
call esi
pop ecx
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x10]
mov dword [eax], ecx
mov eax, dword [ebp - 0x24]
jmp 0x40833f
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret