Function at 0x4a577944
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 0x4a57794d
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 edi, dword [ebp + 8]
mov eax, dword [ebp - 4]
call fcn.4a5076fc
xor eax, eax
push ebp
push 0x4a578313
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x25], 0
cmp dword [ebp - 4], 0
je 0x4a578271
cmp dword [ebp - 0x24], 0
jne 0x4a577bb1
lea edx, [ebp - 8]
mov eax, edi
mov ecx, dword [eax]
call dword [ecx + 0x1f8]
cmp byte [ebp + 0xc], 0
jne 0x4a577b93
mov eax, 0xfa
call fcn.4a554288
test al, al
je 0x4a5779c4
push 0
call sub.user32.dll_MessageBeep
jmp 0x4a578271
push 0x7fffffff
mov esi, dword [0x4a5ed494]
mov esi, dword [esi]
mov ecx, 1
mov edx, dword [ebp - 8]
mov eax, 0x4a578338
call esi
test eax, eax
jle 0x4a577a0d
lea edx, [ebp - 0x94]
mov eax, dword [ebp - 8]
call fcn.4a5524c8
mov edx, dword [ebp - 0x94]
lea eax, [ebp - 8]
call fcn.4a507a20
lea edx, [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.4a512584
jmp 0x4a577a1c
lea ecx, [ebp - 0xc]
mov dl, 1
mov eax, 0x10
call fcn.4a5549dc
lea edx, [ebp - 0x98]
mov eax, dword [ebp - 8]
call fcn.4a512544
mov edx, dword [ebp - 0x98]
lea eax, [ebp - 8]
call fcn.4a507a20
lea eax, [ebp - 8]
mov edx, 0x4a578348
call fcn.4a508490
lea eax, [ebp - 8]
mov edx, 0x105
call fcn.4a508410
lea edx, [ebp - 0x10]
mov eax, edi
mov ecx, dword [eax]
call dword [ecx + 0x2ac]
lea eax, [ebp - 0x8d]
mov edx, 0x4c
call fcn.4a50e138
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 0x4a577af8
mov eax, dword [ebp - 8]
call fcn.4a5082f8
mov dword [ebp - 0x71], eax
mov eax, dword [ebp - 0xc]
call fcn.4a5082f8
mov dword [ebp - 0x61], eax
mov eax, dword [ebp - 0x10]
call fcn.4a5082f8
mov dword [ebp - 0x5d], eax
mov eax, 0x4a57834c
mov dword [ebp - 0x81], eax
mov eax, 0x4a578368
mov dword [ebp - 0x51], eax
lea eax, [ebp - 0x8d]
push eax
call sub.comdlg32.dll_GetSaveFileNameW
test eax, eax
je 0x4a578271
lea eax, [ebp - 8]
mov edx, dword [ebp - 0x71]
call fcn.4a508350
jmp 0x4a577bbc
lea eax, [ebp - 0x14]
mov edx, dword [ebp - 8]
mov ecx, 0
call fcn.4a508124
lea eax, [ebp - 0x18]
mov edx, dword [ebp - 0xc]
mov ecx, 0
call fcn.4a508124
lea eax, [ebp - 0x1c]
mov edx, dword [ebp - 0x10]
mov ecx, 0
call fcn.4a508124
mov eax, dword [ebp - 0x14]
call fcn.4a507f78
mov dword [ebp - 0x71], eax
mov eax, dword [ebp - 0x18]
call fcn.4a507f78
mov dword [ebp - 0x61], eax
mov eax, dword [ebp - 0x1c]
call fcn.4a507f78
mov dword [ebp - 0x5d], eax
mov eax, 0x4a578374
mov dword [ebp - 0x81], eax
mov eax, 0x4a578384
mov dword [ebp - 0x51], eax
lea eax, [ebp - 0x8d]
push eax
call sub.comdlg32.dll_GetSaveFileNameA
test eax, eax
je 0x4a578271
lea eax, [ebp - 0x9c]
mov edx, dword [ebp - 0x71]
mov ecx, 0
call fcn.4a507c94
mov edx, dword [ebp - 0x9c]
lea eax, [ebp - 8]
call fcn.4a5083c0
jmp 0x4a577bbc
lea edx, [ebp - 0xa0]
mov eax, dword [ebp - 8]
call fcn.4a5524c8
mov edx, dword [ebp - 0xa0]
lea eax, [ebp - 8]
call fcn.4a507a20
jmp 0x4a577bbc
lea eax, [ebp - 8]
mov edx, dword [ebp - 0x24]
call fcn.4a507a20
push ebp
mov eax, dword [ebp - 8]
call fcn.4a577618
pop ecx
call sub.kernel32.dll_GetVersion_1
test eax, 0x80000000
jne 0x4a577bf3
push 0
push 0
push 4
push 0
push 0
push 0xc0000000
mov eax, dword [ebp - 8]
call fcn.4a5082f8
push eax
call sub.kernel32.dll_CreateFileW_1
mov esi, eax
jmp 0x4a577c28
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.4a508124
mov eax, dword [ebp - 0xa4]
call fcn.4a507f78
push eax
call sub.kernel32.dll_CreateFileA
mov esi, eax
cmp esi, 0xffffffff
jne 0x4a577d6d
push 0x7fffffff
lea edx, [ebp - 0xa8]
mov eax, edi
mov ecx, dword [eax]
call dword [ecx + 0x1f8]
mov edx, dword [ebp - 0xa8]
mov ebx, dword [0x4a5ed494]
mov ebx, dword [ebx]
mov ecx, 1
mov eax, 0x4a578338
call ebx
test eax, eax
jne 0x4a577d6d
push 0x4a578398
lea edx, [ebp - 0xb4]
xor eax, eax
call fcn.4a5523d4
mov eax, dword [ebp - 0xb4]
lea edx, [ebp - 0xb0]
call fcn.4a512544
mov eax, dword [ebp - 0xb0]
lea edx, [ebp - 0xac]
call fcn.4a552488
push dword [ebp - 0xac]
push 0x4a578338
lea edx, [ebp - 0xb8]
mov eax, edi
mov ecx, dword [eax]
call dword [ecx + 0x1f8]
push dword [ebp - 0xb8]
lea eax, [ebp - 8]
mov edx, 4
call fcn.4a508570
push 0x4a5783c4
push 0x4a5783e8
push 0x4a57840c
lea edx, [ebp - 8]
mov ecx, 0x4a578438
xor eax, eax
call fcn.4a554d18
push 0
mov ebx, dword [0x4a5ed4b4]
mov ebx, dword [ebx]
lea eax, [ebp - 8]
mov ecx, 0x4a578460
mov edx, 0x4a578470
call ebx
push ebp
mov eax, dword [ebp - 8]
call fcn.4a577618
pop ecx
call sub.kernel32.dll_GetVersion_1
test eax, 0x80000000
jne 0x4a577d38
push 0
push 0
push 4
push 0
push 0
push 0xc0000000
mov eax, dword [ebp - 8]
call fcn.4a5082f8
push eax
call sub.kernel32.dll_CreateFileW_1
mov esi, eax
jmp 0x4a577d6d
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.4a508124
mov eax, dword [ebp - 0xbc]
call fcn.4a507f78
push eax
call sub.kernel32.dll_CreateFileA
mov esi, eax
cmp esi, 0xffffffff
je 0x4a578271
mov eax, edi
mov edx, dword [eax]
call dword [edx + 0x200]
test al, al
je 0x4a5781f1
push 0
push esi
call sub.kernel32.dll_GetFileSize_1
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 8]
call fcn.4a507618
cmp dword [ebp - 0x2c], 0
jbe 0x4a577e50
lea ecx, [ebp - 8]
mov edx, 0x4a578480
mov eax, dword [ebp - 4]
call fcn.4a5773d4
mov eax, dword [ebp - 8]
call fcn.4a507ae8
cmp eax, 0x1f
jne 0x4a577e48
lea ecx, [ebp - 0xc0]
mov edx, 0x4a5784a8
mov eax, dword [ebp - 4]
call fcn.4a5773d4
cmp dword [ebp - 0xc0], 0
je 0x4a577dfb
mov eax, edi
mov edx, dword [eax]
call dword [edx + 0x210]
mov byte [ebp - 0x41], al
mov eax, edi
mov edx, dword [eax]
call dword [edx + 0x220]
jmp 0x4a577e12
mov eax, edi
mov edx, dword [eax]
call dword [edx + 0x218]
mov byte [ebp - 0x41], al
mov eax, edi
mov edx, dword [eax]
call dword [edx + 0x228]
cmp byte [ebp - 0x41], 0
jne 0x4a577e22
lea eax, [ebp - 8]
call fcn.4a507618
jmp 0x4a577e50
sub al, 1
jb 0x4a577e2a
je 0x4a577e39
jmp 0x4a577e50
lea eax, [ebp - 8]
mov edx, 9
call fcn.4a508410
jmp 0x4a577e50
lea eax, [ebp - 8]
mov edx, 0x14
call fcn.4a508410
jmp 0x4a577e50
lea eax, [ebp - 8]
call fcn.4a507618
mov eax, edi
mov edx, dword [eax]
call dword [edx + 0x208]
test eax, eax
jbe 0x4a577e6d
mov eax, edi
mov edx, dword [eax]
call dword [edx + 0x208]
cmp eax, dword [ebp - 0x2c]
jb 0x4a577e71
xor eax, eax
jmp 0x4a577e73
mov al, 1
mov byte [ebp - 0x41], al
cmp byte [ebp - 0x41], 0
jne 0x4a577e86
cmp dword [ebp - 8], 0
je 0x4a5781e3
push 0
push 0
push 0
push 4
push 0
push esi
call sub.kernel32.dll_CreateFileMappingW
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
je 0x4a5781e3
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 0x4a5781da
cmp dword [ebp - 8], 0
je 0x4a578140
lea edx, [ebp - 0x14]
mov eax, dword [ebp - 8]
call fcn.4a512318
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
mov eax, dword [ebp - 0x14]
call fcn.4a507af4
add eax, 2
push eax
lea eax, [ebp - 0xc4]
mov ecx, dword [ebp - 0x14]
mov edx, 0x4a5784d4
call fcn.4a507dac
mov eax, dword [ebp - 0xc4]
call fcn.4a507f78
mov ebx, dword [0x4a5ed3f0]
mov ebx, dword [ebx]
mov edx, dword [ebp - 0x40]
pop ecx
call ebx
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jl 0x4a578136
mov eax, dword [ebp - 0x2c]
push eax
push 0
mov eax, dword [ebp - 0x30]
push eax
push 0
mov ebx, dword [0x4a5ed3f0]
mov ebx, dword [ebx]
mov eax, 0x4a5784d8
mov ecx, 0xb
mov edx, dword [ebp - 0x40]
call ebx
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jge 0x4a577f83
mov eax, dword [ebp - 0x2c]
push eax
push 0
push 0
push 0
mov ebx, dword [0x4a5ed3f0]
mov ebx, dword [ebx]
mov eax, 0x4a5784e4
mov ecx, 9
mov edx, dword [ebp - 0x40]
call ebx
mov dword [ebp - 0x34], eax
jmp 0x4a577f87
add dword [ebp - 0x34], 2
cmp dword [ebp - 0x34], 0
jl 0x4a578136
mov eax, dword [ebp - 0x2c]
push eax
push 0
mov eax, dword [ebp - 0x30]
push eax
push 0x7fffffff
mov ebx, dword [0x4a5ed3f0]
mov ebx, dword [ebx]
mov eax, 0x4a5784d8
mov ecx, 0xb
mov edx, dword [ebp - 0x40]
call ebx
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
jge 0x4a577fc8
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x38], eax
jmp 0x4a577fcc
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.4a5077d4
lea edx, [ebp - 0xc]
mov eax, dword [ebp - 0x18]
call fcn.4a5120dc
mov ecx, 0x4a5784fc
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.4a5778d0
test al, al
je 0x4a578136
mov ecx, 0x4a578520
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.4a5778d0
test al, al
je 0x4a578136
mov ecx, 0x4a5784a8
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.4a5778d0
test al, al
je 0x4a578136
mov ecx, 0x4a57854c
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.4a5778d0
test al, al
je 0x4a578136
lea ecx, [ebp - 0xc8]
mov edx, 0x4a57854c
mov eax, dword [ebp - 0xc]
call fcn.4a5773d4
cmp dword [ebp - 0xc8], 0
jne 0x4a578099
mov ecx, 0x4a578568
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.4a5778d0
test al, al
je 0x4a578136
mov ecx, 0x4a578594
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.4a5778d0
test al, al
je 0x4a578136
lea ecx, [ebp - 8]
mov edx, 0x4a5785c4
mov eax, dword [ebp - 0xc]
call fcn.4a5773d4
cmp dword [ebp - 8], 0
je 0x4a5780d4
mov eax, dword [ebp - 8]
call fcn.4a507ae8
push eax
mov eax, dword [ebp - 8]
call fcn.4a5082f8
mov edx, eax
mov ebx, dword [0x4a5ed550]
mov ebx, dword [ebx]
xor eax, eax
pop ecx
call ebx
mov dword [ebp - 0x30], eax
jmp 0x4a5780db
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.4a510eec
mov eax, dword [ebp - 0xcc]
push eax
lea eax, [ebp - 4]
mov ecx, 0x4a578480
mov edx, 0x4a5785c4
call fcn.4a57776c
mov eax, dword [ebp - 0x38]
cmp eax, dword [ebp - 0x2c]
jae 0x4a57812b
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.4a504a94
mov eax, dword [ebp - 0x38]
sub eax, dword [ebp - 0x34]
sub dword [ebp - 0x2c], eax
jmp 0x4a578140
cmp dword [ebp - 0x30], 0xffffffff
jne 0x4a577edf
cmp byte [ebp - 0x41], 0
je 0x4a5781d1
push 0
push 0
push 0
push esi
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 ebx, dword [0x4a5ed3f0]
mov ebx, dword [ebx]
mov eax, 0x4a5784d8
mov ecx, 0xb
mov edx, dword [ebp - 0x40]
call ebx
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0xffffffff
je 0x4a5781b0
mov eax, edi
mov edx, dword [eax]
call dword [edx + 0x208]
mov ebx, eax
mov eax, edi
mov edx, dword [eax]
call dword [edx + 0x208]
shr eax, 2
sub ebx, eax
mov eax, dword [ebp - 0x2c]
sub eax, dword [ebp - 0x30]
cmp ebx, eax
jbe 0x4a57815b
cmp dword [ebp - 0x30], 0xffffffff
je 0x4a5781d1
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.4a504a94
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 esi
call sub.kernel32.dll_SetFilePointer_1
push dword [ebp - 4]
push 0x4a5785dc
push 0x4a5785dc
lea eax, [ebp - 4]
mov edx, 3
call fcn.4a508570
lea edx, [ebp - 0x14]
mov eax, dword [ebp - 4]
call fcn.4a512318
push 0
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0x14]
call fcn.4a507af4
push eax
mov eax, dword [ebp - 0x14]
push eax
push esi
call sub.kernel32.dll_WriteFile_1
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x25], al
push esi
call sub.kernel32.dll_SetEndOfFile_1
push esi
call sub.kernel32.dll_CloseHandle_1
cmp dword [ebp - 0x24], 0
sete al
and al, byte [ebp + 0xc]
je 0x4a578271
lea eax, [ebp - 0x20]
call fcn.4a50aaf4
push eax
push 0x4a5785e4
push edi
mov eax, dword [edi]
call dword [eax]
test eax, eax
jne 0x4a578271
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 0x4a57831d
lea eax, [ebp - 0xcc]
mov edx, 2
call fcn.4a507678
lea eax, [ebp - 0xc4]
call fcn.4a50763c
lea eax, [ebp - 0xc0]
call fcn.4a507618
lea eax, [ebp - 0xbc]
call fcn.4a50763c
lea eax, [ebp - 0xb8]
mov edx, 5
call fcn.4a507678
lea eax, [ebp - 0xa4]
call fcn.4a50763c
lea eax, [ebp - 0xa0]
call fcn.4a507618
lea eax, [ebp - 0x9c]
call fcn.4a50763c
lea eax, [ebp - 0x98]
mov edx, 2
call fcn.4a507678
lea eax, [ebp - 0x20]
call fcn.4a50aaf4
lea eax, [ebp - 0x1c]
mov edx, 3
call fcn.4a5076a8
lea eax, [ebp - 0x10]
mov edx, 4
call fcn.4a507678
ret