Function at 0x402160
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x83c
mov eax, dword [esp + 0x850]
mov dword [esp + 4], 0x413176
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
mov ebx, eax
je 0x402599
mov dword [esp + 0xc], eax
lea eax, [esp + 0x30]
mov dword [esp + 8], 0x400
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 0x400
je 0x4021e0
call dword [sym.imp.msvcrt.dll__errno]
cmp dword [eax], 9
je 0x4021c9
mov dword [esp], str.read
call sub.msvcrt.dll_perror
mov dword [esp], ebx
xor ebx, ebx
call sub.msvcrt.dll_fclose
add esp, 0x83c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov eax, dword [esp + 0x850]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea eax, [eax + eax + 2]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov ebp, eax
je 0x402260
mov eax, dword [esp + 0x850]
xor esi, esi
movzx ebx, byte [eax]
test bl, bl
je 0x40225b
mov edi, eax
add edi, 1
nop
movsx eax, bl
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_isalnum]
test eax, eax
jne 0x402242
mov eax, dword [esp + 0x850]
mov byte [ebp + esi], 0x5c
add esi, 1
movzx ebx, byte [eax]
mov dword [esp + 0x850], edi
add edi, 1
mov byte [ebp + esi], bl
movzx ebx, byte [edi - 1]
add esi, 1
test bl, bl
jne 0x402220
mov byte [ebp + esi], 0
cmp byte [esp + 0x34], 0
jne 0x402272
cmp byte [esp + 0x35], 0
je 0x4024b0
xor eax, eax
test byte [esp + 0x33], 8
setne al
mov dword [esp + 0x2c], eax
je 0x40256a
mov esi, str.__best
xor edi, edi
lea ebx, [esp + 0x430]
mov dword [esp + 0x28], ebp
jmp 0x4022d1
call dword [sym.imp.msvcrt.dll__errno]
cmp dword [eax], 9
je 0x4022b7
mov dword [esp], str.read
call sub.msvcrt.dll_perror
mov dword [esp], ebp
call sub.msvcrt.dll_fclose
add edi, 1
mov esi, dword [edi*4 + 0x413760]
test esi, esi
je 0x402490
mov eax, dword [esp + 0x28]
mov dword [esp + 0x10], esi
mov dword [esp + 8], str.zcat__s__gzip__n__s_2___dev_null
mov dword [esp + 4], 0x400
mov dword [esp + 0xc], eax
mov dword [esp], ebx
call fcn.00410a30
mov eax, dword [0x418020]
test eax, eax
jne 0x402450
mov dword [esp + 4], 0x413176
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll__popen]
test eax, eax
mov ebp, eax
je 0x402471
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x400
mov dword [esp + 4], 1
mov dword [esp], ebx
call sub.msvcrt.dll_fread
cmp eax, 0x400
jne 0x4022a0
mov dword [esp], ebp
call sub.msvcrt.dll_fclose
lea edx, [esp + 0x3a]
test byte [esp + 0x33], 8
je 0x40236b
mov dword [esp], edx
mov dword [esp + 0x24], edx
call sub.msvcrt.dll_strlen
mov edx, dword [esp + 0x24]
lea edx, [edx + eax + 1]
test byte [esp + 0x433], 8
lea ebp, [esp + 0x43a]
je 0x402390
mov dword [esp], ebp
mov dword [esp + 0x24], edx
call sub.msvcrt.dll_strlen
mov edx, dword [esp + 0x24]
lea ebp, [ebp + eax + 1]
mov dword [esp + 8], 0x384
mov dword [esp + 4], ebp
mov dword [esp], edx
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x4022bf
mov ebp, dword [esp + 0x28]
mov dword [esp], ebp
call sub.msvcrt.dll_free
test esi, esi
je 0x4025aa
mov eax, dword [esp + 0x2c]
mov dword [esp], esi
test eax, eax
jne 0x402510
call sub.msvcrt.dll_strlen
add eax, 0xb
mov dword [esp], eax
call sub.msvcrt.dll_malloc
cmp byte [esi], 0
mov ebx, eax
jne 0x402524
mov byte [eax], 0
mov edx, ebx
mov ecx, dword [edx]
add edx, 4
lea eax, [ecx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x4023ef
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea ecx, [edx + 2]
cmove edx, ecx
add al, al
mov eax, dword [str.__no_name]
sbb edx, 3
sub edx, ebx
mov dword [ebx + edx], eax
mov eax, dword [0x413778]
mov dword [ebx + edx + 4], eax
movzx eax, word [0x41377c]
mov word [ebx + edx + 8], ax
add esp, 0x83c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.running__s_to_determine_gzip_options_n
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x402302
add edi, 1
mov dword [esp], ebx
call sub.msvcrt.dll_perror
mov esi, dword [edi*4 + 0x413760]
test esi, esi
jne 0x4022d1
nop
lea esi, [esi]
mov ebp, dword [esp + 0x28]
xor ebx, ebx
mov dword [esp], ebp
call sub.msvcrt.dll_free
add esp, 0x83c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
cmp byte [esp + 0x36], 0
jne 0x402272
cmp byte [esp + 0x37], 0
jne 0x402272
xor eax, eax
test byte [esp + 0x33], 8
setne al
mov dword [esp + 0x2c], eax
je 0x402286
mov eax, dword [sym.imp.msvcrt.dll__iob]
xor ebx, ebx
mov dword [esp + 8], 0x30
mov dword [esp + 4], 1
mov dword [esp], str.cant_recompress__stream_has_fname_but_no_mtime_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4021d3
call sub.msvcrt.dll__strdup
add esp, 0x83c
mov ebx, eax
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], esi
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
mov edx, ebx
mov ecx, dword [edx]
add edx, 4
lea eax, [ecx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x402532
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea ecx, [edx + 2]
cmove edx, ecx
add al, al
sbb edx, 3
mov word [edx], 0x20
jmp 0x4023ed
mov eax, dword [sym.imp.msvcrt.dll__iob]
xor ebx, ebx
mov dword [esp + 8], 0x30
mov dword [esp + 4], 1
mov dword [esp], str.cant_recompress__stream_has_mtime_but_no_fname_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4021d3
mov dword [esp], 0x413179
call sub.msvcrt.dll_perror
jmp 0x4021d3
xor ebx, ebx
jmp 0x4021d3