Skip to content

Instantly share code, notes, and snippets.

View gocha's full-sized avatar

gocha gocha

View GitHub Profile
@gocha
gocha / SFC Ganbare Goemon 3 TAS Route Plan.md
Last active February 11, 2024 15:43
SFC Ganbare Goemon 3: TAS Route Plan.md
@gocha
gocha / chdpm_bruteforce.hsp
Last active December 13, 2022 17:05
chdpm 命令の総当り実行による暗号化DPMの読み込み (HSP 3.7 β4)
; HSP 3.7 β4 実行ファイルから切り出した暗号化済み DPM からファイルを保存する
#bootopt notimer 1
dialog "dpm", 16
if stat == 0: end
dpmpath = refstr
dpmkey = 1
exist dpmpath
@gocha
gocha / NetServiceRepository.Windows.cs
Last active February 15, 2022 10:48
winsock2: Get port number and other information from /etc/services by service name (public domain)
// サービス名を使用して /etc/services からポート番号などを取得する
//
// Using C# to reference a port number to service name - Stack Overflow
// https://stackoverflow.com/questions/13246099/using-c-sharp-to-reference-a-port-number-to-service-name
//
// AccessViolationException when calling Marshal.PtrToStructure - Stack Overflow
// https://stackoverflow.com/questions/3618154/accessviolationexception-when-calling-marshal-ptrtostructure
using System;
using System.Net;
@gocha
gocha / DirectMusic_Producer_9_Setup_Troubleshooting.md
Last active February 4, 2022 00:36
Troubleshooting: The installation screen of DirectMusic Producer 9 does not appear.

There was a problem where the DirectMusic Producer 9 setup.exe screen did not appear and the installation could not continue. The same problem can also occur with the same format installer created by InstallShield 5.

Check the following points:

  1. If the setup.exe process exists but the screen does not appear, check the "Analyze Wait Chain" of setup.exe in Task Manager and try to kill the process that is preventing it from starting
    • In my case, nvcontainer.exe was preventing setup.exe from starting, so I stopped the NvContainerLocalSystem service
  2. If the startup screen reaches 100 % and setup.exe exits without showing the next screen, check to see if there are any fonts with long names installed on your system (longer than 15 characters might cause problems, maybe)
  • Such a font will cause a buffer overflow in the callback function of the EnumFontFamilies API, which will break the stack. Then _INS576._MP will crash with error 0xc0000005 (ACCESS_VIOLATION), and the next screen will not be displaye
@gocha
gocha / Out-ScreenImage.ps1
Created January 20, 2022 07:48
スクリーンショットをファイルに保存するコマンド (Command to save a screenshot to a file)
<#
.SYNOPSIS
スクリーンショットをファイルに保存します。
.DESCRIPTION
プライマリ ディスプレイ全体のスクリーンショットをファイルに保存します。
高 DPI 環境では、正しい範囲をキャプチャすることができません。
.PARAMETER FilePath
スクリーンショットの保存先ファイル名。ファイルの形式は PNG です。
@gocha
gocha / file-example.html
Created July 7, 2021 02:34
MDN: Complete file example (Adapted for IE11)
<!--
Removed ES2015 syntaxes for Internet Explorer 11: https://mdn.github.io/learning-area/html/forms/file-examples/file-example.html
<input type="file"> - HTML: HyperText Markup Language | MDN https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file
-->
<!DOCTYPE html>
<html>
<head>
<title>Complete file example</title>
<style>
html {
@gocha
gocha / Export-WebPageAsPdf.ps1
Created March 24, 2021 08:53
ウェブページを PDF に保存 (Headless Chrome を使用)
<#
.SYNOPSIS
ウェブページを PDF に保存
.DESCRIPTION
Headless Chrome を使用してウェブページを PDF に保存します。
.PARAMETER Path
出力される PDF ファイルのパス。
@gocha
gocha / DelegateLogger.cs
Created April 22, 2020 02:08
指定された ILogger に出力を委譲するだけの不毛な ILogger<TCategoryName> 実装
using Microsoft.Extensions.Logging;
using System;
namespace Stupid
{
public class DelegateLogger<TCategoryName> : ILogger<TCategoryName>
{
private readonly ILogger _logger;
public DelegateLogger(ILogger logger) { _logger = logger; }
@gocha
gocha / AzResourceGraph-Get-AlertLogs.txt
Last active January 20, 2020 09:31
Azure Resource Graph: Querying alert logs like Azure Monitor
AlertsManagementResources
| where type =~ 'microsoft.alertsmanagement/alerts'
| where properties.essentials.startDateTime >= datetime('2020-01-01T00:00:00+0900') and properties.essentials.startDateTime <= datetime('2020-01-20T00:00:00+0900')
| order by todatetime(properties.essentials.lastModifiedDateTime) desc
| project name, properties.essentials.severity, properties.essentials.targetResourceGroup, properties.essentials.targetResourceName, properties.essentials.targetResourceType, properties.essentials.signalType, properties.essentials.startDateTime, properties.essentials.description
| limit 50
@gocha
gocha / クライアント証明書作成.ps1
Last active October 9, 2019 10:52
開発用のルートCA証明書とクライアント証明書を一括作成する
# 方法: 開発中に使用する一時的な証明書を作成する | Microsoft Docs
# https://docs.microsoft.com/ja-jp/dotnet/framework/wcf/feature-details/how-to-create-temporary-certificates-for-use-during-development
$ErrorActionPreference = "Stop"
#-------------------------------------------------------------------------------
# ルート証明書を作成する
$rootCertPassword = Read-Host -Prompt "CA 証明書の秘密キー" -AsSecureString