Function at 0x4520d8
Capabilities:
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x19
push 0
push 0
dec ecx
jne 0x4520e1
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov ebx, ecx
mov dword [ebp - 4], edx
mov dword [ebp - 0x24], eax
mov esi, dword [ebp + 8]
mov eax, dword [ebp - 4]
call fcn.00406ec4
xor eax, eax
push ebp
push 0x452aac
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x25], 0
cmp dword [ebp - 4], 0
je 0x452a0a
cmp dword [ebp - 0x24], 0
jne 0x452345
lea edx, [ebp - 8]
mov eax, esi
mov ecx, dword [eax]
call dword [ecx + 0x1f8]
cmp byte [ebp + 0xc], 0
jne 0x452327
mov eax, 0xfa
call fcn.00437968
test al, al
je 0x452158
push 0
call sub.user32.dll_MessageBeep
jmp 0x452a0a
push 0x7fffffff
mov edi, dword [0x67d0e0]
mov edi, dword [edi]
mov ecx, 1
mov edx, dword [ebp - 8]
mov eax, 0x452ad0
call edi
test eax, eax
jle 0x4521a1
lea edx, [ebp - 0x94]
mov eax, dword [ebp - 8]
call fcn.00435b28
mov edx, dword [ebp - 0x94]
lea eax, [ebp - 8]
call fcn.00406f30
lea edx, [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.0040f9d8
jmp 0x4521b0
lea ecx, [ebp - 0xc]
mov dl, 1
mov eax, 0x10
call fcn.004380ac
lea edx, [ebp - 0x98]
mov eax, dword [ebp - 8]
call fcn.0040f998
mov edx, dword [ebp - 0x98]
lea eax, [ebp - 8]
call fcn.00406f30
lea eax, [ebp - 8]
mov edx, 0x452ae0
call fcn.00407230
lea eax, [ebp - 8]
mov edx, 0x105
call fcn.00407198
lea edx, [ebp - 0x10]
mov eax, esi
mov ecx, dword [eax]
call dword [ecx + 0x2ac]
lea eax, [ebp - 0x8d]
mov edx, 0x4c
call fcn.0040b1c4
mov dword [ebp - 0x8d], 0x4c
mov dword [ebp - 0x89], ebx
mov dword [ebp - 0x75], 1
mov dword [ebp - 0x6d], 0x104
mov dword [ebp - 0x59], 0x8004
call sub.KERNEL32.DLL_GetVersion_1
test eax, 0x80000000
jne 0x45228c
mov eax, dword [ebp - 8]
call fcn.00406f68
mov dword [ebp - 0x71], eax
mov eax, dword [ebp - 0xc]
call fcn.00406f68
mov dword [ebp - 0x61], eax
mov eax, dword [ebp - 0x10]
call fcn.00406f68
mov dword [ebp - 0x5d], eax
mov eax, 0x452ae4
mov dword [ebp - 0x81], eax
mov eax, 0x452b00
mov dword [ebp - 0x51], eax
lea eax, [ebp - 0x8d]
push eax
call sub.comdlg32.dll_GetSaveFileNameW
test eax, eax
je 0x452a0a
lea eax, [ebp - 8]
mov edx, dword [ebp - 0x71]
call fcn.00407088
jmp 0x452350
lea eax, [ebp - 0x14]
mov edx, dword [ebp - 8]
mov ecx, 0
call fcn.00407120
lea eax, [ebp - 0x18]
mov edx, dword [ebp - 0xc]
mov ecx, 0
call fcn.00407120
lea eax, [ebp - 0x1c]
mov edx, dword [ebp - 0x10]
mov ecx, 0
call fcn.00407120
mov eax, dword [ebp - 0x14]
call fcn.0040652c
mov dword [ebp - 0x71], eax
mov eax, dword [ebp - 0x18]
call fcn.0040652c
mov dword [ebp - 0x61], eax
mov eax, dword [ebp - 0x1c]
call fcn.0040652c
mov dword [ebp - 0x5d], eax
mov eax, 0x452b0c
mov dword [ebp - 0x81], eax
mov eax, 0x452b1c
mov dword [ebp - 0x51], eax
lea eax, [ebp - 0x8d]
push eax
call sub.comdlg32.dll_GetSaveFileNameA
test eax, eax
je 0x452a0a
lea eax, [ebp - 0x9c]
mov edx, dword [ebp - 0x71]
mov ecx, 0
call fcn.00406124
mov edx, dword [ebp - 0x9c]
lea eax, [ebp - 8]
call fcn.004070f8
jmp 0x452350
lea edx, [ebp - 0xa0]
mov eax, dword [ebp - 8]
call fcn.00435b28
mov edx, dword [ebp - 0xa0]
lea eax, [ebp - 8]
call fcn.00406f30
jmp 0x452350
lea eax, [ebp - 8]
mov edx, dword [ebp - 0x24]
call fcn.00406f30
push ebp
mov eax, dword [ebp - 8]
call fcn.00451d84
pop ecx
call sub.KERNEL32.DLL_GetVersion_1
test eax, 0x80000000
jne 0x452387
push 0
push 0
push 4
push 0
push 0
push 0xc0000000
mov eax, dword [ebp - 8]
call fcn.00406f68
push eax
call sub.KERNEL32.DLL_CreateFileW_1
mov ebx, eax
jmp 0x4523bc
push 0
push 0
push 4
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0xa4]
mov edx, dword [ebp - 8]
mov ecx, 0
call fcn.00407120
mov eax, dword [ebp - 0xa4]
call fcn.0040652c
push eax
call sub.KERNEL32.DLL_CreateFileA
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4524e8
push 0x7fffffff
lea edx, [ebp - 0xa8]
mov eax, esi
mov ecx, dword [eax]
call dword [ecx + 0x1f8]
mov edx, dword [ebp - 0xa8]
mov edi, dword [0x67d0e0]
mov edi, dword [edi]
mov ecx, 1
mov eax, 0x452ad0
call edi
test eax, eax
jne 0x4524e8
push 0x452b30
lea edx, [ebp - 0xb4]
xor eax, eax
call fcn.00435a34
mov eax, dword [ebp - 0xb4]
lea edx, [ebp - 0xb0]
call fcn.0040f998
mov eax, dword [ebp - 0xb0]
lea edx, [ebp - 0xac]
call fcn.00435ae8
push dword [ebp - 0xac]
push 0x452ad0
lea edx, [ebp - 0xb8]
mov eax, esi
mov ecx, dword [eax]
call dword [ecx + 0x1f8]
push dword [ebp - 0xb8]
lea eax, [ebp - 8]
mov edx, 4
call fcn.00407380
push 0x452b5c
push 0x452b80
push 0x452ba4
lea edx, [ebp - 8]
mov ecx, 0x452bd0
xor eax, eax
call fcn.004383e8
push ebp
mov eax, dword [ebp - 8]
call fcn.00451d84
pop ecx
call sub.KERNEL32.DLL_GetVersion_1
test eax, 0x80000000
jne 0x4524b3
push 0
push 0
push 4
push 0
push 0
push 0xc0000000
mov eax, dword [ebp - 8]
call fcn.00406f68
push eax
call sub.KERNEL32.DLL_CreateFileW_1
mov ebx, eax
jmp 0x4524e8
push 0
push 0
push 4
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0xbc]
mov edx, dword [ebp - 8]
mov ecx, 0
call fcn.00407120
mov eax, dword [ebp - 0xbc]
call fcn.0040652c
push eax
call sub.KERNEL32.DLL_CreateFileA
mov ebx, eax
cmp ebx, 0xffffffff
je 0x452a0a
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x200]
test al, al
je 0x452983
push 0
push ebx
call sub.KERNEL32.DLL_GetFileSize_1
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 8]
xor edx, edx
call fcn.00406f30
cmp dword [ebp - 0x2c], 0
jbe 0x4525d6
lea ecx, [ebp - 8]
mov edx, 0x452bf8
mov eax, dword [ebp - 4]
call fcn.00451af8
lea eax, [ebp - 8]
call fcn.00406050
call fcn.0040718c
cmp eax, 0x1f
jne 0x4525cc
lea ecx, [ebp - 0xc0]
mov edx, 0x452c20
mov eax, dword [ebp - 4]
call fcn.00451af8
cmp dword [ebp - 0xc0], 0
je 0x45257d
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x210]
mov byte [ebp - 0x41], al
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x220]
jmp 0x452594
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x218]
mov byte [ebp - 0x41], al
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x228]
cmp byte [ebp - 0x41], 0
jne 0x4525a6
lea eax, [ebp - 8]
xor edx, edx
call fcn.00406f30
jmp 0x4525d6
sub al, 1
jb 0x4525ae
je 0x4525bd
jmp 0x4525d6
lea eax, [ebp - 8]
mov edx, 9
call fcn.00407198
jmp 0x4525d6
lea eax, [ebp - 8]
mov edx, 0x14
call fcn.00407198
jmp 0x4525d6
lea eax, [ebp - 8]
xor edx, edx
call fcn.00406f30
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x208]
test eax, eax
jbe 0x4525f3
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x208]
cmp eax, dword [ebp - 0x2c]
jb 0x4525f7
xor eax, eax
jmp 0x4525f9
mov al, 1
mov byte [ebp - 0x41], al
cmp byte [ebp - 0x41], 0
jne 0x45260c
cmp dword [ebp - 8], 0
je 0x452975
push 0
push 0
push 0
push 4
push 0
push ebx
call sub.KERNEL32.DLL_CreateFileMappingW
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
je 0x452975
push 0
push 0
push 0
push 0xf001f
mov eax, dword [ebp - 0x3c]
push eax
call sub.KERNEL32.DLL_MapViewOfFile
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
je 0x45296c
cmp dword [ebp - 8], 0
je 0x4528d2
lea edx, [ebp - 0x14]
mov eax, dword [ebp - 8]
call fcn.0040f6c8
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x2c]
push eax
push 0
mov eax, dword [ebp - 0x30]
dec eax
push eax
push 0
lea eax, [ebp - 0x14]
xor edx, edx
call fcn.00406080
call fcn.00406204
add eax, 2
push eax
lea eax, [ebp - 0xc4]
mov ecx, dword [ebp - 0x14]
mov edx, 0x452c4c
call fcn.004062b4
mov eax, dword [ebp - 0xc4]
call fcn.0040652c
mov edi, dword [0x67ce8c]
mov edi, dword [edi]
mov edx, dword [ebp - 0x40]
pop ecx
call edi
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jl 0x4528c8
mov eax, dword [ebp - 0x2c]
push eax
push 0
mov eax, dword [ebp - 0x30]
push eax
push 0
mov edi, dword [0x67ce8c]
mov edi, dword [edi]
mov eax, 0x452c50
mov ecx, 0xb
mov edx, dword [ebp - 0x40]
call edi
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jge 0x452710
mov eax, dword [ebp - 0x2c]
push eax
push 0
push 0
push 0
mov edi, dword [0x67ce8c]
mov edi, dword [edi]
mov eax, 0x452c5c
mov ecx, 9
mov edx, dword [ebp - 0x40]
call edi
mov dword [ebp - 0x34], eax
jmp 0x452714
add dword [ebp - 0x34], 2
cmp dword [ebp - 0x34], 0
jl 0x4528c8
mov eax, dword [ebp - 0x2c]
push eax
push 0
mov eax, dword [ebp - 0x30]
push eax
push 0x7fffffff
mov edi, dword [0x67ce8c]
mov edi, dword [edi]
mov eax, 0x452c50
mov ecx, 0xb
mov edx, dword [ebp - 0x40]
call edi
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
jge 0x452755
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x38], eax
jmp 0x452759
add dword [ebp - 0x38], 2
push 0
mov ecx, dword [ebp - 0x38]
sub ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0x40]
add edx, dword [ebp - 0x34]
lea eax, [ebp - 0x18]
call fcn.00405fa8
lea edx, [ebp - 0xc]
mov eax, dword [ebp - 0x18]
call fcn.0040f438
mov ecx, 0x452c74
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.00452064
test al, al
je 0x4528c8
mov ecx, 0x452c98
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.00452064
test al, al
je 0x4528c8
mov ecx, 0x452c20
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.00452064
test al, al
je 0x4528c8
mov ecx, 0x452cc4
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.00452064
test al, al
je 0x4528c8
lea ecx, [ebp - 0xc8]
mov edx, 0x452cc4
mov eax, dword [ebp - 0xc]
call fcn.00451af8
cmp dword [ebp - 0xc8], 0
jne 0x452826
mov ecx, 0x452ce0
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.00452064
test al, al
je 0x4528c8
mov ecx, 0x452d0c
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.00452064
test al, al
je 0x4528c8
lea ecx, [ebp - 8]
mov edx, 0x452d3c
mov eax, dword [ebp - 0xc]
call fcn.00451af8
cmp dword [ebp - 8], 0
je 0x452866
lea eax, [ebp - 8]
call fcn.00406050
call fcn.0040718c
push eax
mov eax, dword [ebp - 8]
call fcn.00406f68
mov edx, eax
mov edi, dword [0x67d350]
mov edi, dword [edi]
xor eax, eax
pop ecx
call edi
mov dword [ebp - 0x30], eax
jmp 0x45286d
mov dword [ebp - 0x30], 1
lea eax, [ebp - 0xcc]
push eax
mov eax, dword [ebp - 0x30]
inc eax
mov cx, 0x30
mov edx, 1
call fcn.0040e150
mov eax, dword [ebp - 0xcc]
push eax
lea eax, [ebp - 4]
mov ecx, 0x452bf8
mov edx, 0x452d3c
call fcn.00451ee8
mov eax, dword [ebp - 0x38]
cmp eax, dword [ebp - 0x2c]
jae 0x4528bd
mov ecx, dword [ebp - 0x2c]
sub ecx, eax
mov edx, dword [ebp - 0x40]
add edx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x40]
add eax, dword [ebp - 0x38]
call fcn.00403424
mov eax, dword [ebp - 0x38]
sub eax, dword [ebp - 0x34]
sub dword [ebp - 0x2c], eax
jmp 0x4528d2
cmp dword [ebp - 0x30], 0xffffffff
jne 0x452665
cmp byte [ebp - 0x41], 0
je 0x452963
push 0
push 0
push 0
push ebx
call sub.KERNEL32.DLL_SetFilePointer_1
xor eax, eax
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x2c]
push eax
push 0
mov eax, dword [ebp - 0x30]
inc eax
push eax
push 0x7fffffff
mov edi, dword [0x67ce8c]
mov edi, dword [edi]
mov eax, 0x452c50
mov ecx, 0xb
mov edx, dword [ebp - 0x40]
call edi
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0xffffffff
je 0x452942
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x208]
mov edi, eax
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x208]
shr eax, 2
sub edi, eax
mov eax, dword [ebp - 0x2c]
sub eax, dword [ebp - 0x30]
cmp edi, eax
jbe 0x4528ed
cmp dword [ebp - 0x30], 0xffffffff
je 0x452963
add dword [ebp - 0x30], 2
mov eax, dword [ebp - 0x30]
sub dword [ebp - 0x2c], eax
mov edx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x40]
add eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x2c]
call fcn.00403424
mov eax, dword [ebp - 0x40]
push eax
call sub.KERNEL32.DLL_UnmapViewOfFile
mov eax, dword [ebp - 0x3c]
push eax
call sub.KERNEL32.DLL_CloseHandle_1
push 0
push 0
mov eax, dword [ebp - 0x2c]
push eax
push ebx
call sub.KERNEL32.DLL_SetFilePointer_1
push dword [ebp - 4]
push 0x452d54
push 0x452d54
lea eax, [ebp - 4]
mov edx, 3
call fcn.00407380
lea edx, [ebp - 0x14]
mov eax, dword [ebp - 4]
call fcn.0040f6c8
push 0
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x14]
xor edx, edx
call fcn.00406080
call fcn.00406204
push eax
mov eax, dword [ebp - 0x14]
push eax
push ebx
call sub.KERNEL32.DLL_WriteFile_1
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x25], al
push ebx
call sub.KERNEL32.DLL_SetEndOfFile_1
push ebx
call sub.KERNEL32.DLL_CloseHandle_1
cmp dword [ebp - 0x24], 0
sete al
and al, byte [ebp + 0xc]
je 0x452a0a
lea eax, [ebp - 0x20]
call fcn.00409084
push eax
push 0x452d5c
push esi
mov eax, dword [esi]
call dword [eax]
test eax, eax
jne 0x452a0a
mov dl, 1
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax]
call dword [ecx + 0x24]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x452ab6
lea eax, [ebp - 0xcc]
mov edx, 2
call fcn.00406ed4
lea eax, [ebp - 0xc4]
call fcn.00405e70
lea eax, [ebp - 0xc0]
call fcn.00406ecc
lea eax, [ebp - 0xbc]
call fcn.00405e70
lea eax, [ebp - 0xb8]
mov edx, 5
call fcn.00406ed4
lea eax, [ebp - 0xa4]
call fcn.00405e70
lea eax, [ebp - 0xa0]
call fcn.00406ecc
lea eax, [ebp - 0x9c]
call fcn.00405e70
lea eax, [ebp - 0x98]
mov edx, 2
call fcn.00406ed4
lea eax, [ebp - 0x20]
call fcn.00409084
lea eax, [ebp - 0x1c]
mov edx, 3
call fcn.00405e94
lea eax, [ebp - 0x10]
mov edx, 4
call fcn.00406ed4
ret