Skip to content

Instantly share code, notes, and snippets.

View dougpuob's full-sized avatar
:octocat:

Douglas Chen dougpuob

:octocat:
View GitHub Profile
import (
"bytes"
"fmt"
)
// Appends padding.
func pkcs7Pad(data []byte, blocklen int) ([]byte, error) {
if blocklen <= 0 {
return nil, fmt.Errorf("invalid blocklen %d", blocklen)
}
@dougpuob
dougpuob / settings.json
Last active February 23, 2018 03:07
[VSCODE] Customized highlight color
{
"workbench.iconTheme" : "material-icon-theme",
"window.zoomLevel" : 1,
"editor.mouseWheelZoom" : true,
"workbench.colorCustomizations": {
"editor.selectionBackground" : "#01AAAAAA",
"editor.selectionHighlightBackground": "#01AAAAAA",
"editor.findMatchHighlightBackground": "#A000AAAA"
},
"todohighlight.keywords": [
@dougpuob
dougpuob / CryptQueryObject.c
Created May 16, 2017 06:14
How To Get Information from Authenticode Signed Executables
/*
# How To Get Information from Authenticode Signed Executables
https://support.microsoft.com/en-us/help/323809/how-to-get-information-from-authenticode-signed-executables
## Summary
You can use the WinVerifyTrust() API to verify an Authenticode signed executable.
Although a signature is verified, a program may also have to do the following:
@dougpuob
dougpuob / GetEcRamBaseAddressFromRegistry.c
Last active June 20, 2017 06:15
Early exit with GetEcRamBaseAddressFromRegistry() function
BOOLEAN GetEcRamBaseAddressFromRegistry()
{
ULONG EcRamBase;
gEcRamBaseAddress = GetEcRamBaseDefaultValue();
if (0 != gEcRamBaseAddress)
{
return TRUE;
}
else
@dougpuob
dougpuob / Windows Kits_10_build_universalDDIs_x64_UniversalDDIs.xml
Last active July 12, 2017 08:29
C:\Program Files (x86)\Windows Kits\10\build\universalDDIs\x64\UniversalDDIs.xml
<?xml version="1.0" encoding="utf-8"?>
<API_WHITELIST xmlns:api="http://microsoft.com/schemas/Windows/SDK/APIDescription" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<APIs>
<API Name="?GetSchema@?QIResourceLinkBuilder@Build@Resources@Microsoft@@PriSectionBuilder@234@UEBAPEAVHierarchicalSchemaSectionBuilder@234@XZ" ModuleName="appxapplicabilityengine.dll" />
<API Name="___lc_codepage_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="___lc_collate_cp_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="___lc_locale_name_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="___mb_cur_max_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="___mb_cur_max_l_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="__abi_details::__abi_cast_Object_to_String" ModuleName="wincorlib.dll" />
@dougpuob
dougpuob / Windows Kits_10_build_universalDDIs_x86_UniversalDDIs.xml
Created July 12, 2017 08:31
C:\Program Files (x86)\Windows Kits\10\build\universalDDIs\x86\UniversalDDIs.xml
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="utf-8"?>
<API_WHITELIST xmlns:api="http://microsoft.com/schemas/Windows/SDK/APIDescription" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<APIs>
<API Name="?GetSchema@?QIResourceLinkBuilder@Build@Resources@Microsoft@@PriSectionBuilder@234@UBEPAVHierarchicalSchemaSectionBuilder@234@XZ" ModuleName="appxapplicabilityengine.dll" />
<API Name="___lc_codepage_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="___lc_collate_cp_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="___lc_locale_name_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="___mb_cur_max_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="___mb_cur_max_l_func" ModuleName="api-ms-win-crt-locale-l1-1-0.dll" />
<API Name="__abi_details::__abi_cast_Object_to_String" ModuleName="wincorlib.dll" />
@dougpuob
dougpuob / Result_Of_SetupDiGetClassDevs()_and_SetupDiEnumDeviceInfo()_functions.log
Created July 17, 2017 05:13
Result_Of_SetupDiGetClassDevs()_and_SetupDiEnumDeviceInfo()_functions.log
// HDEVINFO devs = SetupDiGetClassDevs(NULL, NULL, NULL, DIGCF_ALLCLASSES);
// if (NULL != devs)
// {
// DWORD devIndex = 0;
// SP_DEVINFO_DATA devInfo;
// wchar_t wszBuffer[MAX_DEVICE_ID_LEN];
// devInfo.cbSize = sizeof(devInfo);
// for (devIndex = 0; SetupDiEnumDeviceInfo(devs, devIndex, &devInfo); devIndex++)
// {
// }
@dougpuob
dougpuob / License_Agreement_AOMEI_Backupper_Full_v4.0.4.0.txt
Created July 18, 2017 02:06
License_Agreement_AOMEI_Backupper_Full_v4.0.4.0.txt
AOMEI Backupper Standard
END-USER LICENSE AGREEMENT
Copyright (c) 2009-2017 AOMEI Technology Co., Ltd, All rights reserved.
IMPORTANT-READ CAREFULLY: This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) later referred to as "LICENSEE" and AOMEI Technology Co., Ltd. later referred to as "AOMEI Technology Co., Ltd" for the software product AOMEI Backupper later referred to as "SOFTWARE". By installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, do not purchase, install or use the SOFTWARE. Installing and using the SOFTWARE signifies acceptance of these terms and conditions of the license.
AOMEI Technology Co., Ltd may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. The furnishing of this document does not give you any license to these patents, trademarks, copyri
@dougpuob
dougpuob / License_Aggreement_EaseUS_Partition_Master_v12.0.0.0.txt
Created July 18, 2017 05:21
License_Aggreement_EaseUS_Partition_Master_v12.0.0.0.txt
EaseUS® Partition Master Free Edition
End-User License Agreement
Copyright © 2004-2017 EaseUS. All rights reserved.
Please read this document carefully. This is a legal agreement between you (either an individual or an entity) and EaseUS, the developer of EaseUS Partition Master. This agreement supersedes any prior version license and governs your use of the software.
EaseUS exclusively owns all copyrights of EaseUS Partition Master Free Edition.
EaseUS Partition Master Free Edition may be freely distributed, if the distribution package is not modified. No person may charge a fee for the distribution of EaseUS Partition Master Free Edition without written permission from the copyright holder.
@dougpuob
dougpuob / [CodeReview] _ZipZipMgr_CalcLocalFileEntrySize().c
Last active July 27, 2017 06:24
[CodeReview] _ZipZipMgr_CalcLocalFileEntrySize()
// -------------------------------------------------------------------------------------------
// Original
// -------------------------------------------------------------------------------------------
static
size_t
_ZipZipMgr_CalcLocalFileEntrySize(
IN ZIPMGR_MODULE* pThis,
IN ZIPMGR_LOCAL_FILE_ENTRY* pLocalFileEntry
)
{