Function at 0x407860
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x118
push ebx
mov ebx, dword [esp + 0x120]
push ebp
push esi
mov esi, dword [esp + 0x12c]
push edi
push 0x407800
push 0x1c
push esi
push ebx
call dword [sym.imp.MSVCRT.dll_qsort]
add esp, 0x10
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push 0x425d70
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x4078cf
push 0
push str.Error
push str.Cant_create_pack_file.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x118
ret
test esi, esi
mov dword [esp + 0x14], 0
jle 0x407aa1
fild dword [esp + 0x130]
add ebx, 0x18
fstp qword [esp + 0x1c]
fild dword [esp + 0x14]
push 0
fmul qword [0x410978]
fdiv qword [esp + 0x20]
call sub.MSVCRT.dll__ftol
push eax
mov eax, dword [0x425a38]
push 0x402
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
push 1
push 0
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
mov dword [ebx - 0x18], eax
jl 0x407a3a
mov edi, 0x42e684
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x24]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x24]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebx - 0x14]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x10]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
push ecx
call fcn.00406f70
mov edx, dword [esp + 0x13c]
add esp, 8
xor cl, cl
mov esi, eax
mov eax, dword [esp + 0x10]
test edx, edx
je 0x4079b9
cmp eax, 4
jbe 0x4079b9
cmp dword [esi], 0x1020304
jne 0x4079b9
sub eax, 4
mov cl, 1
mov dword [esp + 0x10], eax
test esi, esi
je 0x407a62
test edx, edx
je 0x407a28
test cl, cl
jne 0x407a2c
push eax
push esi
call fcn.00402580
mov eax, dword [esp + 0x18]
add esp, 8
lea ecx, [esp + 0x18]
push 0
push ecx
push eax
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x18]
cmp edx, eax
jne 0x407a70
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x134]
mov dword [ebx], eax
mov eax, dword [esp + 0x18]
add esp, 4
inc eax
add ebx, 0x1c
cmp eax, ecx
mov dword [esp + 0x14], eax
jl 0x4078ed
mov ebx, dword [esp + 0x12c]
mov esi, ecx
jmp 0x407aa1
test cl, cl
je 0x4079d7
lea edx, [esp + 0x18]
push 0
push edx
push eax
lea eax, [esi + 4]
push eax
jmp 0x4079e0
push 0
push str.Error
push str.Seek_error_on_pack_file.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x118
ret
push 0
push str.Error
push str.Error_opening_source_file.
jmp 0x407a46
push 0
push str.Error
push str.Error_writing_pack_file.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x118
ret
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 0x134]
push edi
push esi
push ebx
call fcn.00407270
add esp, 0xc
test eax, eax
je 0x407a55
test edi, edi
je 0x407ad8
lea ecx, [esi*8]
sub ecx, esi
shl ecx, 2
push ecx
push ebx
call fcn.00402ab0
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x118
ret