quarta-feira, 14 de novembro de 2012


SQL Script to Shrink all Databases Log Files in Microsoft SQL Server (2000, 2005 and 2008)

I recommend set recovery model to simple before do this (script here). Note, this will purge all database logs.

SQL 2000:



declare @ssql nvarchar(4000)
set @ssql= '
        if ''?'' not in (''tempdb'',''master'',''model'',''msdb'') begin
        use [?]
        declare @tsql nvarchar(4000) set @tsql = ''''
        declare @iLogFile int
        declare LogFiles cursor for
        select fileid from sysfiles where  status & 0x40 = 0x40
        open LogFiles
        fetch next from LogFiles into @iLogFile
        while @@fetch_status = 0
        begin
          set @tsql = @tsql + ''DBCC SHRINKFILE(''+cast(@iLogFile as varchar(5))+'', 1) ''
          fetch next from LogFiles into @iLogFile
        end
        set @tsql = @tsql + '' BACKUP LOG [?] WITH TRUNCATE_ONLY '' + @tsql
        --print @tsql
        exec(@tsql)
        close LogFiles
        DEALLOCATE LogFiles
        end'
exec sp_msforeachdb @ssql

SQL 2005:




declare @ssql nvarchar(4000)
set @ssql= '
        if ''?'' not in (''tempdb'',''master'',''model'',''msdb'') begin
        use [?]
        declare @tsql nvarchar(4000) set @tsql = ''''
        declare @iLogFile int
        declare LogFiles cursor for
        select fileid from sysfiles where  status & 0x40 = 0x40
        open LogFiles
        fetch next from LogFiles into @iLogFile
        while @@fetch_status = 0
        begin
          set @tsql = @tsql + ''DBCC SHRINKFILE(''+cast(@iLogFile as varchar(5))+'', 1) ''
          fetch next from LogFiles into @iLogFile
        end
        set @tsql = @tsql + '' BACKUP LOG [?] WITH TRUNCATE_ONLY '' + @tsql
        --print @tsql
        exec(@tsql)
        close LogFiles
        DEALLOCATE LogFiles
        end'
exec sp_msforeachdb @ssql


SQL 2008:



declare @ssql nvarchar(4000)
set @ssql= '
if ''?'' not in (''tempdb'',''master'',''model'',''msdb'') begin
use [?]
declare @tsql nvarchar(4000) set @tsql = ''''
declare @iLogFile int
declare @sLogFileName varchar(55)
declare @RecoveryModel nvarchar(10)
declare LogFiles cursor for
select fileid from sysfiles where status & 0x40 = 0x40
open LogFiles
fetch next from LogFiles into @iLogFile
while @@fetch_status = 0
begin
set @tsql = @tsql + ''DBCC SHRINKFILE(''+cast(@iLogFile as varchar(5))+'', 10) ''
fetch next from LogFiles into @iLogFile
end
select @RecoveryModel = CONVERT(nvarchar(10),Databasepropertyex(name, ''Recovery'')) from master..sysdatabases where name = ''?''
set @tsql = ''USE [?]; '' + @tsql + '' ALTER DATABASE [?] SET RECOVERY SIMPLE '' + @tsql
set @tsql = @tsql + ''; ALTER DATABASE [?] SET RECOVERY '' + @RecoveryModel + '';''
--print @tsql --for debugging
exec(@tsql)
close LogFiles
DEALLOCATE LogFiles
end'
exec sp_msforeachdb @ssql



SQL Script for set Recovery Model to Single in All Databases on Microsoft SQL Server (2000, 2005 and 2008)



SQL 2000:



USE MASTER
declare
@isql varchar(2000),
@dbname varchar(64)
declare c1 cursor for select name from master..sysdatabases where name not in ('master','model','msdb','tempdb') and status != '4194824'
open c1
fetch next from c1 into @dbname
While @@fetch_status <> -1
begin
select @isql = 'ALTER DATABASE @dbname SET AUTO_CLOSE OFF'
select @isql = replace(@isql,'@dbname',@dbname)
print @isql
exec(@isql)
select @isql = 'ALTER DATABASE @dbname SET RECOVERY SIMPLE'
select @isql = replace(@isql,'@dbname',@dbname)
print @isql
exec(@isql)
select @isql='USE @dbname checkpoint'
select @isql = replace(@isql,'@dbname',@dbname)
print @isql
exec(@isql)
fetch next from c1 into @dbname
end
close c1
deallocate c1


SQL 2005:


USE MASTER
declare
@isql varchar(2000),
@dbname varchar(64)
declare c1 cursor for select name from master..sysdatabases where name not in ('master','model','msdb','tempdb') and status != '4194840'
open c1
fetch next from c1 into @dbname
While @@fetch_status <> -1
begin
select @isql = 'ALTER DATABASE @dbname SET AUTO_CLOSE OFF'
select @isql = replace(@isql,'@dbname',@dbname)
print @isql
exec(@isql)
select @isql = 'ALTER DATABASE @dbname SET RECOVERY SIMPLE'
select @isql = replace(@isql,'@dbname',@dbname)
print @isql
exec(@isql)
select @isql='USE @dbname checkpoint'
select @isql = replace(@isql,'@dbname',@dbname)
print @isql
exec(@isql)
fetch next from c1 into @dbname
end
close c1
deallocate c1



SQL 2008:


USE MASTER
declare
@isql varchar(2000),
@dbname varchar(64)
declare c1 cursor for select name from master..sysdatabases where name not in ('master','model','msdb','tempdb')
open c1
fetch next from c1 into @dbname
While @@fetch_status <> -1
begin
select @isql = 'ALTER DATABASE @dbname SET AUTO_CLOSE OFF'
select @isql = replace(@isql,'@dbname',@dbname)
print @isql
exec(@isql)
select @isql = 'ALTER DATABASE @dbname SET RECOVERY SIMPLE'
select @isql = replace(@isql,'@dbname',@dbname)
print @isql
exec(@isql)
select @isql='USE @dbname checkpoint'
select @isql = replace(@isql,'@dbname',@dbname)
print @isql
exec(@isql)
fetch next from c1 into @dbname
end
close c1
deallocate c1

segunda-feira, 12 de novembro de 2012

Call of Duty ® Black Ops Today II.


Within hours will be released the newest game in the series Call of Duty and the first with futuristic vision. The fun is guaranteed in various game modes.

Campaign Mode


One of the big news in single player (campaign) are the Strike Force missions where performance and player actions reflect on the course of the campaign and in the final story. The campaign mode depicts two interrelated moments in history, one that goes around the years 70-80 and another in 2025. Some familiar characters from the series World at War and Black Ops will be back in this edition of the game.
Among them Alex Mason (actor), Frank Woods, Viktor Reznov.

Zombie Mode


The zombie mode also returns for the third time in the history of COD and brings long-awaited news. The most awaited is undoubtedly unique campaign mode. The zombie mode also features new multiplayer modes (up to 8 players) and cooperative.


Official launch of the game will be today in about 5 hours.



War Commander Hacks




WC is a popular Facebook strategy game.

This is my first contribution and english its not my native language. So i am sorry if i wrote anything wrong over here.

First of all you will need "Cheat Engine" (www.cheatengine.org).

You will need know memory process you need open on cheat engine.

For firefox just look for process named "plugin_container" or something like this.

For Chrome, you will need access address chrome://memory-redirect/ and look for process named "Pepper Plugin Shockwave Flash" save it PID number.
Take this PID number and convert to hex (you can use windows calculator for this). Look for chrome process with this hex code.

-> Fast Unit Repair and Build (at low cost)



Ok, now go to WC, open the factory by exemple and look for some unit you want to change... let me takes Elite Hellfires for sample.
In my case it costs 579.360 metal and 772.320 oil to make.

First convert metal value to hex.
579.360 dec to 8D720 hex.

Separate the hex code from right to left like this (if the last number come single match you should add zero on it)
8D720 => 8 D7 20 => 08 D7 20

Now reverse the code:
08 D7 20 => 20 D7 08

Save that value: 20 D7 08

Do the same with oil:
dec to hex:
772.320 => BC8E0

Separete Blocks and reverse:
BC8E0 => B C8 E0 => 0B C8 E0 => E0 C8 0B

Value: E0 C8 0B

Now you need complete (with zero at the end) this value until he gets 4 hex codes (xx xx xx xx)
Some exemples: 64 3B (2hex codes) => 64 3B 00 00 (4 hex codes)

Metal Exemple: 20 D7 08 (3hex) => 20 D7 08 00 (4hex)
Oil Exemple: E0 C8 0B (3hex) => E0 C8 0B 00 (4hex)

Now merge both codes with metal first:
20 D7 08 00 + "E0 C8 0B 00" = "20 D7 08 00 E0 C8 0B 00"

Now you have the first string to search for "20 D7 08 00 E0 C8 0B 00".

Select Array of Bytes in cheat engine and search for this value almost always it will give to you 2 or 4
values.
Add all values to your list change the first one a little bit (like this value "64 00 00 00 E0 C8 0B 00" it will change the metal costs to 100 only) and check if the value was changed in factory if not procced to next value until you got the correct address dont forget to change wrong values back to original value ("20 D7 08 00 E0 C8 0B 00").

Now you have the correct address you should right click and "Browse this memory region" in that region you should see the current value ("20 D7 08 00 E0 C8 0B 00" if you changed it back or "64 00 00 00 E0 C8 0B 00" if you dont changed back).
Those values correspond to:

Metal in 4 hex codes + Oil in 4 Hex codes followed by the build time in 4 hex codes.

In my exemple: I have "20 D7 08 00 E0 C8 0B 00 60 54 00 00" where "60 54 00 00" its the build time value.

you can change it all to "64 00 00 00 64 00 00 00 03 00 00 00" it will make metal and oil build cost 100 resources each and time you will get about 3 seconds dont try use lower timer value or it may crash the flash plugin.


Now you have Fast Build and Fast Repair for that unit.
For fast platoon repair you should do this for each unit type you have in that platoon.
It works at airport too.


-> Fast Resource:


For Fast resource you can locate some unit code like this exemple.
Build 1 unit with 100 resources each (dont change the build time).
Change the metal and oil value to "80 F0 FA 02" (50.000.000 in hex).
Cancel the unit build it will give you back your 50.000.000 each that you havent spend for

-> Instant unlock/upgrade units/turrets in techcenter/lab/etc.


For exemple lets unlock Rifleman 2 stars.
He costs 8500 metal 7700 oil and takes 15min to complete.
Lets convert 8500 metal to hex/separete/reverse and get in shape of 4 hex codes completing with zeros if needed.

dec => hex => separete => reverse => shape in 4hex codes
8500 => 2134 => 21 34 => 34 21 => 34 21 00 00

Same for oil:
dec => hex => separete => reverse => shape in 4hex codes
7700 => 1E14 => 1E 14 => 14 1E => 14 1E 00 00

Merge both codes with metal first followed by oil
"34 21 00 00" + "14 1E 00 00" = "34 21 00 00 14 1E 00 00"
With Cheat Engine search for array of bytes called "34 21 00 00 14 1E 00 00".

Like the first exemple it almost allways will show 2 or 4 results in C.E add all to your list.
And start changing the first address to similar value like "64 00 00 00 14 1E 00 00" changing metal to 100.
Get back to WC and check if metal value of unit upgrade changed (dont forget to close the window and open it again because this value will not auto refresh on wc)
if it was changed you have found the correct address else just keep changing until you found the correct address change wrong address values back to original value ("34 21 00 00 14 1E 00 00").
Now you have the correct value just right click the address and "Browser this memory region"
You will have the value like this:
"34 21 00 00 14 1E 00 00 ..... 84 03 00 00"
|. . . . . . . . . . . |. . . . . . . . . |. . . |____ Here comes with unlock/upgrade time value
|. . . . . . . . . . . |. . . . . . . . . |____ others 5 values with 4 Hex Code(20Hex codes in total)
|. . . . . . . . . . . |____4 Hex codes for Oil Value
|___4 Hex codes for Metal Value

You can change the time to: "78 00 00 00" (2minutes in hex)


Go back to WC start the upgrade and click in finish upgrade. Remember dont let the time ( 2 mins ) end by itself. You need click finish

-> Instant Set Defense Tower upgrades.


Go to WC Click turret /Set Turret Chose the turrent you want to set.
Save those metal and oil values. Convert it like the first exemple (convert to hex/separate/reverse/shape in 4 hex codes/merge both codes)
This time the build timer value will the be the next 4hex block

Like this:
MM MM MM MM OO OO OO OO TT TT TT TT
|. . . . . . . . . . . |. . . . . . . . . . . |__ Time Value in 4 Hex code
|. . . . . . . . . . . |__ OIL Value in 4 Hex Code
|__ Metal Value in 4 Hex Code

Convert the time to "78 00 00 00" (2mins)
Start it and hit finish now. Remember dont let the time ( 2 mins ) end by itself.


-> Incresse Resources Capacity



With Cheat Engine, search for this big Array of Bytes:
"a8 61 00 00 50 c3 00 00 a0 86 01 00 40 0d 03 00 80 1a 06 00 00 35 0C 00 00 6a 18 00 c0 c6 2d 00 80 8d 5b 00 40 54 89 00"

Add to your list and replace all with:
 "80 4A 5D 05 80 4A 5D 05 80 4A 5D 05 80 4A 5D 05 80 4A 5D 05 80 4A 5D 05 80 4A 5D 05 80 4A 5D 05 80 4A 5D 05 80 4A 5D 05"

This will get you a lot of resource capacity for any storage level.


Simple like that



Upcomming WC Hacks share (all working from the last fix):

Freeze attack timers.
Deploy 6 Platoons in a single attack.
Overload defense capacity.
Overload air attack capacity.
Unlock Especial Units (kondor, elite units, etc)
Instant Building upgrades.


Some hacks take little time to explain in a post and i will release then i get some time to write it.



Lordrack, The Blog


Blogger:

Flávio Ivo Cavalcanti, 30 years old, married. . Author of this blog and is a systems analyst, curious and hungry for scientific knowledge. Has profile researcher, autodidact and in favor of "DIY". Fond of his family, does everything to be a good father and faithful husband.



Purpose of blog:

Bring simple tips on various subjects like systems development, hacking, electronic games, devices, communication, internet, security and many others. Trying to address them always in the most comprehensible possible using simple and direct language