Function at 0x4179a6
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x158
mov eax, dword [0x4e22e4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 6
mov ebx, ecx
pop ecx
xor eax, eax
push 0x103
lea edi, [ebp - 0x1f]
push eax
mov byte [ebp - 0x20], 0
rep stosd dword es:[edi], eax
mov byte [ebp - 0x148], al
lea eax, [ebp - 0x147]
mov esi, edx
push eax
mov dword [ebp - 0x158], esi
call fcn.00401f80
add esp, 0xc
push 6
xor eax, eax
and dword [ebp - 0x14c], eax
pop ecx
lea edi, [ebp - 0x3b]
mov byte [ebp - 0x3c], 0
mov edx, esi
rep stosd dword es:[edi], eax
call fcn.00439e45
test eax, eax
je 0x417a15
xor eax, eax
jmp 0x417cf7
test ebx, ebx
je 0x417a0e
push esi
mov ecx, 0x104
lea eax, [ebp - 0x148]
call fcn.00438c78
pop ecx
mov edx, eax
call fcn.004399f2
mov eax, edx
push eax
mov esi, 0x4ae828
call fcn.00438c03
mov edi, eax
neg edi
sbb edi, edi
inc edi
xor esi, esi
pop ecx
mov dword [ebp - 0x150], edi
mov dword [ebp - 0x154], esi
cmp edi, esi
je 0x417a98
push esi
push esi
push esi
push esi
push esi
push 0x19
pop ecx
lea eax, [ebp - 0x20]
call fcn.00466a7e
add esp, 0x14
lea edx, [ebp - 0x20]
call fcn.00439e45
test eax, eax
jne 0x417a98
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x148]
push eax
call fcn.004397d9
pop ecx
pop ecx
test eax, eax
je 0x417a98
mov dword [ebp - 0x154], 1
push esi
mov esi, ebx
call fcn.00416e36
cmp dword [ebx + 0x88], 0
pop ecx
je 0x417ab0
cmp dword [ebx + 0x24], 0
je 0x417abb
xor ecx, ecx
call fcn.00466bca
mov esi, eax
jmp 0x417ac1
mov esi, dword [ebp - 0x14c]
lea edx, [ebp - 0x3c]
call fcn.00439e45
test eax, eax
jne 0x417add
lea eax, [ebp - 0x3c]
push eax
push 0x19
lea eax, [ebx + 0x6c]
pop ecx
call fcn.00438c78
pop ecx
test esi, esi
je 0x417ae7
mov dword [ebx + 0x88], esi
and dword [ebx + 0x24], 0
cmp dword [ebx + 0x90], 0
mov esi, 0x300c
mov dword [ebx + 0x2f90], 1
mov dword [ebx], esi
jne 0x417b0c
and dword [ebx + 0x8c], 0
mov eax, 0x1f4
cmp dword [ebx + 0x8c], eax
jle 0x417b1f
mov dword [ebx + 0x8c], eax
test edi, edi
je 0x417b49
call fcn.0040237f
push eax
push 0
push 0
call fcn.004557a2
pop ecx
pop ecx
push eax
lea eax, [ebp - 0x148]
push str._stemp_d.sls
push eax
call fcn.00401954
add esp, 0x10
xor edx, edx
xor eax, eax
cmp eax, 4
jb 0x417b57
cmp eax, 8
jb 0x417b6b
cmp eax, 0x90
jl 0x417b65
cmp eax, 0x94
jl 0x417b6b
movzx ecx, byte [ebx + eax]
add edx, ecx
inc eax
cmp eax, esi
jb 0x417b4d
mov eax, dword [ebx + 0x8c]
add edx, esi
test eax, eax
jle 0x417bb1
shl eax, 6
xor ecx, ecx
test eax, eax
jle 0x417baf
mov eax, dword [ebx + 0x8c]
shl eax, 6
mov dword [ebp - 0x14c], eax
mov eax, dword [ebx + 0x90]
movzx edi, byte [eax + ecx]
add edx, edi
inc ecx
cmp ecx, dword [ebp - 0x14c]
jl 0x417b9a
mov edi, dword [ebp - 0x150]
add edx, ecx
mov dword [ebx + 4], edx
push 0x10c
push str.GetSalesSa7.c
mov edx, 0x4ae7a4
lea ecx, [ebp - 0x148]
call fcn.0048d34e
pop ecx
pop ecx
mov dword [ebp - 0x14c], eax
test eax, eax
je 0x417a0e
push eax
push 1
push esi
push ebx
call fcn.0040257f
add esp, 0x10
cmp eax, 1
je 0x417c13
mov ecx, dword [ebp - 0x14c]
call fcn.0048fc61
test edi, edi
je 0x417a0e
lea eax, [ebp - 0x148]
call fcn.0048e81f
jmp 0x417a0e
mov eax, dword [ebx + 0x8c]
xor esi, esi
cmp eax, esi
jle 0x417c54
mov dword [ebp - 0x150], esi
push dword [ebp - 0x14c]
mov eax, dword [ebx + 0x90]
add eax, dword [ebp - 0x150]
push 1
push 0x40
push eax
call fcn.0040257f
add dword [ebp - 0x150], 0x40
add esp, 0x10
inc esi
cmp esi, dword [ebx + 0x8c]
jl 0x417c25
mov ecx, dword [ebp - 0x14c]
call fcn.0048fc61
xor ebx, ebx
cmp edi, ebx
je 0x417cf4
cmp dword [ebp - 0x154], ebx
je 0x417c8a
cmp dword [ebp + 8], ebx
je 0x417c8a
push 0x132
push str.GetSalesSa7.c
push 0x40
call fcn.0046bf44
add esp, 0xc
call fcn.0041a958
mov edx, dword [ebp - 0x158]
push ebx
lea ecx, [ebp - 0x148]
mov esi, eax
call fcn.0048f001
pop ecx
test eax, eax
jne 0x417cd4
call fcn.0041a958
sub eax, esi
cmp eax, 0x1388
jae 0x417cd4
push 0xfa
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 0x158]
push ebx
lea ecx, [ebp - 0x148]
call fcn.0048f001
pop ecx
cmp dword [ebp - 0x154], ebx
je 0x417ce9
cmp dword [ebp + 8], ebx
je 0x417ce9
push 0x40
call fcn.0046821e
pop ecx
lea eax, [ebp - 0x148]
call fcn.0048e81f
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401317
leave
ret