Function at 0x402cb0
Capabilities:
Hash data using sha1
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41299e
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x6b8
push ebx
push esi
push edi
push 0x1ff
xor esi, esi
lea eax, [esp + 0xc5]
push esi
push eax
mov byte [esp + 0xcc], 0
call sub.MSVCR100.dll_memset
mov ecx, dword [ebp + 0x10]
add esp, 0xc
push ecx
lea edx, [esp + 0xc4]
push str._sDemu.exe
push edx
call dword [sym.imp.MSVCR100.dll_sprintf]
mov edi, dword [sym.imp.MSVCR100.dll_fopen]
add esp, 0xc
lea eax, [esp + 0xc0]
push 0x41361c
push eax
call edi
mov ebx, eax
push 0x413934
push str.demu.exe.dump
mov dword [esp + 0x48], ebx
call edi
add esp, 0x10
mov dword [esp + 0x28], eax
cmp ebx, esi
je 0x40311a
push esi
push esi
push ebx
call dword [sym.imp.MSVCR100.dll_fseek]
add esp, 0xc
push 0x3ff
lea ecx, [esp + 0x2c5]
push esi
push ecx
mov byte [esp + 0x2cc], 0
call sub.MSVCR100.dll_memset
add esp, 0xc
xor edx, edx
push 0x1c
mov dword [esp + 0x60], esi
mov dword [esp + 0x64], esi
mov word [esp + 0x68], dx
mov dword [esp + 0x4c], 0x67452301
mov dword [esp + 0x50], 0xefcdab89
mov dword [esp + 0x54], 0x98badcfe
mov dword [esp + 0x58], 0x10325476
mov dword [esp + 0x5c], 0xc3d2e1f0
mov dword [esp + 0xac], esi
mov dword [esp + 0xb0], esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x24], esi
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
cmp eax, esi
je 0x40313f
mov dword [esp + 0x1c], eax
mov dword [eax], eax
mov eax, dword [esp + 0x1c]
mov dword [eax + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [eax + 8], eax
mov eax, dword [esp + 0x1c]
mov byte [eax + 0x18], 1
mov ecx, dword [esp + 0x1c]
mov byte [ecx + 0x19], 1
mov eax, dword [ebp + 8]
lea edx, [esp + 0x18]
push edx
push eax
mov dword [esp + 0x6d4], esi
call fcn.00402b20
push ebx
push 0x400
lea ecx, [esp + 0x2d0]
push 1
push ecx
call dword [sym.imp.MSVCR100.dll_fread]
mov edi, eax
add esp, 0x18
mov dword [esp + 0x14], edi
test edi, edi
jne 0x402e98
mov edi, dword [ebp + 0xc]
lea eax, [esp + 0x48]
call fcn.00401c70
mov edi, eax
test edi, edi
je 0x4030d7
mov dword [esp + 0x6cc], 2
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax]
push eax
push ecx
lea esi, [esp + 0x38]
lea eax, [esp + 0x20]
call fcn.004056e0
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov eax, edi
mov ecx, dword [esp + 0x6c4]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [esp + 0x14]
mov esi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x1c]
mov ebx, dword [ecx]
lea edx, [edi + esi - 1]
mov dword [esp + 0x10], 0
mov dword [esp + 0x3c], edx
mov dword [esp + 0x34], edi
cmp ebx, ecx
je 0x40301a
jmp 0x402ec4
mov edx, dword [esp + 0x3c]
mov eax, dword [ebx + 0x10]
cmp edx, eax
jb 0x402fde
cmp esi, eax
jae 0x402f9f
mov edx, dword [esp + 0x28]
sub eax, esi
mov esi, dword [esp + 0x10]
push edx
mov edi, eax
push edi
lea esi, [esp + esi + 0x2c8]
push 1
push esi
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
mov eax, edi
test edi, edi
je 0x402f8c
test esi, esi
je 0x402f8c
cmp dword [esp + 0xa8], 0
je 0x402f21
mov dword [esp + 0xac], 3
jmp 0x402f8c
cmp dword [esp + 0xac], 0
jne 0x402f8c
jmp 0x402f30
dec eax
cmp dword [esp + 0xac], 0
mov dword [esp + 0x40], eax
jne 0x402f8c
movsx ecx, word [esp + 0x64]
mov dl, byte [esi]
mov byte [esp + ecx + 0x66], dl
mov ecx, 1
add word [esp + 0x64], cx
add dword [esp + 0x5c], 8
jne 0x402f68
add dword [esp + 0x60], ecx
jne 0x402f68
mov dword [esp + 0xac], ecx
cmp word [esp + 0x64], 0x40
jne 0x402f86
lea eax, [esp + 0x48]
push eax
call fcn.00401d70
mov eax, dword [esp + 0x44]
add esp, 4
mov ecx, 1
add esi, ecx
test eax, eax
jne 0x402f30
add dword [esp + 0x10], edi
mov esi, dword [ebx + 0x10]
mov ecx, dword [esp + 0x1c]
mov edi, dword [esp + 0x14]
mov edx, dword [esp + 0x3c]
cmp edx, dword [ebx + 0x14]
jbe 0x403016
mov eax, dword [ebx + 0x14]
mov edi, eax
sub edi, esi
lea esi, [eax + 1]
sub edx, esi
inc edx
push ebx
lea ecx, [esp + 0x34]
mov dword [esp + 0x38], edx
push ecx
lea edx, [esp + 0x20]
push edx
inc edi
call fcn.00405010
mov ecx, dword [esp + 0x1c]
mov ebx, dword [ecx]
add dword [esp + 0x10], edi
mov edi, dword [esp + 0x14]
cmp ebx, ecx
jne 0x402ec0
jmp 0x40301a
mov eax, dword [esp + 0x28]
mov esi, dword [esp + 0x10]
push eax
push edi
lea esi, [esp + esi + 0x2c8]
push 1
push esi
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
test edi, edi
je 0x40300e
mov eax, esi
push edi
lea esi, [esp + 0x4c]
call fcn.00401cf0
add esp, 4
add dword [esp + 0x10], edi
mov ecx, dword [esp + 0x1c]
cmp ebx, ecx
jne 0x403058
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x34]
mov esi, dword [esp + 0x10]
push ecx
push edx
lea esi, [esp + esi + 0x2c8]
push 1
push esi
call dword [sym.imp.MSVCR100.dll_fwrite]
mov eax, dword [esp + 0x44]
add esp, 0x10
test eax, eax
je 0x403058
push eax
mov eax, esi
lea esi, [esp + 0x4c]
call fcn.00401cf0
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x403092
mov ecx, dword [esp + 0x38]
add edi, dword [esp + 0x2c]
push ecx
push 0x400
lea edx, [esp + 0x2c8]
push 1
push edx
mov dword [esp + 0x3c], edi
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x10
mov dword [esp + 0x14], eax
test eax, eax
jne 0x402e90
mov ebx, dword [esp + 0x38]
jmp 0x402e2a
mov dword [esp + 0x6cc], 1
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax]
push eax
push ecx
lea esi, [esp + 0x38]
lea eax, [esp + 0x20]
call fcn.004056e0
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov eax, ebx
mov ecx, dword [esp + 0x6c4]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 4
mov dword [esp + 0x6cc], 3
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax]
push eax
push ecx
lea esi, [esp + 0x38]
lea eax, [esp + 0x20]
call fcn.004056e0
mov dword [esp + 0x6cc], 0xffffffff
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov edx, dword [esp + 0x28]
push edx
call dword [sym.imp.MSVCR100.dll_fclose]
mov ecx, dword [esp + 0x6c8]
add esp, 4
pop edi
pop esi
xor eax, eax
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x44]
push eax
lea ecx, [esp + 0xb8]
mov dword [esp + 0x48], esi
call dword [sym.imp.MSVCR100.dll_public:_void___thiscall_std::exception::constructor_char_const__const_const__]
push 0x415c70
lea ecx, [esp + 0xb8]
push ecx
mov dword [esp + 0xbc], vtable.std::bad_alloc.0
call sub.MSVCR100.dll__CxxThrowException
int3