.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Decoding 3DES encoded viewstate in stack dump

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

In my Application_Error handler in global.aspx, I email myself some information if my web app faults on my remote server. Included in the information I email myself is my viewstate. I would really like to decode the viewstate so I can get a better picture of what is going on at the time of the fault.

The problem is that my viewstate is 3DES encoded. In my web.config I have a <machineKey> tag, with a fixed validationKey, descryptionKey, and validation="3DES". So in theory I can base-64 decode my viewstate and decrypt it with my validationKey (?). I'm having a problem finding the right tools to do this. I've found some viewstate decoders but they either fail (presumably because it's 3DES encrypted?) or spit out some data that I don't know how to 3DES decrypt.

What is the encoding/encrypting sequence here, does the server first encrypt then base-64 encode? So to reverse I need a base-64 decoder that won't choke and then some kind of 3DES decryption tool for the result, does anyone have any suggestions? Or is there some sourcode code I can use to cobble together a little decrypter of my one?

View Complete Post

More Related Resource Links

Stack Dump generated on the db and SQL tipped over DBCC CHECKDB came out clean

We have Profile db for sharepoint 2010 and the SQL tipped over just before which it generated the below dump. The DBCC CHECKDB on the database came out clean. The SQL Server is SQL 2008 SP1 CU5 and the memory on the server is 32GB with max. for SQL Server being 26 GB.  What could have caused this? There is nothing in the error log prior to this dump. name                                minimum     maximum     config_value run_value ----------------------------------- ----------- ----------- ------------ ----------- access check cache bucket count     0           65536       0            0 access check cache quota            0           2147483647  0            0 Ad Hoc Distributed Queries          0           1           0

Calling Procedure from ADO.NET with a Name That Starts with Sys Causes SQL Server Stack Dump


After the better part of 5 hours, I finally figured out why I was getting this SqlException:  {"A severe error occurred on the current command.  The results, if any, should be discarded.\r\nA severe error occurred on the current command.  The results, if any, should be discarded."}

If you call a stored procedure that *starts* with Sys (e.g. dbo.SystemConfigurationUpdate, dbo.SystolicPatientRecords, or SyscoFoodsPurchase) and at least one specified variable is a Table Value Parameter, SQL Server 2008 stack dumps (below).

If you add anything to the front of the Sys, it works fine (e.g. mSysConfigUpdate or mSys).


--- STACK DUMP ---

***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\LOG\SQLDump0037.txt

SqlDumpExceptionHandler: Process 54 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

* *******************************************************************************



*   11/02/10 10:25:14 spid 54



*   Exception Address = 000000000105A8B0 Module(sqlservr+00000000002DA8B0)

*   Exception Code    = c0000005 EXCEPTION_ACCESS_VIOLATION

*   Access Violation occu

Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLDump0026.txt

Hello all,

I found on one of our server restart automatically after show stack dum error.
some part of log is given below any help will be appreciate.

MemoryLoad = 46%                    
Total Physical = 4094 MB            
Available Physical = 2172 MB        
Total Page File = 5971 MB           
Available Page File = 4226 MB       
Total Virtual = 2047 MB             
Available Virtual = 306 MB          
**Dump thread - spid = 51, PSS = 0x3D859580, EC = 0x3D859588                                                    
***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLDump0026.txt             
* *******************************************************************************                               
* BEGIN STACK DUMP:                                                                                             
*   07/21/09 11:05:01 spid 51                                                                                   
* e

Encoding en Decoding HTML



I stored in a database a ntext "<b>Hello</b>";

But when  I read it from the database I see <b>Hello</b> instead of Hello.

In the html source I see this: &lt;b&gt;Hello&lt;/b&gt;

Any Idea?


Composite Control which contains arbitrary content defined in .aspx of parent and thier ViewState


I want to write own control which can contain other. And I want to define content of the control in the .aspx file where the control is defined. I have written such control. But now I have issue with ViewState of inner controls of my control. The following samle illustrates the issue: I defined two asp:DropDownList ID="ddl1" and ID="ddl2" One of them is inside of my control and other is outside. When posback is occurred asp:DropDownList ID="ddl1 loses state and becomes empty. How to say ASP.net to store state of inner controls defined by this way?


<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyControl.ascx.cs" Inherits="DynamicControls.Controls.MyControl" %>

<div class="box">
    <div class="Header-Left">
        <div class="Header-Right">
            My Control
    <div class="Content">
        <asp:PlaceHolder ID="contentPlace" runat="Server" />

Windows with C++: Decoding Windows Vista Icons with WIC


In this month's installment, Kenny Kerr sings the praises of the new Visual C++ 2008 Feature Pack, which brings modern conveniences to Visual C++.

Kenny Kerr

MSDN Magazine June 2008

Bugslayer: Mini Dump Snapshots and the New SOS


In debugging some large Microsoft® . NET Framework-based ap-plications over the last few months, I've been spending more time looking at mini dumps than at live processes. This is mainly because in those large applications problems surface when the apps are running in production and not on test systems.

John Robbins

MSDN Magazine March 2005

EntityDataSource Where Clause in ViewState?



I have ListView/DataPager on the page that I use together with an EntityDataSource, because I want to filter the results, I programmatically set the Where-property and the WhereParameters of the EntityDataSource.

But: After the Paging-Postback the Value for Where is gone (empty string) whereas the WhereParameters are still there. Isn't the where value saved in ViewState as well? Can I change this behaviour?

Thanx, S.

Custom controls and ViewState management issue



I want to know that when we create custom controls, then is there State Management through ViewState done automatically or we have to handle it explicitely ?Since i have created Custom Controls that is behaving as if it is not maintaining its state on PostBack.

encoding/decoding a string to/from bitmap


I have two methods:

Encode - takes a string, converts it to array of bytes, uses bytes to specify colors, creates a color and sets a pixel based on bytes

Decode - takes a pixel, retrieves color (R,G,B) bytes and converts them to characters, that produces a string which was previously encoded

I'm using two for loops (img height/width) to specify position and access pixels

The issue is that once display (Control Panel\Appearance and Personalization\Display) changes to anything other then "Smaller - 100%",
bytes have different values during decoding, thus different string is produced (corrupted).

If the setting is set to "Smaller - 100%" the results are normal.

What can I do to avoid that problem?

Thanks in advance

viewstate in a custom control

I am having issues with a simple custom control that I created by subclassing the hyperlink control.

I wanted to create a control called BackLink that would automatically grab the referring url to the page when it first loads the page. and on postbacks it would continue to use the initial value

I am able to capture and set the navigateurl property when the containing page first loads just fine but if the page submits to itself, the control loses its navigateurl value.

I have the enableviewstate property set in the aspx page but it doesn't seem to want to keep its viewstate

Am I missing something? Do I have to manage my own ViewState?

here is my code

public class BackLink : System.Web.UI.WebControls.HyperLink

public BackLink()
this.Text = "<< back";

protected override void Render(HtmlTextWriter output)
if (this.Page.IsPostBack == false)
//save back url
Uri _backUri = this.Context.Request.UrlReferrer;

if(_backUri != null) this.NavigateUrl = _backUri.PathAndQuery;

else this.NavigateUrl = "/";

Video: SharePoint 2010 Technology Stack

This video describes the technology stack upon which SharePoint 2010 is built. (Length: 2:47)

How to collapse the expanders dynamically in a stack panel?

Hello, please help me in this scenario: I have created 1 stack panel & dynamically i have added the expanders. How to collapse the expanders when 1 expander is expanded??? i want 1 expander to be expanded at a time, when i expand 1 expander, automatically other all expanders should be in collapsed state??

.Net 4 - Generate dump file, improved debuging

Hi, For the system we are developing, we need to be able to generate a crash dump file in case things go bad. The application is being implemented using .Net 4 C# WPF. In the past (.Net 3.5) we were using a number of methods from the "dbghelp.dll" and "kernel32.dll" unmanaged dlls in order to generate a crash dump and WinDbg in order to investigate it. I was wondering if .Net 4 (and Visual Studio 2010) brought anything that would help us stay away from unmanaged code and make the dump file investigation easier (especially when multithreading operations are involved). Any suggestions and links would be appreciated. Thank you for your time, Cristian
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend