Function at 0x49a840
Capabilities:
Clear file content
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6ec
mov ecx, dword [ebp + 0xc]
push ebx
lea eax, [ecx + 4]
push esi
add ecx, 0x20c
xor ebx, ebx
cmp word [ecx], bx
push edi
mov edi, dword [ebp + 8]
mov dword [esp + 0x1c], eax
je 0x49a8f5
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x49a896
cmp dx, bx
je 0x49a892
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x49a896
add eax, 4
add ecx, 4
cmp dx, bx
jne 0x49a870
xor eax, eax
jmp 0x49a89b
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x49a8f5
mov esi, dword [ebp + 0xc]
push edi
lea ecx, [esp + 0x2ec]
push ecx
add esi, 0x20c
mov ecx, esi
call fcn.0049a340
mov ecx, dword [esp + 0x1c]
push edi
lea edx, [esp + 0xe4]
push edx
call fcn.0049a340
lea eax, [esp + 0xe0]
push eax
lea ecx, [esp + 0x2ec]
push ecx
call fcn.004ac050
test al, al
jne 0x49a8e9
mov dword [esp + 0x1c], esi
jmp 0x49a8f5
mov edx, dword [esp + 0x1c]
mov esi, dword [ebp + 0xc]
call fcn.0049a2e0
mov edx, dword [esp + 0x1c]
cmp word [edx], bx
jne 0x49a9ac
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, 1
lea ecx, [ecx]
push 0xa
lea eax, [esp + 0xe4]
push eax
push edi
call fcn.0069c825
mov eax, dword [ebp + 8]
add esp, 0xc
push 0x6e9fa0
lea ecx, [esp + 0xe4]
push ecx
lea edx, [esp + 0x2f0]
push edx
call fcn.004ad3a0
push 0
push 0x80
push 1
push 0
push 0
push 0xc0000000
lea eax, [esp + 0x300]
push eax
call ebx
mov esi, eax
cmp esi, 0xffffffff
jne 0x49a973
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
jne 0x49a9a1
add edi, 1
jmp 0x49a910
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x48], esi
mov esi, dword [ebp + 0xc]
lea edx, [esp + 0xe0]
call fcn.0049a2a0
lea edx, [esp + 0xe0]
call fcn.0049a2e0
xor ebx, ebx
jmp 0x49ad72
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push edi
lea ecx, [esp + 0x4f4]
push ecx
mov ecx, dword [esp + 0x24]
call fcn.0049a340
push 4
push ebx
push 0xc0000000
lea edx, [esp + 0x4fc]
push edx
mov eax, 0x2710
call fcn.004abf70
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x48], edi
je 0x49ad59
lea eax, [esp + 0x4c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x49a9ff
xor esi, esi
mov dword [esp + 0x44], ebx
jmp 0x49aa0b
mov ecx, dword [esp + 0x50]
mov esi, dword [esp + 0x4c]
mov dword [esp + 0x44], ecx
lea eax, [esi + 1]
cmp eax, ebx
jne 0x49aa18
mov dword [esp + 0x54], ebx
jmp 0x49aa2d
push eax
call fcn.0069c0de
add esp, 4
cmp eax, ebx
mov dword [esp + 0x54], eax
je 0x49aa2d
mov edx, eax
mov byte [edx], bl
mov ecx, dword [esp + 0x54]
push ebx
lea eax, [esp + 0x44]
push eax
push esi
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x54]
cmp eax, ebx
mov byte [esi + eax], bl
mov edi, eax
jne 0x49aa52
mov edi, 0x6bc0ce
push pe_nt_image_headers32
call fcn.0069c0de
add esp, 4
cmp eax, ebx
mov dword [esp + 0x34], eax
jne 0x49aa6d
mov dword [esp + 0x3c], ebx
jmp 0x49aa77
mov byte [eax], bl
mov dword [esp + 0x3c], pe_nt_image_headers32
push 0x2000
mov dword [esp + 0x3c], ebx
call fcn.0069c0de
add esp, 4
cmp eax, ebx
mov dword [esp + 0x24], eax
jne 0x49aa96
mov dword [esp + 0x2c], ebx
jmp 0x49aaa0
mov byte [eax], bl
mov dword [esp + 0x2c], 0x2000
mov dword [esp + 0x28], ebx
cmp byte [edi], bl
je 0x49ad38
lea edx, [esp + 0x34]
lea eax, [esp + 0x24]
mov dword [esp + 0x4c], edx
mov dword [esp + 0x40], eax
lea esp, [esp]
push 0x104
lea esi, [esp + 0x38]
call fcn.00552ef0
push edi
lea ecx, [esp + 0x50]
push ecx
mov dword [esp + 0x40], ebx
call fcn.00553f40
add edi, eax
cmp byte [edi], 0x3d
jne 0x49aae7
add edi, 1
push 0x104
lea esi, [esp + 0x28]
call fcn.00552ef0
push edi
lea edx, [esp + 0x44]
push edx
mov dword [esp + 0x30], ebx
call fcn.00554070
add edi, eax
cmp byte [edi], 0
mov dword [esp + 0x30], edi
je 0x49ab16
add edi, 1
mov dword [esp + 0x30], edi
mov eax, dword [esp + 0x24]
cmp eax, ebx
je 0x49ab26
mov ecx, dword [esp + 0x28]
mov byte [ecx + eax], 0
mov eax, dword [esp + 0x34]
cmp eax, ebx
je 0x49ab3a
mov edx, dword [esp + 0x38]
mov byte [edx + eax], 0
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x38], ebx
je 0x49ad2f
cmp eax, ebx
jne 0x49ab4d
mov eax, 0x6bc0ce
push 0x40
lea ecx, [esp + 0x64]
push ecx
push 0xffffffffffffffff
push eax
push ebx
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov edx, dword [ebp + 0xc]
mov esi, dword [edx + 0x414]
cmp esi, ebx
mov word [esp + 0xde], bx
je 0x49abc4
jmp 0x49ab80
lea ecx, [esp + 0x60]
lea eax, [esi + 4]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x49abad
cmp dx, bx
je 0x49aba9
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x49abad
add eax, 4
add ecx, 4
cmp dx, bx
jne 0x49ab87
xor eax, eax
jmp 0x49abb2
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x49ac8e
cmp esi, ebx
je 0x49abc4
mov esi, dword [esi]
cmp esi, ebx
jne 0x49ab80
mov ebx, dword [esp + 0x28]
push 0x9b
add ebx, 1
call fcn.0069e704
add esp, 4
test eax, eax
jne 0x49acfe
call fcn.004b05b0
xor esi, esi
mov dword [esp + 0x20], esi
lea eax, [esp + 0x60]
mov edx, esi
mov ecx, eax
sub edx, ecx
add edx, 4
jmp 0x49ac00
movzx ecx, word [eax]
mov word [eax + edx], cx
add eax, 2
test cx, cx
jne 0x49ac00
add esi, 0x85
push ebx
call fcn.00480af0
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x49ac28
mov eax, 0x6bc0ce
mov edi, dword [esi]
push ebx
push edi
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov word [edi + ebx*2 - 2], 0
mov eax, dword [esi]
lea edx, [eax + 2]
jmp 0x49ac50
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x49ac50
sub eax, edx
mov edx, dword [esi]
sar eax, 1
mov dword [esi + 4], eax
mov word [edx + eax*2], cx
mov eax, dword [esp + 0x20]
mov ecx, dword [ebp + 0xc]
mov dword [eax], 0
mov edx, dword [ecx + 0x414]
test edx, edx
jne 0x49ad12
mov dword [ecx + 0x414], eax
jmp 0x49ad29
cmp byte [esi + 0x99], 0
jne 0x49ad2f
mov eax, dword [esp + 0x28]
add eax, 1
add esi, 0x85
push eax
call fcn.00480af0
mov eax, dword [esp + 0x24]
cmp eax, ebx
jne 0x49acbb
mov eax, 0x6bc0ce
mov ebx, dword [esp + 0x28]
mov edi, dword [esi]
add ebx, 1
push ebx
push edi
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov word [edi + ebx*2 - 2], 0
mov eax, dword [esi]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x49ace2
mov ecx, dword [esi]
sub eax, edx
sar eax, 1
mov dword [esi + 4], eax
mov word [ecx + eax*2], 0
jmp 0x49ad29
mov edi, ebx
mov esi, eax
call fcn.004c9e70
mov dword [esp + 0x20], eax
mov esi, eax
jmp 0x49abeb
mov ecx, edx
cmp dword [ecx], 0
je 0x49ad27
lea esp, [esp]
mov ecx, dword [ecx]
cmp dword [ecx], 0
jne 0x49ad20
mov dword [ecx], eax
mov edi, dword [esp + 0x30]
xor ebx, ebx
cmp byte [edi], 0
jne 0x49aac0
mov eax, dword [esp + 0x24]
push eax
call fcn.0069c8fa
mov ecx, dword [esp + 0x38]
push ecx
call fcn.0069c8fa
mov edx, dword [esp + 0x5c]
push edx
call fcn.0069c8fa
add esp, 0xc
mov eax, dword [ebp + 0xc]
add eax, 0x20c
cmp word [eax], bx
jne 0x49ad72
mov edx, dword [esp + 0x1c]
mov esi, dword [ebp + 0xc]
call fcn.0049a2e0
push 0x4000
call fcn.0069c0de
add esp, 4
cmp eax, ebx
mov dword [esp + 0x10], eax
jne 0x49ad8d
mov dword [esp + 0x18], ebx
jmp 0x49ad98
mov byte [eax], 0
mov dword [esp + 0x18], 0x4000
lea eax, [esp + 0x10]
push 0x104
mov esi, eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0x24], eax
call fcn.00552ef0
mov ecx, dword [ebp + 0xc]
mov edi, dword [ecx + 0x414]
test edi, edi
mov dword [esp + 0x14], 0
mov bl, 1
je 0x49ae9e
cmp byte [edi + 0x99], 0
je 0x49ade8
mov byte [edi + 0x99], 0
cmp byte [edi + 0x9a], 0
jne 0x49ae94
test bl, bl
jne 0x49ae2c
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov byte [eax + edx], 0x26
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
add ecx, 1
cmp ecx, eax
mov dword [esp + 0x14], ecx
jb 0x49ae2c
cmp eax, 0x20000000
ja 0x49ae27
lea ecx, [eax*4]
push ecx
lea esi, [esp + 0x14]
call fcn.00552ef0
test al, al
jne 0x49ae2c
sub dword [esp + 0x14], 1
lea edx, [edi + 4]
push edx
lea eax, [esp + 0x24]
xor bl, bl
call fcn.005552e0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov byte [eax + ecx], 0x3d
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
add ecx, 1
cmp ecx, eax
mov dword [esp + 0x14], ecx
jb 0x49ae7b
cmp eax, 0x20000000
ja 0x49ae76
lea edx, [eax*4]
push edx
lea esi, [esp + 0x14]
call fcn.00552ef0
test al, al
jne 0x49ae7b
sub dword [esp + 0x14], 1
mov eax, dword [edi + 0x85]
test eax, eax
jne 0x49ae8a
mov eax, 0x6bc0cc
push eax
lea eax, [esp + 0x24]
call fcn.005552e0
mov edi, dword [edi]
test edi, edi
jne 0x49adcb
mov eax, dword [esp + 0x10]
test eax, eax
je 0x49aeae
mov ecx, dword [esp + 0x14]
mov byte [ecx + eax], 0
mov esi, dword [esp + 0x48]
cmp esi, 0xffffffff
je 0x49aef8
xor ecx, ecx
push ecx
push ecx
push ecx
xor eax, eax
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x49aed3
mov eax, 0x6bc0ce
mov ecx, dword [esp + 0x14]
push 0
lea edx, [esp + 0x44]
push edx
push ecx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or esi, 0xffffffff
mov edx, dword [esp + 0x10]
push edx
call fcn.0069c8fa
add esp, 4
cmp esi, 0xffffffff
je 0x49af11
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 8