Function at 0x4070e0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x17c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [sym.imp.MSVCR120.dll__fseeki64]
mov ebx, ecx
push edi
push 2
mov dword [ebp - 0x160], eax
mov eax, dword [ebp + 0x10]
push 0
mov dword [ebp - 0x168], eax
mov eax, dword [ebp + 0x14]
push 0
push ebx
mov dword [ebp - 0x158], edx
mov dword [ebp - 0x17c], ebx
mov dword [ebp - 0x174], eax
call esi
push ebx
call dword [sym.imp.MSVCR120.dll__ftelli64]
add esp, 0x14
mov dword [ebp - 0x178], eax
mov dword [ebp - 0x16c], edx
push 0
push 0
push 0
push ebx
call esi
mov esi, dword [sym.imp.MSVCR120.dll_void____cdecl_operator_new_unsigned_int_]
push 0x80
call esi
mov edi, eax
mov dword [ebp - 0x15c], eax
add esp, 0x14
test edi, edi
je 0x40717b
push 0x80
push 0
push edi
call sub.MSVCR120.dll_memset
add esp, 0xc
jmp 0x407183
xor edi, edi
mov dword [ebp - 0x15c], edi
push 0x10
call esi
mov ebx, eax
mov dword [ebp - 0x164], eax
add esp, 4
test ebx, ebx
je 0x40719f
xorps xmm0, xmm0
movdqu xmmword [ebx], xmm0
jmp 0x4071a7
xor ebx, ebx
mov dword [ebp - 0x164], ebx
push 0x10
mov dword [ebp - 0x154], 0x44504e
call esi
add esp, 4
mov ebx, eax
push 0
call dword [sym.imp.MSVCR120.dll__time64]
add esp, 4
push eax
call dword [sym.imp.MSVCR120.dll_srand]
add esp, 4
xor esi, esi
call dword [sym.imp.MSVCR120.dll_rand]
mov byte [esi + ebx], al
inc esi
cmp esi, 0x10
jl 0x4071d1
movdqu xmm0, xmmword [ebx]
push ebx
movdqu xmmword [ebp - 0x18], xmm0
call dword [sym.imp.MSVCR120.dll_void___cdecl_operator_delete_void__]
mov eax, dword [ebp - 0x154]
add esp, 4
mov ebx, dword [ebp - 0x164]
mov cl, byte [ebp + 0x30]
mov dword [edi], eax
mov eax, dword [ebp + 0x18]
cmp eax, 1
jne 0x407214
test cl, cl
jne 0x407214
xor edx, edx
jmp 0x407216
mov edx, eax
mov dword [edi + 4], edx
test cl, cl
je 0x407301
mov eax, dword [ebp + 0x1c]
mov ecx, dword [ebp - 0x160]
mov esi, ecx
mov dword [edi + 8], eax
mov eax, dword [ebp + 0x20]
mov dword [edi + 0xc], eax
mov eax, dword [ebp + 0xc]
lea edx, [esi + 1]
movdqu xmm0, xmmword [eax]
movdqu xmmword [edi + 0x10], xmm0
movdqu xmm0, xmmword [eax + 0x10]
movdqu xmmword [edi + 0x20], xmm0
movdqu xmm0, xmmword [eax + 0x20]
movdqu xmmword [edi + 0x30], xmm0
movdqu xmm0, xmmword [ebp - 0x18]
movdqu xmmword [edi + 0x40], xmm0
mov al, byte [esi]
inc esi
test al, al
jne 0x407262
push 0x2f
push ecx
sub esi, edx
call dword [sym.imp.MSVCR120.dll_strrchr]
mov ecx, eax
add esp, 8
test ecx, ecx
jne 0x407294
push 0x5c
push dword [ebp - 0x160]
call dword [sym.imp.MSVCR120.dll_strrchr]
mov ecx, eax
add esp, 8
test ecx, ecx
je 0x4072aa
mov edx, dword [ebp - 0x160]
dec esi
mov eax, edx
sub eax, ecx
add esi, eax
test ecx, ecx
je 0x4072b0
lea edx, [ecx + 1]
jmp 0x4072b0
mov edx, dword [ebp - 0x160]
lea eax, [esi + 1]
push eax
push edx
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.MSVCR120.dll_strncpy]
add esp, 0xc
lea ecx, [ebp - 0x120]
mov edx, edi
call fcn.00406eb0
mov ecx, dword [ebp - 0x168]
mov edx, edi
call fcn.00406f90
mov cl, byte [ebp + 0x30]
mov eax, dword [ebp + 0x18]
mov dword [edi + 0x70], 0
mov dword [edi + 0x74], 0
mov dword [edi + 0x78], 0
mov dword [edi + 0x7c], 0
cmp eax, 1
jne 0x40733e
cmp byte [ebp + 0x2c], 0
je 0x40731d
xor eax, eax
mov edx, 1
cmp byte [ebp + 0x28], al
cmovne eax, edx
mov dword [ebx], eax
jmp 0x407365
push str.ERROR:_Invalid_version_for_SDAT_
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
mov edx, 0xd
cmp eax, 2
lea eax, [edx - 1]
je 0x407350
mov eax, 0x3c
cmp byte [ebp + 0x28], 0
cmovne eax, edx
cmp byte [ebp + 0x2c], 0
mov dword [ebx], eax
jne 0x407365
or dword [ebx], 0x1000000
test cl, cl
jne 0x40736f
or dword [ebx], 0x80000000
mov eax, dword [ebp + 0x24]
mov esi, dword [sym.imp.MSVCR120.dll_printf]
shl eax, 0xa
mov dword [ebx + 4], eax
mov eax, dword [ebp - 0x178]
mov dword [ebx + 8], eax
mov eax, dword [ebp - 0x16c]
push str.NPD_HEADER_n
mov dword [ebx + 0xc], eax
call esi
add esp, 4
push dword [edi + 4]
push str.NPD_version:__d_n
call esi
push dword [edi + 8]
push str.NPD_license:__d_n
call esi
push dword [edi + 0xc]
push str.NPD_type:__x_n
call esi
lea eax, [edi + 0x10]
push eax
push str.NPD_content_ID:__s_n
call esi
push 0x40c150
call esi
add esp, 0x24
xorps xmm0, xmm0
test dword [ebx], 0x1000000
movdqu xmmword [ebp - 0x18], xmm0
je 0x407429
push str.SDAT_HEADER_n
call esi
add esp, 4
push dword [ebx]
push str.SDAT_flags:_0x_08X_n
call esi
push dword [ebx + 4]
push str.SDAT_block_size:_0x_08X_n
call esi
push dword [ebx + 0xc]
push dword [ebx + 8]
push str.SDAT_file_size:_0x_llX_n
call esi
add esp, 0x1c
push 0x40c150
call esi
push 0x40e190
lea edx, [edi + 0x60]
lea ecx, [ebp - 0x18]
call fcn.0040a860
add esp, 8
jmp 0x4074f6
push str.EDAT_HEADER_n
call esi
add esp, 4
push dword [ebx]
push str.EDAT_flags:_0x_08X_n
call esi
push dword [ebx + 4]
push str.EDAT_block_size:_0x_08X_n
call esi
push dword [ebx + 0xc]
push dword [ebx + 8]
push str.EDAT_file_size:_0x_llX_n
call esi
add esp, 0x1c
push 0x40c150
call esi
mov ecx, dword [edi + 8]
add esp, 4
mov eax, ecx
and eax, 3
cmp al, 3
jne 0x40797d
mov eax, dword [ebp - 0x168]
movdqu xmm0, xmmword [eax]
movdqu xmmword [ebp - 0x18], xmm0
cmp byte [ebp + 0x34], 0
je 0x407530
push str.DEVKLIC:
call esi
mov edi, dword [ebp - 0x168]
add esp, 4
xor ebx, ebx
jmp 0x4074a0
movzx eax, byte [edi + ebx]
push eax
push str._02X
call esi
inc ebx
add esp, 8
cmp ebx, 0x10
jl 0x4074a0
push 0x40c150
call esi
add esp, 4
push str.RIF_KEY:
call esi
mov edi, dword [ebp - 0x15c]
add esp, 4
xor ebx, ebx
mov eax, dword [ebp - 0x174]
movzx eax, byte [eax + ebx]
push eax
push str._02X
call esi
inc ebx
add esp, 8
cmp ebx, 0x10
jl 0x4074d1
push 0x40c150
call esi
add esp, 4
cmp byte [ebp + 0x34], 0
je 0x407530
push str.ENCRYPTION_KEY:
call esi
add esp, 4
xor ebx, ebx
jmp 0x407510
movzx eax, byte [ebp + ebx - 0x18]
push eax
push str._02X
call esi
inc ebx
add esp, 8
cmp ebx, 0x10
jl 0x407510
push 0x40c784
call esi
add esp, 4
mov ecx, dword [edi + 4]
mov edx, ecx
mov eax, ecx
sar edx, 8
shr eax, 0x18
and edx, 0xff00
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shl eax, 8
or edx, eax
mov dword [ebp - 0x124], edx
mov ecx, dword [edi + 8]
mov edx, ecx
mov eax, ecx
sar edx, 8
shr eax, 0x18
and edx, 0xff00
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shl eax, 8
or edx, eax
mov dword [ebp - 0x134], edx
mov ecx, dword [edi + 0xc]
mov edx, ecx
mov eax, ecx
sar edx, 8
shr eax, 0x18
and edx, 0xff00
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shl eax, 8
or edx, eax
mov dword [ebp - 0x128], edx
mov edx, dword [edi + 0x70]
mov eax, edx
mov ecx, dword [edi + 0x74]
mov ebx, ecx
mov dword [ebp - 0x154], ecx
and ebx, 0xff0000
mov dword [ebp - 0x16c], ecx
xor edi, edi
shrd eax, ecx, 0x10
or edi, eax
shr ecx, 0x10
mov eax, dword [ebp - 0x154]
or ebx, ecx
shrd edi, ebx, 0x10
and eax, 0xff00
mov ecx, edx
shld dword [ebp - 0x154], ecx, 0x10
shr ebx, 0x10
or ebx, eax
shl ecx, 0x10
movzx eax, byte [ebp - 0x16c]
shrd edi, ebx, 0x10
shr ebx, 0x10
or ebx, eax
mov eax, edx
and eax, 0xff00
or ecx, eax
mov eax, dword [ebp - 0x154]
shld eax, ecx, 0x10
shrd edi, ebx, 8
mov dword [ebp - 0x154], eax
mov eax, edx
and eax, 0xff0000
shl ecx, 0x10
or ecx, eax
shr ebx, 8
mov eax, dword [ebp - 0x154]
shld eax, ecx, 0x10
shl ecx, 0x10
and edx, 0xff000000
or ecx, edx
shld eax, ecx, 8
push dword [ebp - 0x158]
or ebx, eax
shl ecx, 8
or edi, ecx
mov dword [ebp - 0x14c], ebx
mov ebx, dword [ebp - 0x15c]
mov dword [ebp - 0x150], edi
xor edi, edi
push 1
push 4
mov edx, dword [ebx + 0x78]
mov eax, edx
mov ecx, dword [ebx + 0x7c]
mov ebx, ecx
mov dword [ebp - 0x154], ecx
and ebx, 0xff0000
mov dword [ebp - 0x16c], ecx
shrd eax, ecx, 0x10
or edi, eax
shr ecx, 0x10
mov eax, dword [ebp - 0x154]
or ebx, ecx
shrd edi, ebx, 0x10
and eax, 0xff00
mov ecx, edx
shld dword [ebp - 0x154], ecx, 0x10
shr ebx, 0x10
or ebx, eax
shl ecx, 0x10
movzx eax, byte [ebp - 0x16c]
shrd edi, ebx, 0x10
shr ebx, 0x10
or ebx, eax
mov eax, edx
and eax, 0xff00
or ecx, eax
mov eax, dword [ebp - 0x154]
shld eax, ecx, 0x10
shrd edi, ebx, 8
mov dword [ebp - 0x154], eax
mov eax, edx
shl ecx, 0x10
and eax, 0xff0000
or ecx, eax
shr ebx, 8
mov eax, dword [ebp - 0x154]
and edx, 0xff000000
shld eax, ecx, 0x10
shl ecx, 0x10
or ecx, edx
shld eax, ecx, 8
shl ecx, 8
or ebx, eax
or edi, ecx
mov dword [ebp - 0x144], ebx
mov ebx, dword [sym.imp.MSVCR120.dll_fwrite]
mov dword [ebp - 0x148], edi
mov edi, dword [ebp - 0x15c]
push edi
call ebx
push dword [ebp - 0x158]
lea eax, [ebp - 0x124]
push 1
push 4
push eax
call ebx
push dword [ebp - 0x158]
lea eax, [ebp - 0x134]
push 1
push 4
push eax
call ebx
push dword [ebp - 0x158]
lea eax, [ebp - 0x128]
push 1
push 4
push eax
call ebx
add esp, 0x40
lea eax, [edi + 0x10]
push dword [ebp - 0x158]
push 1
push 0x30
push eax
call ebx
push dword [ebp - 0x158]
lea eax, [edi + 0x40]
push 1
push 0x10
push eax
call ebx
push dword [ebp - 0x158]
lea eax, [edi + 0x50]
push 1
push 0x10
push eax
call ebx
push dword [ebp - 0x158]
lea eax, [edi + 0x60]
push 1
push 0x10
push eax
call ebx
mov edi, dword [ebp - 0x158]
lea eax, [ebp - 0x150]
add esp, 0x40
push edi
push 1
push 8
push eax
call ebx
push edi
push 1
lea eax, [ebp - 0x148]
push 8
push eax
call ebx
mov ebx, dword [ebp - 0x164]
xor edi, edi
mov ecx, dword [ebx]
mov edx, ecx
sar edx, 8
mov eax, ecx
shr eax, 0x18
and edx, 0xff00
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shl eax, 8
or edx, eax
mov dword [ebp - 0x130], edx
mov ecx, dword [ebx + 4]
mov edx, ecx
sar edx, 8
mov eax, ecx
shr eax, 0x18
and edx, 0xff00
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shl eax, 8
or edx, eax
mov dword [ebp - 0x12c], edx
mov ecx, dword [ebx + 0xc]
mov edx, dword [ebx + 8]
mov ebx, ecx
mov dword [ebp - 0x154], ecx
mov eax, edx
mov dword [ebp - 0x16c], ecx
and ebx, 0xff0000
shrd eax, ecx, 0x10
shr ecx, 0x10
or edi, eax
or ebx, ecx
shrd edi, ebx, 0x10
mov eax, dword [ebp - 0x154]
mov ecx, edx
shld dword [ebp - 0x154], ecx, 0x10
and eax, 0xff00
shr ebx, 0x10
or ebx, eax
shl ecx, 0x10
movzx eax, byte [ebp - 0x16c]
shrd edi, ebx, 0x10
shr ebx, 0x10
or ebx, eax
mov eax, edx
and eax, 0xff00
or ecx, eax
mov eax, dword [ebp - 0x154]
shld eax, ecx, 0x10
shrd edi, ebx, 8
mov dword [ebp - 0x154], eax
mov eax, edx
shl ecx, 0x10
and eax, 0xff0000
or ecx, eax
shr ebx, 8
mov eax, dword [ebp - 0x154]
and edx, 0xff000000
shld eax, ecx, 0x10
shl ecx, 0x10
or ecx, edx
shld eax, ecx, 8
or ebx, eax
shl ecx, 8
mov dword [ebp - 0x13c], ebx
lea eax, [ebp - 0x130]
mov ebx, dword [ebp - 0x158]
or edi, ecx
push ebx
push 1
push 4
mov dword [ebp - 0x140], edi
mov edi, dword [sym.imp.MSVCR120.dll_fwrite]
push eax
call edi
push ebx
push 1
lea eax, [ebp - 0x12c]
push 4
push eax
call edi
add esp, 0x40
lea eax, [ebp - 0x140]
push ebx
push 1
push 8
push eax
call edi
push str.Encrypting_data..._n
call esi
mov ebx, dword [ebp - 0x15c]
lea eax, [ebp - 0x18]
mov edi, dword [ebp - 0x164]
add esp, 0x14
mov edx, dword [ebp - 0x158]
mov ecx, dword [ebp - 0x17c]
push dword [ebp + 0x34]
push eax
push ebx
push edi
call fcn.004061e0
add esp, 0x10
test eax, eax
je 0x4079e7
push str.Encryption_failed__n
call esi
add esp, 4
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
test cl, 2
je 0x4079c1
mov eax, dword [ebp - 0x174]
movdqu xmm0, xmmword [eax]
xor eax, eax
movdqu xmmword [ebp - 0x18], xmm0
cmp byte [ebp + eax - 0x18], 0
jne 0x40747f
inc eax
cmp eax, 0x10
jl 0x407993
push str.ERROR:_A_valid_RAP_RIF_file_is_needed_for_this_EDAT_file_
call esi
add esp, 4
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
test cl, 1
je 0x40747f
push str.ERROR:_Network_license_not_supported_
call esi
add esp, 4
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
push str.File_successfully_encrypted__n
call esi
add esp, 4
cmp byte [ebp + 0x30], 0
je 0x407a40
push str.Forging_data..._n
call esi
add esp, 4
lea ecx, [ebp - 0x18]
mov edx, edi
push dword [ebp - 0x158]
push ebx
call fcn.00406b00
add esp, 8
test eax, eax
je 0x407a36
push str.Forging_failed__n
call esi
add esp, 4
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
push str.File_successfully_forged__n
call esi
add esp, 4
mov esi, dword [sym.imp.MSVCR120.dll_void___cdecl_operator_delete_void__]
push ebx
call esi
add esp, 4
push edi
call esi
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
xor al, al
pop edi
pop esi
pop ebx
call fcn.0040abe5
mov esp, ebp
pop ebp
ret