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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x85c
mov eax, dword [0x579aa4]
xor eax, esp
mov dword [esp + 0x858], eax
push ebx
mov ebx, ecx
cmp dword [ebx + 4], 0
push esi
push edi
jne 0x401608
cmp dword [ebx], 0xffffffff
jne 0x401608
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0x252]
push ecx
mov dword [ebx + 4], 1
mov word [esp + 0x254], ax
call fcn.0050c770
xor edx, edx
push 0x206
push edx
lea eax, [esp + 0x56]
push eax
mov word [esp + 0x58], dx
call fcn.0050c770
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
add esp, 0x18
push 0x104
lea ecx, [esp + 0x454]
push ecx
push 0
call esi
mov eax, dword [0x57d464]
push 0x104
lea edx, [esp + 0x65c]
push edx
push eax
call esi
mov edi, dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
lea ecx, [esp + 0x450]
push ecx
call edi
mov esi, 0x104
lea ecx, [esp + 0x40]
cmp word [ecx], 0
je 0x401355
add ecx, 2
sub esi, 1
jne 0x401345
jmp 0x401376
test esi, esi
je 0x401376
mov edx, 0x104
sub edx, esi
mov ecx, 0x104
push eax
sub ecx, edx
lea edx, [esp + edx*2 + 0x44]
mov eax, SysReAllocString
call fcn.00405f40
lea edx, [esp + 0x40]
push 0x2e
push edx
call fcn.0050c7ea
add esp, 8
test eax, eax
je 0x40138f
xor ecx, ecx
mov word [eax + 2], cx
lea edx, [esp + 0x658]
push edx
call edi
mov ecx, 0x104
lea edx, [esp + 0x40]
cmp word [edx], 0
je 0x4013b2
add edx, 2
sub ecx, 1
jne 0x4013a2
jmp 0x4013d3
test ecx, ecx
je 0x4013d3
mov edx, 0x104
sub edx, ecx
mov ecx, 0x104
push eax
sub ecx, edx
lea edx, [esp + edx*2 + 0x44]
mov eax, SysReAllocString
call fcn.00405f40
lea eax, [esp + 0x40]
push 0x2e
push eax
call fcn.0050c7ea
add esp, 8
test eax, eax
je 0x4013ec
xor ecx, ecx
mov word [eax + 2], cx
mov ecx, 0x104
lea eax, [esp + 0x40]
cmp word [eax], 0
je 0x401405
add eax, 2
sub ecx, 1
jne 0x4013f5
jmp 0x40142a
test ecx, ecx
je 0x40142a
mov eax, 0x104
sub eax, ecx
mov ecx, 0x104
sub ecx, eax
lea edx, [esp + eax*2 + 0x40]
push 0x55c748
mov eax, SysReAllocString
call fcn.00405f40
lea eax, [esp + 0x248]
lea esi, [esp + 0x450]
mov ecx, eax
mov edx, 0x104
sub esi, ecx
lea ecx, [edx + 0x7ffffefa]
test ecx, ecx
je 0x401461
movzx ecx, word [esi + eax]
test cx, cx
je 0x401461
mov word [eax], cx
add eax, 2
sub edx, 1
jne 0x401441
jmp 0x401465
test edx, edx
jne 0x401468
sub eax, 2
mov esi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
xor edx, edx
mov word [eax], dx
push 0x55c750
lea eax, [esp + 0x24c]
push eax
call esi
lea ecx, [esp + 0x40]
push ecx
lea edx, [esp + 0x24c]
push edx
call esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x80
push 3
push 0
push 7
push 0x40000000
lea eax, [esp + 0x260]
push eax
call esi
mov dword [ebx], eax
cmp eax, 0xffffffff
je 0x4014d8
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0x500000
jbe 0x40151c
mov eax, dword [ebx]
cmp eax, 0xffffffff
je 0x4014d8
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0x80
push 2
push 0
push 3
push 0x40000000
lea ecx, [esp + 0x260]
push ecx
call esi
mov dword [ebx], eax
cmp eax, 0xffffffff
je 0x401608
push 0
lea edx, [esp + 0x24]
push edx
push 2
lea ecx, [esp + 0x34]
push ecx
push eax
mov dword [esp + 0x3c], 0xfeff
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebx]
push 2
push 0
push 0
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x38]
push edx
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessTimes]
test eax, eax
je 0x4015ce
lea ecx, [esp + 0x20]
push ecx
mov edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_FileTimeToLocalFileTime]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
movzx edx, word [esp + 0x1e]
movzx eax, word [esp + 0x1c]
movzx ecx, word [esp + 0x1a]
push edx
movzx edx, word [esp + 0x1c]
push eax
movzx eax, word [esp + 0x1e]
push ecx
movzx ecx, word [esp + 0x1e]
push edx
movzx edx, word [esp + 0x20]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [esp + 0x470]
push eax
push str.Process__s__d___
push ebx
call fcn.004011c0
add esp, 0x2c
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x858]
xor ecx, esp
call fcn.0050c75f
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx edx, word [esp + 0x16]
movzx eax, word [esp + 0x12]
movzx ecx, word [esp + 0x10]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea edx, [esp + 0x460]
push edx
push str.Process__s__d____d__02d__02d_
push ebx
call fcn.004011c0
add esp, 0x1c
mov ecx, dword [esp + 0x864]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0050c75f
mov esp, ebp
pop ebp
ret