Function at 0x1031119
Capabilities:
Check for time delay via gettickcount
Delete file
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x368
mov eax, dword [0x1048628]
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push esi
mov esi, ecx
mov dword [ebp - 4], eax
push edi
lea eax, [esi + 0x20]
push eax
xor edi, edi
mov dword [ebp - 0x310], eax
call ebx
push 0x1008364
push 5
call fcn.0102ae4b
and dword [esi + 0x48], edi
cmp dword [esi + 0x38], 2
je 0x103116b
push 0x1008328
push 2
call fcn.0102ae4b
jmp 0x10316a9
mov eax, dword [esi + 0x50]
mov dword [esi + 0x38], 3
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1031178
sub eax, edi
lea edi, [eax + 1]
push edi
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
test eax, eax
pop ecx
mov dword [ebp - 0x31c], eax
jne 0x10311ab
push 0x10082fc
push 2
mov edi, 0x8007000e
call fcn.0102ae4b
jmp 0x1031688
push edi
push dword [esi + 0x50]
push dword [ebp - 0x31c]
call dword [sym.imp.msvcrt.dll_strncpy]
add esp, 0xc
push 0xf
pop ecx
xor eax, eax
lea edi, [ebp - 0x368]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x30c]
mov dword [ebp - 0x358], eax
mov eax, 0x104
mov dword [ebp - 0x354], eax
mov dword [ebp - 0x338], eax
lea eax, [ebp - 0x368]
push eax
push 0
push 0
push dword [ebp - 0x31c]
lea ecx, [ebp - 0x208]
mov dword [ebp - 0x368], 0x3c
mov dword [ebp - 0x33c], ecx
call dword [esi + 0x228]
test eax, eax
jne 0x1031257
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
jne 0x103122a
push 0x57
pop eax
test eax, eax
jg 0x1031237
call edi
test eax, eax
jne 0x103124a
push 0x57
pop eax
jmp 0x103124a
call edi
test eax, eax
jne 0x1031240
push 0x57
pop eax
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
push edi
push 0x10082d4
jmp 0x103146f
xor edi, edi
push edi
push edi
push 3
push edi
push edi
push dword [ebp - 0x350]
push dword [ebp - 0x358]
push dword [esi + 0x6c]
call dword [esi + 0x22c]
cmp eax, edi
mov dword [esi + 0x70], eax
jne 0x10312b9
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
jne 0x103128c
push 0x57
pop eax
test eax, eax
jg 0x1031299
call edi
test eax, eax
jne 0x10312ac
push 0x57
pop eax
jmp 0x10312ac
call edi
test eax, eax
jne 0x10312a2
push 0x57
pop eax
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
push edi
push 0x10082a8
jmp 0x103146f
push edi
push 0x4400200
push edi
push edi
push edi
push dword [ebp - 0x33c]
push 0x10082a4
push eax
call dword [esi + 0x23c]
cmp eax, edi
mov dword [ebp - 0x314], eax
mov dword [esi + 0x74], eax
jne 0x103131f
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
jne 0x10312f2
push 0x57
pop eax
test eax, eax
jg 0x10312ff
call edi
test eax, eax
jne 0x1031312
push 0x57
pop eax
jmp 0x1031312
call edi
test eax, eax
jne 0x1031308
push 0x57
pop eax
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
push edi
push 0x1008278
jmp 0x103146f
push dword [ebp - 0x310]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0x100824c
push 5
call fcn.0102ae4b
push edi
push edi
push edi
push edi
push dword [ebp - 0x314]
call dword [esi + 0x240]
test eax, eax
je 0x10313e3
push edi
lea eax, [ebp - 0x320]
push eax
lea eax, [ebp - 0x328]
push eax
push 0x20000013
push dword [ebp - 0x314]
mov dword [ebp - 0x320], 4
call dword [esi + 0x244]
test eax, eax
je 0x103145c
push dword [ebp - 0x328]
call fcn.01030c01
mov edi, eax
test edi, edi
jge 0x1031490
push edi
push 0x1008218
push 2
call fcn.0102ae85
add esp, 0xc
cmp dword [ebp - 0x328], 0x197
jne 0x103147e
push 0
push 7
push 0x2eee
push dword [ebp - 0x314]
push dword [esi + 0x12a4]
call dword [esi + 0x238]
cmp eax, 0x2f00
jne 0x103147e
xor edi, edi
jmp 0x1031337
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
jne 0x10313f4
push 0x57
pop eax
test eax, eax
jg 0x1031401
call edi
test eax, eax
jne 0x1031414
push 0x57
pop eax
jmp 0x1031414
call edi
test eax, eax
jne 0x103140a
push 0x57
pop eax
and eax, 0xffff
or eax, 0x80070000
push dword [ebp - 0x310]
mov edi, eax
call ebx
and dword [ebp - 0x324], 0
lea eax, [ebp - 0x314]
push eax
lea eax, [ebp - 0x104]
push eax
lea eax, [ebp - 0x324]
push eax
mov dword [ebp - 0x314], 0x100
call dword [esi + 0x248]
push edi
push 0x10081e8
push 2
call fcn.0102ae85
add esp, 0xc
jmp 0x1031486
push dword [ebp - 0x310]
mov edi, 0x8007000d
call ebx
push edi
push 0x10081b0
push 2
call fcn.0102ae85
add esp, 0xc
jmp 0x1031688
push dword [ebp - 0x310]
call ebx
mov edi, 0x80072efd
jmp 0x1031688
push dword [ebp - 0x310]
call ebx
cmp dword [esi + 0x38], 3
je 0x10314fe
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
jne 0x10314af
push 0x57
pop eax
test eax, eax
jg 0x10314bc
call edi
test eax, eax
jne 0x10314cf
push 0x57
pop eax
jmp 0x10314cf
call edi
test eax, eax
jne 0x10314c5
push 0x57
pop eax
and eax, 0xffff
or eax, 0x80070000
push dword [esi + 0x70]
lea edi, [esi + 0x234]
mov ebx, eax
call dword [edi]
push dword [esi + 0x74]
and dword [esi + 0x70], 0
call dword [edi]
and dword [esi + 0x74], 0
push ebx
push 0x1008188
push 2
call fcn.0102ae85
add esp, 0xc
jmp 0x1031683
push 4
pop ebx
push dword [ebp - 0x310]
mov dword [esi + 0x38], ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
lea eax, [ebp - 0x320]
push eax
mov dword [ebp - 0x320], ebx
lea ebx, [esi + 0x40]
push ebx
push 0x20000005
push dword [ebp - 0x314]
call dword [esi + 0x244]
test eax, eax
jne 0x1031549
push 0x1008158
push 5
call fcn.0102ae85
or dword [ebx], 0xffffffff
pop ecx
pop ecx
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
and dword [ebp - 0x318], 0
and dword [ebp - 0x32c], 0
call ebx
lea ecx, [ebp - 0x318]
mov dword [ebp - 0x324], eax
push ecx
jmp 0x10315d3
cmp dword [ebp - 0x318], 0
je 0x1031671
push 0
lea eax, [ebp - 0x32c]
push eax
push dword [ebp - 0x318]
lea eax, [esi + 0x27c]
push eax
push dword [esi + 0x78]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x103162e
mov eax, dword [ebp - 0x318]
add dword [esi + 0x44], eax
call ebx
sub eax, dword [ebp - 0x324]
xor edx, edx
mov ecx, 0x3e8
div ecx
mov ecx, eax
test ecx, ecx
jbe 0x10315cc
mov eax, dword [esi + 0x44]
xor edx, edx
div ecx
mov dword [esi + 0x48], eax
lea eax, [ebp - 0x318]
push eax
push 0x1000
lea eax, [esi + 0x27c]
push eax
push dword [ebp - 0x314]
call dword [esi + 0x230]
test eax, eax
jne 0x103156e
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
jne 0x1031604
push 0x57
pop eax
test eax, eax
jg 0x1031611
call edi
test eax, eax
jne 0x1031624
push 0x57
pop eax
jmp 0x1031624
call edi
test eax, eax
jne 0x103161a
push 0x57
pop eax
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
push edi
push 0x1008124
jmp 0x1031667
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
jne 0x103163f
push 0x57
pop eax
test eax, eax
jg 0x103164c
call edi
test eax, eax
jne 0x103165f
push 0x57
pop eax
jmp 0x103165f
call edi
test eax, eax
jne 0x1031655
push 0x57
pop eax
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
push edi
push 0x10080f8
push 2
call fcn.0102ae85
add esp, 0xc
push dword [ebp - 0x310]
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x38], 4
je 0x1031688
mov edi, 0x80004004
cmp dword [ebp - 0x31c], 0
je 0x103169d
push dword [ebp - 0x31c]
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
pop ecx
cmp edi, 0x80004004
je 0x103175c
push 0x10080e0
push 5
call fcn.0102ae4b
xor eax, eax
xor ebx, ebx
cmp edi, ebx
setge al
mov dword [esi + 0x3c], edi
lea eax, [eax*4 + 1]
mov dword [esi + 0x38], eax
mov eax, dword [esi + 0x78]
cmp eax, 0xffffffff
je 0x10316de
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [esi + 0x78], 0xffffffff
cmp edi, ebx
jge 0x10316f2
cmp dword [esi + 0x60], ebx
je 0x10316f2
push dword [esi + 0x54]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x10316f5
mov dword [esi + 0x60], ebx
lea eax, [esi + 0x278]
mov edi, dword [eax]
cmp edi, ebx
mov dword [eax], ebx
je 0x1031725
push dword [ebp - 0x310]
mov ebx, dword [esi + 0x4c]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [edi]
push ebx
push edi
call dword [eax + 0xc]
push dword [ebp - 0x310]
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x38], 5
je 0x103175c
mov eax, dword [esi + 0x50]
test eax, eax
je 0x1031741
push 0x2f
push eax
call dword [sym.imp.msvcrt.dll_strrchr]
test eax, eax
pop ecx
pop ecx
jne 0x1031746
mov eax, 0x10080d8
push dword [esi + 0x40]
push dword [esi + 0x44]
push eax
push 0x10080a4
push 5
call fcn.0102ae85
add esp, 0x14
push dword [ebp - 0x310]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.01018732
leave
ret