Monday, October 18, 2010

DLL calling convention and name of the modification in


Calling convention (Calling Convention) is the programming language in order to achieve the function call and the establishment of a protocol. This agreement provides the function of the parameters of language transmission, parameters are variable and stack who deal with such issues. Different language defines different calling convention.

In C + +, in order to allow operator overloading and function overloading, C + + compilers are in accordance with certain rules rewritten for each entry point symbol name, in order to allow the same name (with different parameter types or different scope) more a usage, but it will not break the existing C-based linker. This technique is often called the name of adaptation (Name Mangling) or the name of the modification (Name Decoration). Many C + + compiler vendors chose their name modification program.

Therefore, in order to make other language modules (such as Visual Basic applications, Pascal or Fortran applications, etc.) can call C / C + + written DLL function, you must use the correct calling convention for exported functions, and do not let the compiler on the function you want to export any names modified.

1. Calling convention (Calling Convention)
Calling convention to a decision to transfer function parameters and the stack when the stack order (by the caller or callee pop the argument stack), and the compiler used to identify the name of the function name modification agreement and other issues. In Microsoft VC + + 6.0 is defined in the following several calling conventions, we will combine the assembly language to 11 of them:

1, __cdecl

__cdecl is the C / C + + and MFC programs use the default calling convention, you can also add in the function declaration to manually specify __cdecl keyword. Use __cdecl convention, the function parameters in accordance with the order from right to left stack, and call the function are the parameters from the stack to clean up the stack pop. Therefore, the realization of a variable function of the parameter can only use the calling convention. Since each function using the __cdecl convention should clean up the stack contains the code, something the size of the executable file will be bigger. __cdecl can be written as _cdecl.

The following specific examples will be analyzed through a __cdecl convention:

In VC + +, create a new Win32 Console project, named cdecl. The code is as follows:

int __cdecl Add (int a, int b); file / / function declaration

void main ()

(

Add (1,2); file / / function call

)

int __cdecl Add (int a, int b) file / / function implementation

(

return (a + b);

)

Department disassembled code function call is as follows:

; Add (1,2);

push 2; parameter stack from right to left, first pressed into 2

push 1; pressed into a

call @ ILT +0 (Add) (00401005); call the function to achieve

add esp, 8; clear from the function call stack

2, __stdcall

__stdcall calling convention used to call the Win32 API function. Agreement with __stdcal, the function parameters in accordance with the order from right to left stack, the called function returns transport parameters of the stack before the clean-up, the number of fixed-function parameters. As the body of the function itself, the number of parameters that pass came, so the called function can return to the previous instruction with a ret n pass parameters directly to clean up the stack. __stdcall can be written as _stdcall.

Or the example of the __cdecl convention replaced __stdcall:

int __stdcall Add (int a, int b)

(

return (a + b);

)

Function call Department disassembled code:

; Add (1,2);

push 2; parameter stack from right to left, first pressed into 2

push 1; pressed into a

call @ ILT +10 (Add) (0040100f); call the function to achieve

Functions is part of the anti-assembly code:

; Int __stdcall Add (int a, int b)

push ebp

mov ebp, esp




[Next]



sub esp, 40h

push ebx

push esi

push edi

lea edi, [ebp-40h]

mov ecx, 10h

mov eax, 0CCCCCCCCh

rep stos dword ptr [edi]

; Return (a + b);

mov eax, dword ptr [ebp +8]

add eax, dword ptr [ebp +0 Ch]

pop edi

pop esi

pop ebx

mov esp, ebp

pop ebp

ret 8; clear stack

3, __fastcall

__fastcall convention used for very high performance requirements of the occasion. __fastcall convention will function from the left of the first two size not larger than 4 bytes (DWORD) of the parameters are placed in ECX and EDX registers, the rest of the parameters are still stacking transmission from right to left, the called function returns transmission parameters prior to clean up the stack. __fastcall can be written _fastcall.

Is still similar to the example, then the function calling convention for the __fastcall, increase the number of function parameters 2:

int __fastcall Add (int a, double b, int c, int d)

(

return (a + b + c + d);

)

Function call part of the assembly code:

; Add (1, 2, 3, 4);

push 4; two parameters after the stack from right to left, first pressed into 4

mov edx, 3; the int type 3 into edx

push 40000000h; pressed into double type 2

push 0

mov ecx, 1; the int type 1 into ecx

call @ ILT +0 (Add) (00401005); call the function to achieve

Functions is part of the anti-assembly code:

; Int __fastcall Add (int a, double b, int c, int d)

push ebp

mov ebp, esp

sub esp, 48h

push ebx

push esi

push edi

push ecx

lea edi, [ebp-48h]

mov ecx, 12h

mov eax, 0CCCCCCCCh

rep stos dword ptr [edi]


pop ecx

mov dword ptr [ebp-8], edx

mov dword ptr [ebp-4], ecx




[Next]



; Return (a + b + c + d);

fild dword ptr [ebp-4]

fadd qword ptr [ebp +8]

fiadd dword ptr [ebp-8]

fiadd dword ptr [ebp +10 h]

call __ftol (004011b8)

pop edi

pop esi

pop ebx

mov esp, ebp

pop ebp

ret 0Ch; clear stack

Keyword __cdecl, __stdcall, and __fastcall can be added to the output of the function before, you can also build environment Setting ...-> C / C + + -> Code Generation option. Their corresponding command-line parameters are / Gd, / Gz and / Gr. The default state / Gd, that is __cdecl. When added to the output function keyword before the build environment of choice and not at the same time, a direct increase in output before the keyword function effectively.






Recommended links:



Command LINE "" and "-" symbol represents the meaning of



hp Pavilion dv6000 notebook reviews pics specs



ASF to MPG



Picked Business Databases And TOOLS



MKV to WMV



Wave of mergers BI have a happy life



Top Registry TOOLS



GIS integration OF the western expedition geographic resources



Recommend Tools And Editors



MP4 To WMP



Beijing: refused to sign the contract is terminated will receive compensation



Five-stroke Input Method Is Not Just Pole



LIVEMOTION font production: shadow word



Ali power to help her mother five years beyond the traditional media blog



Dell's green innovation-up plastic bag recycling to say "no"



Optional U disk watch "shell" scam



Sunday, October 10, 2010

MAC and IP addresses tied to theft are no longer



In network management, IP address fraudulent usage is frequent, 涓嶄粎 normal use of the network impact, and because the address of the unauthorized use of authority is often high, thus causing a large number of users of economic loss and potential security hidden. What measures have the greatest possible to avoid such phenomena happen? In order to prevent IP address theft, you can assign the proxy server IP address, the IP address and network card address binding.

For dynamic allocation IP, do a DHCP server to bind the user network card MAC address and IP address, and then set according to different IP rights. For static IP, if using three switches, you can switch ports on each IP address so limited, if someone changes their IP address, then his network was unreasonable. We are now bound for the static IP address to explain an example.

View Network Card MAC Address

Click on "Start", select "Run" and then enter winipcfg command inside, which you can find out your network card address.

Record before the proxy server, allowing network administrators to a static IP address of your Internet records and the address of the computer's network card bundle. Specific command is:

ARP-s 192.168.0.4 00-EO-4C-6C-08-75

This will be your static IP address of the Internet (assuming that 192.168.0.4) and network card address (assuming a 00-EO-4C-6C-08-75) bound with a computer, even if your IP address stolen 192.168.0.4 can not access through a proxy server. One should note that this command only in the LAN Internet proxy server useful, but also a static IP address, like normal dial-up Modem is a dynamic IP address on does not work.

ARP function of each parameter Introduction

ARP 顨?s 顨?顨?d 顨?顨?a 顨?br />
-S - to the corresponding IP address and physical address of the bundle.

-D - delete the given IP address and physical address of the bundle.

-A - Arp protocol by querying the table to display the IP address and physical address corresponding to the situation.

As a network manager, if the MAC address and IP on the binding flexibility in the use of skilled, it will create a very safe environment conducive to security risks can be greatly reduced.







相关链接:



After the way you do business You're considering?



"Mount & Blade" combat experience



World Rally 3 cheat



Beijing-Shenyang Expressway: Breaking the "separatism," the first



Launchers AND Task Managers Wizard



Ministry Of Information Industry, Dalian Today On The AVS Will Determine The Acceptance Of IPTV Comm



avi to Mp4 converter with style



MOV to MPEG4



Premier Web Servers



AVI To MOV



DivX TO 3GP



Three invincible Dharma of the Three Kingdoms 10



VIGILANCE "Fantasy Westward Journey" Daohao Trojan havoc



Saturday, September 25, 2010

Qi Hu said the accusations of its being linked to horse Rising false announcement



July 9 afternoon news, odd tiger has just issued a statement, for the Rising on the "odd tiger was linked to horse," the notice, a statement was false Qihoo network information, find it remarkable is not related to Standard loopholes were not linked to horses.

This afternoon, the Rising's public announcements, said that under the Rising "Cloud security" system of monitoring, hackers are currently using Microsoft's latest video crazy loopholes for large websites linked to Malaysia, July 8 day total of 377 million Internet users were the Class web page linked to horse attacks, seized a total of 760 000 linked to horse websites, including "odd tiger net" part of the page is also linked to hackers using the latest vulnerabilities horse.

Qihoo denied, said the announcement Rising false.

The following is the odd tiger Statement:

First, the odd tiger website without any flaws and have not been "hanging horse"; Rising to hang horse news broadcast was false;

Secondly, the reason will be guilty of such company Rising junior mistake, because the company has not done searching, no search technology. Qihoo site is a well-known search engine of community service. Rising published page is the odd tiger a community search engine search results pages show, this is a blog from the Internet page (link to: 123w.qihoo.com/frame/q2431011, 7f9145, 2367_15523.html users to prevent misuse Click the address prior to the increase of the number "123"). This was "horse hung" the search results page in Google, Baidu, and other famous search engine results page, is not uncommon;




Photo caption: 360 security guards were always able to intercept "horse hung" the blog page

Third, the odd tiger net relevant departments have recognized the 360 Security Center, the domain name http://media.51bo.com/uc/media/play.aspx?UID=99866&MID=13105 the final page has indeed been implanted malicious code, but the 360 security guards always be able to block the domain. 360 security guards for all the users will not be a threat to the pages linked to the horse.

Qihoo Network

July 9, 2009







Recommended links:



Comment Active X



AVI to iPod



Hot Firewall And Proxy Servers



3GP to MPEG



MKV To VOB



Netac flash news Huaqi patent dispute settlement REACHED in equal



Performance Of The Interview Should Be Noted That Several Principles



Apple iphone software



Baidu pressed into the C2C site TAOBAO payment or ism



Customer is not his wife is a lover of God is



My Gmail so cool, custom domain Gmail login



Cottage in China



3DMax done using NURBS baseball bat



World Cup counterparts: Illustrator drawing three cases of Football



Friday, September 17, 2010

US-listed Chinese stocks 3G


Yesterday, the Chinese 3G chip development of information technology research and development company listed on the official at Nasdaq, becoming the first Chinese 3G market in the United States the concept of enterprise.

It is understood that the development of information technology available in the Nasdaq, about 800 million American Depository Receipts (ADS), equivalent to about 3 per ADS shares of common stock after the stock market symbol "SPRD", the opening price of 14.20 yuan, its first day of listing to raise funds of about 124 million U.S. dollars. Documents, developing information technology in the past four years, almost all the average revenue growth of 300% or more.







Recommended links:



Lists AUDIO Speech



Ghost 20 Little-known Practical Parameters



Articles ABOUT Reference Tools



Registry Combat Collection - "Operation" Change Collection



Computer fraud, although he is alleged to have bought



Trade more "smoothly" TO prevent the risk of more



Youtube To Mpg



News About Astronomy



SAP SALES drop turmoil spread to China, CEO to resign



Town and only "limited earnings"



windows media player m4v



Wmv to flv converter free



Robin Li: PPC Will Not Hurt The User Experience



rmvb ON ps3



Tuesday, July 20, 2010

TOM parted ways with the ICQ IM New aborted last minute



Only a thin icq signed tom and cooperation between the sudden declaration of the end, after the testing stage of the two sides to jointly develop real-time communications products, will therefore no opportunity to officially come out. Tom-line has been rumored to have a new choice.

tom line into im (instant messaging) market activities have begun, icq im famous as the software industry, a long time ambition to enter the Chinese market. However, frequent high-level visits between the two sides, and expand technical cooperation, the upcoming contract negotiations on the eve of a sudden came the end of the message. Yesterday, tom-line there was no reason to break up journalists.







Recommended links:



How to convert m4a to m4r



DRM Removal Software



Games Simulation Infomation



Convert aac to mp3



Ministry Of Finance Denied The Procurement Of The Green Dam Said The Ministry Of Industry Is The Onl



Perpetually Cell Phone 3G2 Converter



SuperBurner MP4 CONVERTER



free DOWNLOAD mp4 to 3gp converter



E-Commerce comparison



Msvideo



PSPVC :: PSP Video Converter



DVD Audio Ripper



[Aion] Korean Clothing And Equipment Leveling Frenzy 1.2 Perfect



Wizard Multimedia Creation Tools



JSN-1 (A) Digital Switching Introduction



Friday, July 9, 2010

Lohan DVD to DivX

Lohan DVD to DivX - A fast video to DVD VOB converter which can convert and burn AVI, MPG, MPEG 1/2/4, WMV, MOV, MP4, RM, RMVB, DivX, Xvid, ASF, 3GP, Youtube FLV Converter easily. With this DVD VCD SVCD converter, you will know how to make a DVD video. You can use it to convert and burn DivX, Xvid, AVI, MPG, MPEG 1/2/4, WMV, MOV, MP4, RM, RMVB files to DVD with chapter Menu. With that, you can convert downloaded videos and burn files into DVD, which means Internet become the storehouse of your home theater! Get Free download now!

Lohan DVD to DivX - What a powerful and attractive AVI, MPG, MPEG 1/2/4, WMV, MOV, MP4, RM, RMVB, DivX, Xvid, ASF, 3GP, Youtube FLV converter. This software can burn DivX to DVD and convert DivX to VOB and finish all your tasks with the fastest speed possible and the best quality available. No one will ask how to make a DVD video anymore once they try this great DivX to VOB converter. We highly recommend this program because we think it will make your multimedia life a lot easier and more enjoyable. It allows you to specify NTSC or PAL format, adjust 4:3 or 16:9 video aspect, and burn either DVD disc or ISO file. By setting bitrate and framerate, you can get excellent quality on TV screen. Just free download and enjoy it right now!



Recommand Link:



Recommend Languages Education



Apple tv



Xion Audio Player



CoreSoft Video Converter



Lenogo DVD to Zune Converter four



Perpetually Cell Phone 3G2 Converter



Youtube to Xbox 360 Store



Infomation Computer Education



Strategy And War Games Directory



ts to dvd



Youtube Movie To DVD Mixer



free download converter mp4 to 3gp



Youtube Movie to MPG Help



How-to DVD to MOBILE



Mp4 to 3gp converter



Explosion DVD Ripper Platinum



Friday, June 25, 2010

Youtube Movie to 3G2 Popular

Hot popluar youtube video Converter + download + player tool. With YouTube tool you can also convert downloaded YouTube videos to a format compatible with your favorite portable device; including - iPod Video, iPod Touch, iPod Nano, iPhone, Zune, PSP, as well as video capable MP3 players, video capable mobile phones, and Pocket PC, And finally... YouTube tool's embedded player will allow you to watch all your favorite YouTube videos off-line. So now you can enjoy any .flv and .swf videos anytime!
Supports YouTube video or any .flv and .swf file as input file. Supports not only YouTube video, but also various video formats as input file, including avi, DivX, XviD, rm, rmvb, MOV, MPEG, WMV. Supports a wide variety of output file format., including avi, DivX, XviD, rm, rmvb, MOV, MPEG, WMV. Provides various profiles, these profiles can meet the needs of most people. - is the most powerful YouTube assistant on the planet.



Recommand Link:



Top E-Mail List MANAGEMENT



HD to Sony NWZ-S544 conversion



AlltoDVD MPEG to AVI



HD to Sony NWZ-S739F converter



DVD Ripper for Mac



WorldCup DVD to SWF



Youtube Movie to VCD Today



Reviews Games Sports



IUoysoft Zune Movie/Video Converter



Christmasgift AVI To FLV



Recommend Covert Surveillance



Apple PS3 Apple TV Encode



utube