Function at 0x51aec0
Capabilities:
Check if file exists
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5f2d65
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x69001c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov esi, dword [ebp + 8]
test esi, esi
js 0x51b676
cmp esi, dword [edi + 0x7c]
jge 0x51b676
mov ebx, dword [ebp + 0xc]
shl esi, 5
add esi, dword [edi + 0x78]
mov dword [ebp + 8], esi
mov ebx, dword [ebx]
cmp byte [esi + 0x1c], 0
je 0x51af44
test ebx, ebx
je 0x51af2e
mov eax, dword [ebx]
mov ecx, ebx
push 0
push dword [esi + 0xc]
call dword [eax + 0x1c]
mov eax, dword [ebx]
mov ecx, ebx
push 0
push dword [esi + 0xc]
call dword [eax + 0x20]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [esi + 4]
mov dword [ebp - 0x30], eax
add eax, 0xfffffffc
cmp eax, 6
ja case.0x51af59.6
movzx eax, byte [eax + 0x51b6a0]
jmp dword [eax*4 + 0x51b698]
mov ecx, dword [edi + 0x70]
cmp dword [ecx - 0xc], 0
jne 0x51af6c
mov ecx, dword [edi + 0x68]
add ecx, 0xfffffff0
call fcn.00409460
add eax, 0x10
mov dword [ebp - 0x18], eax
mov dword [ebp - 4], 1
lea eax, [esi + 0x18]
push eax
lea edx, [ebp - 0x18]
mov dword [ebp - 0x20], eax
lea ecx, [ebp - 0x14]
call fcn.004fb4e0
add esp, 4
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x28]
mov eax, dword [esi + 0xc]
push dword [ebp - 0x18]
mov dword [ebp - 0x24], eax
call fcn.00416940
mov byte [ebp - 4], 3
lea edx, [ebp - 0x28]
lea ecx, [ebp - 0x2c]
call fcn.00500180
mov byte [ebp - 4], 4
push dword [eax]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp eax, 1
sete byte [ebp - 0xd]
mov byte [ebp - 4], 3
or eax, 0xffffffff
mov edx, dword [ebp - 0x2c]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x51afec
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
or eax, 0xffffffff
mov edx, dword [ebp - 0x28]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x51b00b
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp byte [ebp - 0xd], 0
jne 0x51b07c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov edx, eax
lea ecx, [ebp + 8]
add edi, 0xd4
call fcn.004fd870
add esp, 4
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x14]
mov ebx, dword [eax]
mov esi, dword [ebp - 0x14]
call fcn.004ffb30
test al, al
je 0x51b043
add esi, 8
push ebx
push esi
push 0x104
push edi
call fcn.00509420
add esp, 0x10
mov byte [ebp - 4], 2
or eax, 0xffffffff
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x51b072
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, 0xe
jmp 0x51b620
mov ecx, dword [ebp - 0x18]
push 0
push dword [ebp - 0x24]
call fcn.005275a0
add esp, 8
test al, al
jne 0x51b180
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x51b0b2
mov eax, dword [ecx]
push 0
push dword [ebp - 0x24]
push dword [ebp - 0x18]
call dword [eax]
test eax, eax
jne 0x51b180
cmp byte [0x697f7c], 0
je 0x51b176
call fcn.00409c60
mov ecx, eax
test ecx, ecx
je 0x51b682
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp + 8], eax
mov byte [ebp - 4], 0xb
lea ecx, [ebp + 8]
push 0x26
push str.Not_enough_disk_space_to_extract_file:
call fcn.0041a840
push dword [ebp - 0x20]
lea edx, [ebp - 0x18]
lea ecx, [ebp + 0xc]
call fcn.004fb4e0
add esp, 4
mov byte [ebp - 4], 0xc
mov edx, dword [eax]
test edx, edx
je 0x51b129
mov ecx, edx
lea esi, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x51b110
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp + 8]
call fcn.0041a840
lea eax, [ebp + 8]
mov ecx, 0x697f44
push eax
call fcn.00531fd0
mov byte [ebp - 4], 0xb
or ebx, 0xffffffff
mov edx, dword [ebp + 0xc]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x51b158
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
mov eax, ebx
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x51b176
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, 0xa
jmp 0x51b620
test ebx, ebx
je 0x51b1be
mov eax, dword [ebx]
mov ecx, ebx
push 0
push dword [esi + 0xc]
call dword [eax + 0x1c]
mov eax, dword [ebx]
lea ecx, [ebp - 0x14]
mov eax, dword [eax + 0x14]
mov dword [ebp - 0x28], eax
mov eax, dword [esi]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp + 0xc], eax
call fcn.004ffb30
test al, al
mov eax, dword [ebp + 0xc]
je 0x51b1b5
add eax, 8
push dword [ebp - 0x2c]
mov ecx, ebx
push eax
call dword [ebp - 0x28]
cmp dword [ebp - 0x30], 0xc
jne 0x51b1d3
lea eax, [ebp - 0x14]
lea ecx, [edi + 0xa4]
push eax
call fcn.004fa910
lea eax, [edi + 0xb0]
xor dl, dl
push eax
lea ecx, [ebp - 0x14]
call fcn.004fff60
add esp, 4
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x44], 0x61675c
mov dword [ebp - 0x40], eax
mov byte [ebp - 4], 0x10
cmp eax, 0xffffffff
jne 0x51b360
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov edx, eax
lea ecx, [ebp + 8]
add edi, 0xd4
call fcn.004fd870
add esp, 4
mov byte [ebp - 4], 0x11
lea ecx, [ebp - 0x14]
mov ebx, dword [eax]
mov esi, dword [ebp - 0x14]
call fcn.004ffb30
test al, al
je 0x51b24e
add esi, 8
push ebx
push esi
push 0x104
push edi
call fcn.00509420
add esp, 0x10
mov byte [ebp - 4], 0x10
or ebx, 0xffffffff
mov edx, dword [ebp + 8]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x51b27f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp byte [0x697f7c], 0
je 0x51b3f0
call fcn.00409c60
mov ecx, eax
test ecx, ecx
je 0x51b68c
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp + 8], eax
mov byte [ebp - 4], 0x15
lea ecx, [ebp + 8]
push 0x17
push str.Failed_to_extract_file:
call fcn.0041a840
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x51b2de
mov edx, eax
lea esi, [edx + 2]
mov cx, word [edx]
add edx, 2
test cx, cx
jne 0x51b2c5
sub edx, esi
lea ecx, [ebp + 8]
sar edx, 1
push edx
push eax
call fcn.0041a840
push 7
push str._Error:
lea ecx, [ebp + 8]
call fcn.0041a840
push ecx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp + 0xc]
call fcn.004fd870
add esp, 4
mov byte [ebp - 4], 0x16
mov edx, dword [eax]
test edx, edx
je 0x51b329
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x51b310
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp + 8]
call fcn.0041a840
lea eax, [ebp + 8]
mov ecx, 0x697f44
push eax
call fcn.00531fd0
mov byte [ebp - 4], 0x15
mov eax, ebx
mov edx, dword [ebp + 0xc]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x51b355
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0x10
mov eax, ebx
mov edx, dword [ebp + 8]
jmp 0x51b3db
mov ecx, dword [esi + 0x10]
xor eax, eax
add ecx, dword [edi + 0x58]
push 0
adc eax, dword [edi + 0x5c]
mov dword [ebp - 0x48], eax
lea eax, [ebp - 0x48]
push eax
push ecx
push dword [edi + 0x88]
mov dword [ebp - 0x4c], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x51b400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov edx, eax
lea ecx, [ebp + 0xc]
lea esi, [edi + 0x60]
lea ebx, [edi + 0xd4]
call fcn.004fd870
add esp, 4
mov byte [ebp - 4], 0x1a
mov ecx, esi
mov eax, dword [eax]
mov edi, dword [esi]
mov dword [ebp + 8], eax
call fcn.004ffb30
test al, al
je 0x51b3bf
add edi, 8
push dword [ebp + 8]
push edi
push 0x103
push ebx
call fcn.00509420
add esp, 0x10
mov byte [ebp - 4], 0x10
or eax, 0xffffffff
mov edx, dword [ebp + 0xc]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x51b3f0
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 2
jmp 0x51b604
mov dword [ebp - 0x28], 0
mov byte [ebp - 4], 0x1c
lea ecx, [ebp - 0x28]
push 0x10000
call fcn.0051dad0
mov dword [edi + 0xd0], 0
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0xc]
mov esi, dword [ebp - 0x28]
shr eax, 1
and eax, 0xffffff01
mov dword [ebp + 0xc], ecx
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x38], esi
test ebx, ebx
je 0x51b45a
mov eax, dword [ebx]
mov ecx, ebx
mov eax, dword [eax + 0x24]
call eax
test al, al
jne 0x51b5b5
mov ecx, dword [ebp + 0xc]
mov eax, ecx
cmp ecx, 0x10000
mov ecx, 0x10000
push 0
cmova eax, ecx
lea ecx, [ebp - 0x1c]
push ecx
push eax
push esi
push dword [edi + 0x88]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x51b4e4
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x51b4e4
cmp byte [ebp - 0x34], 0
je 0x51b49f
push eax
lea ecx, [edi + 0xc8]
push esi
call fcn.00539950
mov eax, dword [ebp - 0x1c]
push 0
lea ecx, [ebp - 0x1c]
push ecx
push eax
push esi
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x51b4e4
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x51b4e4
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0x2c]
sub ecx, eax
add edx, eax
mov dword [ebp + 0xc], ecx
mov dword [ebp - 0x2c], edx
test ebx, ebx
je 0x51b4dc
mov eax, dword [ebx]
mov ecx, ebx
push 0
push edx
call dword [eax + 0x20]
mov ecx, dword [ebp + 0xc]
test ecx, ecx
jne 0x51b442
xor edx, edx
cmp dword [edi + 0x7c], edx
jle 0x51b521
xor ebx, ebx
nop dword [eax]
test ebx, ebx
js 0x51b676
cmp edx, dword [edi + 0x7c]
jge 0x51b676
mov ecx, dword [edi + 0x78]
mov esi, dword [ebp + 8]
mov eax, dword [ecx + ebx + 0x10]
cmp eax, dword [esi + 0x10]
mov esi, dword [ebp - 0x38]
jne 0x51b518
mov byte [ecx + ebx + 0x1c], 1
inc edx
add ebx, 0x20
cmp edx, dword [edi + 0x7c]
jl 0x51b4f0
mov eax, dword [ebp - 0x24]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x51b539
push eax
call ebx
xor eax, eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x30]
cmp eax, 8
je 0x51b562
test eax, eax
je 0x51b562
cmp eax, 1
je 0x51b562
cmp eax, 0xb
je 0x51b562
cmp eax, 0xd
je 0x51b562
cmp eax, 0xe
je 0x51b562
cmp eax, 0xf
jne 0x51b5ee
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x3c], 0x61675c
mov dword [ebp - 0x38], eax
mov byte [ebp - 4], 0x1d
mov ecx, dword [edi + 0x100]
cmp ecx, dword [edi + 0x104]
je 0x51b5c2
mov dword [ecx], 0x61675c
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x38], 0
mov dword [ecx + 4], eax
add dword [edi + 0x100], 8
jmp 0x51b5d2
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 0xf
jmp 0x51b5f0
lea eax, [ebp - 0x3c]
push eax
push ecx
lea ecx, [edi + 0xfc]
call fcn.0051df80
mov byte [ebp - 4], 0x1c
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x3c], 0x61675c
test eax, eax
je 0x51b5ee
push eax
call ebx
mov dword [ebp - 0x38], 0
xor edi, edi
mov byte [ebp - 4], 0x10
push esi
call fcn.00590d25
add esp, 4
mov dword [ebp - 0x28], 0
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x44], 0x61675c
test eax, eax
je 0x51b620
push eax
call ebx
mov dword [ebp - 0x40], 0
mov byte [ebp - 4], 1
or ebx, 0xffffffff
mov edx, dword [ebp - 0x14]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x51b641
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x51b660
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 1
push 0xc000008c
call fcn.00412920
push 0x80004005
call fcn.00409920
push 0x80004005
call fcn.00409920
nop
pushal
scasd eax, dword es:[edi]
push ecx
add byte [ecx - 0x51], ch
push ecx
add byte [eax], al
add byte [ecx], al
add dword [ecx], eax
add byte [eax], al
int3